diff --git a/out/PiPer.safariextz b/out/PiPer.safariextz
index 16cb8e5..d9b5bf5 100644
Binary files a/out/PiPer.safariextz and b/out/PiPer.safariextz differ
diff --git a/src/scripts/main.js b/src/scripts/main.js
index 1b2ca1f..8aec9f7 100644
--- a/src/scripts/main.js
+++ b/src/scripts/main.js
@@ -638,6 +638,16 @@ const resources = {
neighbourButton.title = neighbourTitle;
});
bypassBackgroundTimerThrottling();
+
+ // 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(){
+ showingCaptions = false;
+ removeCaptions(video);
+ });
+ document.addEventListener('spfdone', function(){
+ showingCaptions = video.webkitPresentationMode == 'picture-in-picture';
+ });
},
buttonInsertBefore: function(/** Element */ parent) {
return parent.lastChild;
diff --git a/update.plist b/update.plist
index 195a9ba..e6939e5 100644
--- a/update.plist
+++ b/update.plist
@@ -10,7 +10,7 @@
CFBundleShortVersionString
0.2.1
CFBundleVersion
- 61
+ 62
Developer Identifier
BQ6Q24MF9X
URL