JWPlayer how to change Captions Track from Javascript?
In JWPlayer, how to change (or set) the Caption Tracks as i like .. lets say by clicking on the external HTML Buttons.
Lets say:
- If i click html
[ Button 1]
the Video will be captioned with "eng.srt". - If i click html
[ Button 2]
the Video will be captioned with "esp.srt".
And may be there was No Captions Tracks from the start at all. The respective Captions Tracks will be just set upon the html button click (even while playing?)
Answers
You can change the subtitles using this javascript-api-reference
Captions
These API calls are used to listen to or update the active captions track if one or more closed captions tracks are provided with a video. This API can be used to log captions usage or build your own CC menu outside JW Player.
setCurrentCaptions(index) Change the visible captions track to the provided index. The index must be within the list provided by getCaptionsList. Note an index of 0 always turns the captions Off.
onCaptionsList(callback) Fired when the list of available captions tracks is updated. Happens shortly after a playlist item starts playing. Event attributes: tracks (Array): the full array with new captions tracks.
onCaptionsChange (callback) Fired when the active captions track is changed. Happens in respons to e.g. a user clicking the controlbar CC menu or a script calling setCurrentCaptions. Event attributes: track (Number): index of the new active captions track in the getCaptionsList() array. Note the captions are Off if the track is 0.
Example set up
id="myElement">
id="Off_sub">OFF
id="Eng_sub">ENG
id="Farsi_sub">FARSI
id="Jap_sub">JAPANESE
id="Russ_sub">RUSSIAN
YOUR REQUIREMENT
Refer below API list for better understanding :
Hope it helps :)
Similar Questions
track internal javascript links
I'd like to track clicks on links that already have javascript onclick event. I'm using analytics but I have no idea how to track these clicks with it. Thanks.
Javascript to select snippet from audio track
I'm working on a project in PHP, where from a library of tracks, a user can select a track, choose a snippet from that track of a few seconds in length, and use that snippet as a search parameter on t
How do you change the Track template of a Slider?
I would want to change the track a slider. Is there a way to do this?
Start local video in fancybox mit JWPlayer, video ID in url
This is how I usually start a video file with fancybox and jwplayer. Head:/* ... */
player should load here
android: change text of button from javascript,
I want to change a textview from javascript. So I have a class for export to javascript: class ui { public ui(Context context1) { this.context = context1;} public void setMenuText() { //get buttons Bu
How i can start build Jwplayer plugins (Addons)?
I want to know everything about JWplayer , What programming languages ??to be used for the construction of these Plugins , Is there any sites help me to start Developing on jwplayer i wish someone hel
How to Merge Captions of Elements Types in SPSS Diagrams
I am trying to draw scatter diagrams with interpolate lines using SPSS 21 and 22. However, the caption generated by the SPSS shows captions of remarks and interpolation line separately. Look at the le
Youtube captions eample
Can anyone provide an example of how to retrieve captions for YouTube video? Based on API docs, API request https://gdata.youtube.com/feeds/api/videos?q=surfing&caption&v=2 returns list of vid
How to change progressbar background color using javascript
I was looking for how to change the ext.net progressbar background color using JavaScript. possibly adding a CSS class to the progressbar from JavaScript. I have tried adding a css class but failed. A
How can I change the text of a password field from javascript?
I have an chrome extension in which I want to automatically fill in a username and password field with information the user has entered already (into my application) by running external javascript on
Related to JWPlayer and Wowza
I am trying to figure it out is it that I have to use Wowza streamer along with JWPlayer to stream the video or JWPlayer streams video for me. So i will have JWPlayer java script in my web page with
Change DIV id with javascript
Trying to change the div id=test to the value from the dropdown option selected using javascript. I have a jsfiddle started. If user selects 2013 then the div id=test should change to div id=2013
JavaScript: How to strip HTML tags from string? [duplicate]
Possible Duplicate: Strip HTML from Text JavaScript How can I strip the HTML from a string in JavaScript?
Tool to track down JavaScript memory leak
I have a webapplication which has a memory leack somewhere and I am unable to detect it. I already tried the Chrome developer tools which normally work great, but I am unable to track down the lines o
JavaScript keep track of global variable?
Im trying to use the questionID variable to keep track of some questions and answers. But it seems I have problem with that the variable lose its memory, for each time I run my function ? thats what I
input.change() on javascript value insert
How is it possible to trigger .change() on a javascript value insert? Like: input.val('text string insert');
How to call javascript from Android?
How do we call javascript from Android? I have this javascript library which I would like to use, I want to call the javascript function and pass the result value to the android java code. Haven't fou
How to call javascript from a href?
How to call javascript from a href? like: script code/>Call JavaScript
How is it possible to dynamically change the flash file using swfobject through javascript
I'm looking to dynamically change the flash files based from an hyperlink on the page without the page having to reloading. Is this possible through javascript?
RENEWAL
Music by Taurus M. James
Renewal is a soulful, cinematic journey through transformation—capturing the shift from winter’s stillness to the warmth of spring.
BUY NOW!RELEASE
Your Music.
DistroKid is the only music distribution service that lets you upload unlimited music to stores for one low price!
DISTROKID