I am using Video.js for a customized video player and by default this caption shows when video games begins. How can the closed captions on Start / Autoplay be disabled?
var myPlayer = _V _ (" myPlayer "); Var video playing = true; // Video caption button var myCaption = myPlayer.controlBar.addChild ("button"); // empty button $ styling (".jjs-control-text") empty (); // Add caption to myCaption.addClass ("VJ-caption-icon"); MyCaption.addClass ("VJ-Caption-icon-on"); // Adding Functionality to Caption Button $ (".jjs-captions-icon") ('TouchStart', function () {$ ('div.vjs-captions.vjs-text-track') Toggle (); Toggleclass ('vjs-captions-icon-off');});
.vjs-captions-icon-on {background: url (../img/caption_button Png); Background-shaped: 100% 100%; } .vjs-captions-icon-off {background: url (../img/caption_button_off.png); Background-shaped: 100% 100%; }
& lt; Video ID = "myPlayer" class = "video-js vjs-sublime-skin" width = "1024px" height = "768px" Control Autoplay preload data-setup = '{"Native Control Force Touch": false}' & gt; & Lt; Source src = "../ video / brandt.mp4" type = 'video / mp34' / & gt; & Lt; Track class = "caption" type = "caption" src = "..// video / brand.weet" type = "text / plain" srclang = "en" label = "english" default /> & Lt; / Video & gt;
answer from the answer < / P>
Excerpt from there.
Showing - Text track is visible and updates and firing events
Disabled - Track track is not visible events and shootings
Hidden - Track track visible Not, but it is firing events.
So, to hide a track, you can do this:
player.textTracks () [0] .mode = 'disabled';
No comments:
Post a Comment