Fixed bug causing captions to persist in YouTube

This commit is contained in:
amarcu5
2017-08-30 23:21:54 +01:00
parent ca9fff4804
commit 696903051a
+2 -2
View File
@@ -655,11 +655,11 @@ const resources = {
// Workaround Safari bug; old captions persist in Picture in Picture mode when MediaSource buffers change
const video = /** @type {?HTMLVideoElement} */ (currentResource.videoElement());
document.addEventListener('spfrequest', function(){
window.addEventListener('yt-navigate-start', function() {
showingCaptions = false;
removeCaptions(video);
});
document.addEventListener('spfdone', function(){
window.addEventListener('yt-navigate-finish', function() {
showingCaptions = video.webkitPresentationMode == 'picture-in-picture';
});
},