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 00000000..37f92fe4 Binary files /dev/null and b/public/icons/beep.ogg differ diff --git a/public/options/options.html b/public/options/options.html index 658c3704..1b423d26 100644 --- a/public/options/options.html +++ b/public/options/options.html @@ -100,6 +100,25 @@

+ + +
+ + +
+
+ +
__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; } });