Skip to content

Commit a8909c9

Browse files
author
Nafis Islam
committed
added new build
1 parent 7590ef2 commit a8909c9

File tree

5 files changed

+85
-15
lines changed

5 files changed

+85
-15
lines changed

Sources/ContentScopeScripts/dist/contentScopeIsolated.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4848,6 +4848,8 @@
48484848
*/
48494849
class VideoOverlay {
48504850
sideEffects = new SideEffects()
4851+
/** @type {boolean} */
4852+
userOptedIntoKahfPlayer = false
48514853

48524854
/** @type {string | null} */
48534855
lastVideoId = null
@@ -5002,6 +5004,11 @@
50025004
* always remove everything first, to prevent any lingering state
50035005
*/
50045006
this.destroy();
5007+
5008+
/**
5009+
* Reset the opt-in flag for the new video
5010+
*/
5011+
this.userOptedIntoKahfPlayer = false;
50055012

50065013
/**
50075014
* When enabled, just show the small dax icon
@@ -5096,13 +5103,17 @@
50965103
/**
50975104
* To clean up, we need to stop the interval
50985105
* and then call .play() on the original element, if it's still connected
5106+
* Only resume video if user opted out, not if they opted into Kahf Player
50995107
*/
51005108
return () => {
51015109
clearInterval(int);
51025110

5103-
const video = /** @type {HTMLVideoElement} */(document.querySelector(this.settings.selectors.videoElement));
5104-
if (video?.isConnected) {
5105-
video.play();
5111+
// Only resume video if user opted out, not if they opted into Kahf Player
5112+
if (!this.userOptedIntoKahfPlayer) {
5113+
const video = /** @type {HTMLVideoElement} */(document.querySelector(this.settings.selectors.videoElement));
5114+
if (video?.isConnected) {
5115+
video.play();
5116+
}
51065117
}
51075118
}
51085119
});
@@ -5119,6 +5130,9 @@
51195130
* @param {VideoParams} params
51205131
*/
51215132
userOptIn (remember, params) {
5133+
// Mark that user opted into Kahf Player to prevent video from resuming
5134+
this.userOptedIntoKahfPlayer = true;
5135+
51225136
/** @type {import("../duck-player.js").UserValues['privatePlayerMode']} */
51235137
let privatePlayerMode = { alwaysAsk: {} };
51245138
if (remember) {

build/android/contentScope.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13622,6 +13622,8 @@
1362213622
*/
1362313623
class VideoOverlay {
1362413624
sideEffects = new SideEffects()
13625+
/** @type {boolean} */
13626+
userOptedIntoKahfPlayer = false
1362513627

1362613628
/** @type {string | null} */
1362713629
lastVideoId = null
@@ -13776,6 +13778,11 @@
1377613778
* always remove everything first, to prevent any lingering state
1377713779
*/
1377813780
this.destroy();
13781+
13782+
/**
13783+
* Reset the opt-in flag for the new video
13784+
*/
13785+
this.userOptedIntoKahfPlayer = false;
1377913786

1378013787
/**
1378113788
* When enabled, just show the small dax icon
@@ -13870,13 +13877,17 @@
1387013877
/**
1387113878
* To clean up, we need to stop the interval
1387213879
* and then call .play() on the original element, if it's still connected
13880+
* Only resume video if user opted out, not if they opted into Kahf Player
1387313881
*/
1387413882
return () => {
1387513883
clearInterval(int);
1387613884

13877-
const video = /** @type {HTMLVideoElement} */(document.querySelector(this.settings.selectors.videoElement));
13878-
if (video?.isConnected) {
13879-
video.play();
13885+
// Only resume video if user opted out, not if they opted into Kahf Player
13886+
if (!this.userOptedIntoKahfPlayer) {
13887+
const video = /** @type {HTMLVideoElement} */(document.querySelector(this.settings.selectors.videoElement));
13888+
if (video?.isConnected) {
13889+
video.play();
13890+
}
1388013891
}
1388113892
}
1388213893
});
@@ -13893,6 +13904,9 @@
1389313904
* @param {VideoParams} params
1389413905
*/
1389513906
userOptIn (remember, params) {
13907+
// Mark that user opted into Kahf Player to prevent video from resuming
13908+
this.userOptedIntoKahfPlayer = true;
13909+
1389613910
/** @type {import("../duck-player.js").UserValues['privatePlayerMode']} */
1389713911
let privatePlayerMode = { alwaysAsk: {} };
1389813912
if (remember) {

build/contentScope.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13225,6 +13225,8 @@
1322513225
*/
1322613226
class VideoOverlay {
1322713227
sideEffects = new SideEffects()
13228+
/** @type {boolean} */
13229+
userOptedIntoKahfPlayer = false
1322813230

1322913231
/** @type {string | null} */
1323013232
lastVideoId = null
@@ -13379,6 +13381,11 @@
1337913381
* always remove everything first, to prevent any lingering state
1338013382
*/
1338113383
this.destroy();
13384+
13385+
/**
13386+
* Reset the opt-in flag for the new video
13387+
*/
13388+
this.userOptedIntoKahfPlayer = false;
1338213389

1338313390
/**
1338413391
* When enabled, just show the small dax icon
@@ -13473,13 +13480,17 @@
1347313480
/**
1347413481
* To clean up, we need to stop the interval
1347513482
* and then call .play() on the original element, if it's still connected
13483+
* Only resume video if user opted out, not if they opted into Kahf Player
1347613484
*/
1347713485
return () => {
1347813486
clearInterval(int);
1347913487

13480-
const video = /** @type {HTMLVideoElement} */(document.querySelector(this.settings.selectors.videoElement));
13481-
if (video?.isConnected) {
13482-
video.play();
13488+
// Only resume video if user opted out, not if they opted into Kahf Player
13489+
if (!this.userOptedIntoKahfPlayer) {
13490+
const video = /** @type {HTMLVideoElement} */(document.querySelector(this.settings.selectors.videoElement));
13491+
if (video?.isConnected) {
13492+
video.play();
13493+
}
1348313494
}
1348413495
}
1348513496
});
@@ -13496,6 +13507,9 @@
1349613507
* @param {VideoParams} params
1349713508
*/
1349813509
userOptIn (remember, params) {
13510+
// Mark that user opted into Kahf Player to prevent video from resuming
13511+
this.userOptedIntoKahfPlayer = true;
13512+
1349913513
/** @type {import("../duck-player.js").UserValues['privatePlayerMode']} */
1350013514
let privatePlayerMode = { alwaysAsk: {} };
1350113515
if (remember) {

build/integration/contentScope.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13225,6 +13225,8 @@
1322513225
*/
1322613226
class VideoOverlay {
1322713227
sideEffects = new SideEffects()
13228+
/** @type {boolean} */
13229+
userOptedIntoKahfPlayer = false
1322813230

1322913231
/** @type {string | null} */
1323013232
lastVideoId = null
@@ -13379,6 +13381,11 @@
1337913381
* always remove everything first, to prevent any lingering state
1338013382
*/
1338113383
this.destroy();
13384+
13385+
/**
13386+
* Reset the opt-in flag for the new video
13387+
*/
13388+
this.userOptedIntoKahfPlayer = false;
1338213389

1338313390
/**
1338413391
* When enabled, just show the small dax icon
@@ -13473,13 +13480,17 @@
1347313480
/**
1347413481
* To clean up, we need to stop the interval
1347513482
* and then call .play() on the original element, if it's still connected
13483+
* Only resume video if user opted out, not if they opted into Kahf Player
1347613484
*/
1347713485
return () => {
1347813486
clearInterval(int);
1347913487

13480-
const video = /** @type {HTMLVideoElement} */(document.querySelector(this.settings.selectors.videoElement));
13481-
if (video?.isConnected) {
13482-
video.play();
13488+
// Only resume video if user opted out, not if they opted into Kahf Player
13489+
if (!this.userOptedIntoKahfPlayer) {
13490+
const video = /** @type {HTMLVideoElement} */(document.querySelector(this.settings.selectors.videoElement));
13491+
if (video?.isConnected) {
13492+
video.play();
13493+
}
1348313494
}
1348413495
}
1348513496
});
@@ -13496,6 +13507,9 @@
1349613507
* @param {VideoParams} params
1349713508
*/
1349813509
userOptIn (remember, params) {
13510+
// Mark that user opted into Kahf Player to prevent video from resuming
13511+
this.userOptedIntoKahfPlayer = true;
13512+
1349913513
/** @type {import("../duck-player.js").UserValues['privatePlayerMode']} */
1350013514
let privatePlayerMode = { alwaysAsk: {} };
1350113515
if (remember) {

build/windows/contentScope.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10089,6 +10089,8 @@
1008910089
*/
1009010090
class VideoOverlay {
1009110091
sideEffects = new SideEffects()
10092+
/** @type {boolean} */
10093+
userOptedIntoKahfPlayer = false
1009210094

1009310095
/** @type {string | null} */
1009410096
lastVideoId = null
@@ -10243,6 +10245,11 @@
1024310245
* always remove everything first, to prevent any lingering state
1024410246
*/
1024510247
this.destroy();
10248+
10249+
/**
10250+
* Reset the opt-in flag for the new video
10251+
*/
10252+
this.userOptedIntoKahfPlayer = false;
1024610253

1024710254
/**
1024810255
* When enabled, just show the small dax icon
@@ -10337,13 +10344,17 @@
1033710344
/**
1033810345
* To clean up, we need to stop the interval
1033910346
* and then call .play() on the original element, if it's still connected
10347+
* Only resume video if user opted out, not if they opted into Kahf Player
1034010348
*/
1034110349
return () => {
1034210350
clearInterval(int);
1034310351

10344-
const video = /** @type {HTMLVideoElement} */(document.querySelector(this.settings.selectors.videoElement));
10345-
if (video?.isConnected) {
10346-
video.play();
10352+
// Only resume video if user opted out, not if they opted into Kahf Player
10353+
if (!this.userOptedIntoKahfPlayer) {
10354+
const video = /** @type {HTMLVideoElement} */(document.querySelector(this.settings.selectors.videoElement));
10355+
if (video?.isConnected) {
10356+
video.play();
10357+
}
1034710358
}
1034810359
}
1034910360
});
@@ -10360,6 +10371,9 @@
1036010371
* @param {VideoParams} params
1036110372
*/
1036210373
userOptIn (remember, params) {
10374+
// Mark that user opted into Kahf Player to prevent video from resuming
10375+
this.userOptedIntoKahfPlayer = true;
10376+
1036310377
/** @type {import("../duck-player.js").UserValues['privatePlayerMode']} */
1036410378
let privatePlayerMode = { alwaysAsk: {} };
1036510379
if (remember) {

0 commit comments

Comments
 (0)