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

Is it possible to load chapter markers dynamically?


I'd like to create the marker list dynamically and load it via the api (I have thousands of files, and physical VTTs aren't an option). This doesn't work, but it's similar to what I want to achieve:

jwplayer().load([{
file: videoFile,
tracks: [{
file:
"1\n00:00:01,000 --> 00:00:02,000\n" +
"Opening credits\n\n" +
"2\n00:00:03,000 --> 00:00:04,000\n" +
"A dangerous quest\n\n" +
"3\n00:00:05,000 --> 00:00:06,000\n" +
"The attack\n",
kind: "chapters"
}]
}]);

4 Community Answers

Cooper Reid

JW Player Support Agent  
-1 rated :

The `file` parameter must be pointing to a file on your webserver – you can’t simply use the content of the file as the value of the file parameter.
-Cooper

david.lewetag

User  
0 rated :

Right - I understand that already as noted. Let me rephrase: Can tracks be added dynamically *not* using a physical file?

david.lewetag

User  
0 rated :

As a side note, I see that subtitles can be added outside of the api. However, changing the type to "chapters" doesn't add markers to the timeline.

jwplayer().onReady(function(){
var video = document.querySelector('video');
var track = video.addTextTrack("subtitles", "Markers");
track.mode = "showing";
track.addCue(new VTTCue(2, 3, "Test"));
track.addCue(new VTTCue(8, 12, "Test2"));
...

Cooper Reid

JW Player Support Agent  
0 rated :

No, tracks cannot be added dynamically not using a physical file. It must be a physical file. Also, I see you are tapping directly into the video tag – this isn’t supported by our player. We recommend you stick to our API methods:
http://support.jwplayer.com/customer/portal/articles/1413089-javascript-api-reference
-Cooper

This question has received the maximum number of answers.