Button to toggle captions.
Container to display captions.
Current track (either specified by default
attribute or chosen by the user).
Initial language to be used to render captions when turned on, and
also as a default value in the Settings
component.
Whether tracks were found in current media or not.
Instance of OpenPlayer.
List of tracks found in current media.
List of remote/local track sources in case no cues are detected natively.
List of cues associated with a specific language.
Parse WebVTT text from external domain to emulate native cues
Turn captions off.
It removed the class from the captions container to hide any text displayed.
Clean HTML text.
Prevents the triggering of script code coming from captions' text, removed styles and
also any potential events prefixed with on
.
Search track text position using binary search algorithm.
It determines the position of the track based on the media's current time.
Display current caption checking for cues or parsing remote source.
Add list of available captions in the Settings
menu.
Create HTML and insert it into OpenPlayer's DOM.
This method must include its events setup.
Remove HTML associated to specific OpenPlayer's element.
This method must include the removal of its previously set events.
Events that will be triggered in Caption element:
timeupdate
, instead of using oncuechanged
)Generated using TypeDoc
Closed Captions element.
Using
<track>
tags, this class allows the displaying of both local and remote captions bypassing CORS, and without the use of thecrossorigin
attribute.https://developer.mozilla.org/en-US/docs/Web/HTML/Element/track
https://www.html5rocks.com/en/tutorials/track/basics/
Captions
PlayerComponent