Skip to content

Commit

Permalink
Renamed addWebVttScript function and made it private
Browse files Browse the repository at this point in the history
  • Loading branch information
jrivera committed Nov 8, 2016
1 parent 9dc9d44 commit 2c584df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/js/tech/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,6 @@ class Html5 extends Tech {
*
* @param {Object} options The object should contain values for
* kind, language, label and src (location of the WebVTT file)
* @method createRemoteTextTrack
*/
createRemoteTextTrack(options) {
if (!this.featuresNativeTextTracks) {
Expand Down
10 changes: 7 additions & 3 deletions src/js/tech/tech.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,12 @@ class Tech extends Component {
});
}

addWebVttScript() {
/**
* Add vtt.js if necessary
*
* @private
*/
addWebVttScript_() {
if (!window.WebVTT && this.el().parentNode !== null && this.el().parentNode !== undefined) {
const script = document.createElement('script');

Expand Down Expand Up @@ -457,7 +462,7 @@ class Tech extends Component {
// Initially, Tech.el_ is a child of a dummy-div wait until the Component system
// signals that the Tech is ready at which point Tech.el_ is part of the DOM
// before inserting the WebVTT script
this.on('ready', this.addWebVttScript);
this.on('ready', this.addWebVttScript_);

const updateDisplay = () => this.trigger('texttrackchange');
const textTracksChanges = () => {
Expand Down Expand Up @@ -568,7 +573,6 @@ class Tech extends Component {
*
* @param {Object} options The object should contain values for
* kind, language, label and src (location of the WebVTT file)
* @method createRemoteTextTrack
*/
createRemoteTextTrack(options) {
const track = mergeOptions(options, {
Expand Down

0 comments on commit 2c584df

Please sign in to comment.