Fixes for Chrome
This commit is contained in:
parent
f12397db23
commit
d86c62664c
|
|
@ -106,14 +106,20 @@ window.VideoJSPlayer = class VideoJSPlayer extends Player
|
||||||
$('.vjs-waiting').removeClass('vjs-waiting')
|
$('.vjs-waiting').removeClass('vjs-waiting')
|
||||||
)
|
)
|
||||||
|
|
||||||
$('#ytapiplayer .vjs-subtitles-button .vjs-menu-item').each((i, elem) ->
|
# Workaround for Chrome-- it seems that the click bindings for
|
||||||
if elem.textContent == localStorage.lastSubtitle
|
# the subtitle menu aren't quite set up until after the ready
|
||||||
elem.click()
|
# event finishes, so set a timeout for 1ms to force this code
|
||||||
|
# not to run until the ready() function returns.
|
||||||
|
setTimeout(->
|
||||||
|
$('#ytapiplayer .vjs-subtitles-button .vjs-menu-item').each((i, elem) ->
|
||||||
|
if elem.textContent == localStorage.lastSubtitle
|
||||||
|
elem.click()
|
||||||
|
|
||||||
elem.onclick = ->
|
elem.onclick = ->
|
||||||
if this.attributes['aria-selected'].value == 'true'
|
if elem.attributes['aria-selected'].value == 'true'
|
||||||
localStorage.lastSubtitle = this.textContent
|
localStorage.lastSubtitle = elem.textContent
|
||||||
)
|
)
|
||||||
|
, 1)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -635,3 +635,7 @@ table td {
|
||||||
li.vjs-menu-item.vjs-selected {
|
li.vjs-menu-item.vjs-selected {
|
||||||
background-color: #66a8cc !important;
|
background-color: #66a8cc !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.video-js video::-webkit-media-text-track-container {
|
||||||
|
bottom: 50px;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -565,16 +565,18 @@
|
||||||
_this.player.on('seeked', function() {
|
_this.player.on('seeked', function() {
|
||||||
return $('.vjs-waiting').removeClass('vjs-waiting');
|
return $('.vjs-waiting').removeClass('vjs-waiting');
|
||||||
});
|
});
|
||||||
return $('#ytapiplayer .vjs-subtitles-button .vjs-menu-item').each(function(i, elem) {
|
return setTimeout(function() {
|
||||||
if (elem.textContent === localStorage.lastSubtitle) {
|
return $('#ytapiplayer .vjs-subtitles-button .vjs-menu-item').each(function(i, elem) {
|
||||||
elem.click();
|
if (elem.textContent === localStorage.lastSubtitle) {
|
||||||
}
|
elem.click();
|
||||||
return elem.onclick = function() {
|
|
||||||
if (this.attributes['aria-selected'].value === 'true') {
|
|
||||||
return localStorage.lastSubtitle = this.textContent;
|
|
||||||
}
|
}
|
||||||
};
|
return elem.onclick = function() {
|
||||||
});
|
if (elem.attributes['aria-selected'].value === 'true') {
|
||||||
|
return localStorage.lastSubtitle = elem.textContent;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}, 1);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
})(this));
|
})(this));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue