From 36981af95ad902bf61737775a50b6f9a1aadec51 Mon Sep 17 00:00:00 2001 From: Joe-Dowd Date: Sat, 4 Apr 2020 13:59:04 +0100 Subject: [PATCH 1/5] Added audio notification on skip to options menu --- manifest/manifest.json | 1 + public/_locales/en/messages.json | 6 ++++++ public/icons/beep.ogg | Bin 0 -> 4706 bytes public/options/options.html | 19 +++++++++++++++++++ src/components/SkipNoticeComponent.tsx | 12 ++++++++++++ src/config.ts | 2 ++ src/options.ts | 4 ++++ 7 files changed, 44 insertions(+) create mode 100644 public/icons/beep.ogg diff --git a/manifest/manifest.json b/manifest/manifest.json index fcfd4bc0..b02fe4ca 100644 --- a/manifest/manifest.json +++ b/manifest/manifest.json @@ -32,6 +32,7 @@ "icons/downvote.png", "icons/report.png", "icons/close.png", + "icons/beep.ogg", "icons/PlayerInfoIconSponsorBlocker256px.png", "icons/PlayerDeleteIconSponsorBlocker256px.png", "popup.html", diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 8beb64f1..86f2688f 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -291,6 +291,12 @@ "autoSkipDescription": { "message": "Auto skip will skip sponsors for you. If disabled, a notice will appear asking if you'd like to skip." }, + "audioNotification": { + "message": "Audio Notification On Skip" + }, + "audioNotificationDescription": { + "message": "Audio notification on skip will play a sound whenever a sponsor is skipped. If disabled (or auto skip is disabled), no sound will be played." + }, "youHaveSkipped": { "message": "You have skipped " }, diff --git a/public/icons/beep.ogg b/public/icons/beep.ogg new file mode 100644 index 0000000000000000000000000000000000000000..37f92fe44f43dcbeb650a545a7f733dd530eb612 GIT binary patch literal 4706 zcmc&XYgm(4nkRtraWz2DfWamhB;n$dAXA zn8pwhFi)ek@_)O*s~qOlCvEP?Jy}rn7n07vSRz?J7zkZ7#|dv zcpN&yHm#TTU{c_eVqT*Lid}&UfTm`K{9A@2(Y@ami~vC77LcOOkaqV`#&6Lb5Qnri z&=>%Lbo>e(U#?G89+Wh0InlzXZ}GX%FB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IP)8Y z3L0>A@u^M|Y(_N8P(d{FD9#ZNEe{X-9nJyw6+r)xFi|)HYR1$=;GY7U2l!|@L8^IBW;NXQVt|IV_G^o$&6sJzYI3OK9zLRHWUX_P! z1i@800G{LitQ6Sw%_@99F*=poyTmusd@KPNH~*^&9D2fiZn|!@3JcQ zpGX4s7gbp9e^o$Z`#?~LtPqJ)(tnc5)<>bM+&gG zAfj@^khToF6~VUMHV+qbLc6?wq!G9q&qt00y?Zv}cz!EyK5=eBsdK_O}mVb<}Yuy?emaSd7I| zQjS+!M)A6Thj)({d^sie<*v7zu)y25&%nI=NV@I=EIB9@qJ&Ch0l>O}Ju$Y& zvT9QDNbet2Z}puKKOZZjGrk0{e?E{Fi2wC+qT`NT z0Rf!9{9+NbEpSW9*H+EDW`6&QBKwj1Z-d+FDVgFTyR#LC@Dhd#z-V~zv!Yr>OAvF- zvHpVh{ie3c9pp`c;2z^z@5@iW`+m#h&by~u?3Vv(czERY^=g0lu96x0YBfap`w{UPw?N+!E%E2&J#3itv%BnMx7`QCxzk?|Me_bVK`|0il;)9ZkpcV7g6W}5lH zaAY*TywpQ2S?T%ox<}(roa-;&d-X21^7swZr%0upas(q_wBIyyQS;m>IVRwnQvi4-{s_Ei=6I9E(Ag?F{N zT$nu|4XRG@Y=~(~46Rk_jO?NPEtV`5?VLe(Dt`*Q-3^P?pl$%T3C9=l;Nl?s9 z`pNJnR{XtDqEmZxL@lGa2$750E%H5WQ5wVTV@YXZsETE^#EM(Xi1QVYqnN{^M)|DV zxtZcsSzTHtR)>3PTx`^%#?XLhPbZ%kI)BSEs@u*ph-;gtUc})K#YLpl$~DRem9jzJ z#d2M$^i%Z}>cy;lfd+jpAHyXRw zZ?uiFa^m zK|f8+vp!vjoj&X8?y+sI
+ + +
+ + +
+
+ +
__MSG_audioNotificationDescription__
+
+ +
+
+
diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index a366af7a..fd2e5623 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -32,6 +32,7 @@ class SkipNoticeComponent extends React.Component + + {(Config.config.audioNotificationOnSkip) && } {/* Text Boxes */} {this.getMessageBoxes()} diff --git a/src/config.ts b/src/config.ts index f11b735e..3387f4a1 100644 --- a/src/config.ts +++ b/src/config.ts @@ -25,6 +25,7 @@ interface SBConfig { supportInvidious: boolean, serverAddress: string, minDuration: number, + audioNotificationOnSkip, checkForUnlistedVideos: boolean, mobileUpdateShowCount: number, @@ -123,6 +124,7 @@ var Config: SBObject = { supportInvidious: false, serverAddress: CompileConfig.serverAddress, minDuration: 0, + audioNotificationOnSkip: false, checkForUnlistedVideos: false, mobileUpdateShowCount: 0, categorySelections: [{ diff --git a/src/options.ts b/src/options.ts index 3fd13074..24fd833d 100644 --- a/src/options.ts +++ b/src/options.ts @@ -65,6 +65,10 @@ async function init() { showNoticeSwitch.checked = true; } + break; + case "audioNotificationOnSkip": + let audioNotificationOnSkip = document.querySelector("[sync-option='audioNotificationOnSkip'] > label > label > input"); + audioNotificationOnSkip.checked = Config.config[option]; break; } }); From d7a7476cd14b574c0c9de21a00b25b3540eb4b5c Mon Sep 17 00:00:00 2001 From: Joe-Dowd Date: Sat, 4 Apr 2020 14:01:31 +0100 Subject: [PATCH 2/5] fixed tabbing --- src/components/SkipNoticeComponent.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index fd2e5623..bf8db067 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -104,10 +104,10 @@ class SkipNoticeComponent extends React.Component - + {(Config.config.audioNotificationOnSkip) && } + + } {/* Text Boxes */} {this.getMessageBoxes()} From 59c64552982be21ccf9aed5c4b05910b3c397ec2 Mon Sep 17 00:00:00 2001 From: Joe-Dowd Date: Sat, 4 Apr 2020 14:13:27 +0100 Subject: [PATCH 3/5] removed duplicate locale message --- public/_locales/en/messages.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 86f2688f..4aba4755 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -510,8 +510,5 @@ }, "manualSkip": { "message": "Manual Skip" - }, - "autoSkip": { - "message": "Auto Skip" } } From 09f53c80f066ad94525a94a6616046f687d54cb3 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sat, 4 Apr 2020 22:22:37 -0400 Subject: [PATCH 4/5] Sync volume with video volume --- src/components/SkipNoticeComponent.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index bf8db067..278d6194 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -32,7 +32,7 @@ class SkipNoticeComponent extends React.Component Date: Sat, 4 Apr 2020 22:25:10 -0400 Subject: [PATCH 5/5] Removed custom options code for audio --- src/options.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/options.ts b/src/options.ts index 24fd833d..3fd13074 100644 --- a/src/options.ts +++ b/src/options.ts @@ -65,10 +65,6 @@ async function init() { showNoticeSwitch.checked = true; } - break; - case "audioNotificationOnSkip": - let audioNotificationOnSkip = document.querySelector("[sync-option='audioNotificationOnSkip'] > label > label > input"); - audioNotificationOnSkip.checked = Config.config[option]; break; } });