Vimeo captions fix

This commit is contained in:
Sam Potts 2017-11-23 20:50:07 +11:00
parent 921cefd212
commit 61325bbad1
3 changed files with 4 additions and 4 deletions

2
dist/plyr.js vendored

File diff suppressed because one or more lines are too long

2
dist/plyr.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -32,7 +32,7 @@ const captions = {
} }
// Only Vimeo and HTML5 video supported at this point // Only Vimeo and HTML5 video supported at this point
if (!this.isVideo || this.isYouTube || (this.isVideo && !support.textTracks)) { if (!this.isVideo || this.isYouTube || (this.isHTML5 && !support.textTracks)) {
// Clear menu and hide // Clear menu and hide
if (this.config.controls.includes('settings') && this.config.settings.includes('captions')) { if (this.config.controls.includes('settings') && this.config.settings.includes('captions')) {
controls.setCaptionsMenu.call(this); controls.setCaptionsMenu.call(this);
@ -71,7 +71,7 @@ const captions = {
// Set the captions language // Set the captions language
setLanguage() { setLanguage() {
// Setup HTML5 track rendering // Setup HTML5 track rendering
if (this.isVideo) { if (this.isHTML5 && this.isVideo) {
captions.getTracks.call(this).forEach(track => { captions.getTracks.call(this).forEach(track => {
// Remove previous bindings // Remove previous bindings
utils.on(track, 'cuechange', event => captions.setCue.call(this, event)); utils.on(track, 'cuechange', event => captions.setCue.call(this, event));