mirror of
https://github.com/videojs/video.js.git
synced 2025-01-02 06:32:07 +02:00
@brkattk updated emulateTextTrack to exit early if no textTracks. closes #2426
This commit is contained in:
parent
e6f5d6b585
commit
c24a3a8173
@ -17,6 +17,7 @@ CHANGELOG
|
||||
* @forbesjo Added Microsoft Caption Maker link ([view](https://github.com/videojs/video.js/pull/2618))
|
||||
* @misteroneill updated modal dialog CSS ([view](https://github.com/videojs/video.js/pull/2756))
|
||||
* @misteroneill Add browserify
|
||||
* @brkattk updated emulateTextTrack to exit early if no textTracks ([view](https://github.com/videojs/video.js/pull/2426))
|
||||
|
||||
--------------------
|
||||
|
||||
|
@ -309,6 +309,11 @@ class Tech extends Component {
|
||||
* @method emulateTextTracks
|
||||
*/
|
||||
emulateTextTracks() {
|
||||
let tracks = this.textTracks();
|
||||
if (!tracks) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!window['WebVTT'] && this.el().parentNode != null) {
|
||||
let script = document.createElement('script');
|
||||
script.src = this.options_['vtt.js'] || '../node_modules/vtt.js/dist/vtt.js';
|
||||
@ -316,11 +321,6 @@ class Tech extends Component {
|
||||
window['WebVTT'] = true;
|
||||
}
|
||||
|
||||
let tracks = this.textTracks();
|
||||
if (!tracks) {
|
||||
return;
|
||||
}
|
||||
|
||||
let textTracksChanges = Fn.bind(this, function() {
|
||||
let updateDisplay = () => this.trigger('texttrackchange');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user