Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

file object as source


Is it possible to use a javascript file object as the source video for the player?

3 Community Answers

Alex

JW Player Support Agent  
0 rated :

Hi there,

It would not be possible to use a JavaScript file as the content to be played in the player. For a list of the file formats we do support being played in JW Player, please see our Media Formats Reference.

Thank you!

benny

User  
0 rated :

That is not what I meant.
I meant if it is possible to inject a file OBJECT as a source to be played.

For example, if I upload a video file using an upload object, can I then use this as a source for the jwplayer?

Alex

JW Player Support Agent  
0 rated :

Hi Benny,

My apologies for the miscommunication. Can you confirm that what you are trying to do is use the /videos/create endpoint of our API to upload a video and then embed that video in the player on your site?

Or are you saying that you would have a JavaScript object created through other means that you would then want to pass in to the player? If so, you can pass an object as part of either the playlist or sources block of your player configuration, as long as it contains the keys and values found in the tables on our JavaScript API Reference. The only required value is file.

For example, if your video file was found at http://yoursite.com/video.mp4, then you can pass in the following JavaScript object into the player:

var myPlaylist = {{
  "file": "http://yoursite.com/video.mp4"
}];

jwplayer("myElement").setup({
  playlist: myPlaylist
});

I hope that helps. Thank you.

This question has received the maximum number of answers.