From 9f9df9479bf6cf0bcdd838cb0433a394a1ec814c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hegymegi=20Kiss=20=C3=81ron?= Date: Sat, 11 Dec 2021 16:02:07 +0100 Subject: [PATCH 1/2] move audio notification to content.ts fixes #756 --- src/components/SkipNoticeComponent.tsx | 13 ------------- src/content.ts | 7 ++++++- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 6e8876ff..6dffccbd 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -74,7 +74,6 @@ class SkipNoticeComponent extends React.Component this.onMouseEnter() } > - - {(Config.config.audioNotificationOnSkip) && } ); } diff --git a/src/content.ts b/src/content.ts index c4bdafef..e4eaedb5 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1242,7 +1242,12 @@ function skipToTime({v, skipTime, skippingSegments, openNotice, forceAutoSkip, u break; } } - + } + + if (autoSkip && Config.config.audioNotificationOnSkip) { + const beep = new Audio(chrome.runtime.getURL("icons/beep.ogg")); + beep.volume = skipNoticeContentContainer().v.volume * 0.1; + beep.play(); } if (!autoSkip From 3d3b261f8f759852d8ea0bf34d4dc5a6127928d7 Mon Sep 17 00:00:00 2001 From: Aron HK Date: Sun, 12 Dec 2021 01:38:31 +0100 Subject: [PATCH 2/2] skipNoticeContentContainer().v -> video Co-authored-by: Ajay Ramachandran --- src/content.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content.ts b/src/content.ts index e4eaedb5..3bca3d8c 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1246,7 +1246,7 @@ function skipToTime({v, skipTime, skippingSegments, openNotice, forceAutoSkip, u if (autoSkip && Config.config.audioNotificationOnSkip) { const beep = new Audio(chrome.runtime.getURL("icons/beep.ogg")); - beep.volume = skipNoticeContentContainer().v.volume * 0.1; + beep.volume = video.volume * 0.1; beep.play(); }