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

Streaming embed code with captions


I am trying to use the streaming option, which appears to require the single line embed code, but would like to add captions on the fly. I have 2500+ videos, so adding them all via the dashboard would be very time consuming, and there are occasionally bulk edits that would be tedious to do if I then have to reupload through the dashboard again. I know there is the long form embed option which allows for adding captions, but from what I've read that does not work with HLS, etc streaming options. So basically I'm trying to figure out how to do both, use the streaming option and add captions on-the-fly in the embed code. Is this possible?

3 Community Answers

George

JW Player Support Agent  
0 rated :

Hi,

I’ll try and address your questions below:

“…I am trying to use the streaming option, which appears to require the single line embed code…”
Not true, you can use the HLS source with all embed methods.

“…I would like to add captions on the fly…”
Not sure what you mean by adding captions on the fly. Does this test page help?
http://qa.jwplayer.com.s3.amazonaws.com/~george/load_captions.html

“…I have 2500+ videos, so adding them all via the dashboard would be very time consuming, and there are occasionally bulk edits that would be tedious to do if I then have to reupload through the dashboard again…”
You can use the JW Platform API to upload and update videos:
https://developer.jwplayer.com/jw-platform/reference/v1/methods/videos/index.html

“…I know there is the long form embed option which allows for adding captions, but from what I’ve read that does not work with HLS, etc streaming options. So basically I’m trying to figure out how to do both, use the streaming option and add captions on-the-fly in the embed code. Is this possible?…”
Not too sure what you’re getting at here. Could you explain?

s...

User  
0 rated :

Looks like I am missing something then. When I setup the embed code, this is what I am using:

jwplayer("container").setup({
sources: [{
file: "http://content.jwplatform.com/videos/xxxx-xxxx.mp4",
label:"270p",
type: "mp4"
},{
file: "http://content.jwplatform.com/videos/xxxx-xxxx.mp4",
label:"406p",
type: "mp4"
},{
file: "http://content.jwplatform.com/videos/xxxx-xxxx.mp4",
label:"720p",
type: "mp4",
"default": true
}],
"height": 320,
"width": 640,
"autostart": true,
"displaytitle": false,
tracks: [{
file: "/subtitlesvtt/english/123-sub.vtt",
label: "English",
kind: "captions",
"default": true
},{
file: "/subtitlesvtt/french/123-sub.vtt",
kind: "captions",
label: "French"
}]
}
});

My understanding is that the above method does not work with adaptive streaming. As opposed to the single line embed code (<script src="//content.jwplatform.com/players/xxxx-xxx.js"> </script>), the above embed code requires setting a file option for each quality choice and requires the user to change quality, which seems to conflict with adaptive streaming.

George

JW Player Support Agent  
0 rated :

Hi,

You should refer to this document:
https://developer.jwplayer.com/jw-player/docs/developer-guide/customization/configuration-reference/#playlist

// playlist an array of playlist item objects
playlist:[
// item 1
{
file:“http://content.jwplatform.com/manifests/MEDIA_ID.m3u8”, // HLS stream, adaptive
tracks:[{
file:“caption_url”,
type:“captions”
}]
}
]

This question has received the maximum number of answers.