@kangsicj/nexussync 1.6.10 → 1.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/NexusSync.meta.js +1 -1
- package/dist/NexusSync.user.js +54 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
| Chat | Floating speech bubbles, quick replies, automatic translation of incoming messages, exportable history |
|
|
33
33
|
| Drawing and reactions | Strokes anchored to the video frame on every screen; emoji bursts; 3-2-1 countdown |
|
|
34
34
|
| Cover | Hides the picture on all screens for a few seconds; audio and subtitles continue; replays the cover on rewind |
|
|
35
|
-
| AI subtitles | Transcribes video audio into translated live subtitles; free offline Whisper on PC (downloaded on request), the browser's engine, or your own API key; glossary for names |
|
|
35
|
+
| AI subtitles | Transcribes video audio into translated live subtitles; free offline Whisper on PC and phone (downloaded on request; on iPhone the way to hear the video itself without a key), the browser's engine, or your own API key; glossary for names |
|
|
36
36
|
| Subtitles | Video tracks, local files or OpenSubtitles; up to 3 tracks at once |
|
|
37
37
|
| Timing sync | Aligns two different releases of the same film (offset by manual mark or automatic detection) |
|
|
38
38
|
| Next episode | Room persists across episodes; *Up next* countdown; sleep timer (pause after 15/30/60 min or at the end of the episode) |
|
package/dist/NexusSync.meta.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// @icon https://cdn.jsdelivr.net/npm/@kangsicj/nexussync@latest/assets/icon.svg
|
|
9
9
|
// @updateURL https://cdn.jsdelivr.net/npm/@kangsicj/nexussync@latest/dist/NexusSync.meta.js
|
|
10
10
|
// @downloadURL https://cdn.jsdelivr.net/npm/@kangsicj/nexussync@latest/dist/NexusSync.user.js
|
|
11
|
-
// @version 1.6.
|
|
11
|
+
// @version 1.6.11
|
|
12
12
|
// @description Watch any web video together in perfect sync: cinema mode, live AI subtitles & translation, chat bubbles with auto-translation, quick ink, cover, go-together to the next episode.
|
|
13
13
|
// @description:ko 어떤 웹 영상이든 완벽한 싱크로 함께 보기: 시네마 모드, 실시간 AI 자막·번역, 자동 번역 말풍선 채팅, 잠깐 그리기, 가리기, 다음 화도 함께.
|
|
14
14
|
// @match *://*/*
|
package/dist/NexusSync.user.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// @icon https://cdn.jsdelivr.net/npm/@kangsicj/nexussync@latest/assets/icon.svg
|
|
9
9
|
// @updateURL https://cdn.jsdelivr.net/npm/@kangsicj/nexussync@latest/dist/NexusSync.meta.js
|
|
10
10
|
// @downloadURL https://cdn.jsdelivr.net/npm/@kangsicj/nexussync@latest/dist/NexusSync.user.js
|
|
11
|
-
// @version 1.6.
|
|
11
|
+
// @version 1.6.11
|
|
12
12
|
// @description Watch any web video together in perfect sync: cinema mode, live AI subtitles & translation, chat bubbles with auto-translation, quick ink, cover, go-together to the next episode.
|
|
13
13
|
// @description:ko 어떤 웹 영상이든 완벽한 싱크로 함께 보기: 시네마 모드, 실시간 AI 자막·번역, 자동 번역 말풍선 채팅, 잠깐 그리기, 가리기, 다음 화도 함께.
|
|
14
14
|
// @match *://*/*
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
|
|
47
47
|
// The version of the code that is actually running (the manager's metadata can lag
|
|
48
48
|
// behind when an old copy is still installed).
|
|
49
|
-
const NXU_VERSION = '1.6.
|
|
49
|
+
const NXU_VERSION = '1.6.11';
|
|
50
50
|
// Rank used by the one-instance guard below and to tell newer builds apart in a room.
|
|
51
51
|
// It is independent of the public version (1.0.0 is the first public release, after
|
|
52
52
|
// private builds that reached ranks up to 10.2.0), so every older copy still installed
|
|
53
53
|
// steps aside instead of this release.
|
|
54
|
-
const NXU_RANK = '11.6.
|
|
54
|
+
const NXU_RANK = '11.6.11';
|
|
55
55
|
const NXU_SESSION = Math.random().toString(36).slice(2, 10); // this page load // raise with every release
|
|
56
56
|
// App icon (same artwork as assets/icon.svg / @icon), inlined so it shows offline too.
|
|
57
57
|
const NXU_ICON = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTYgMjU2IiByb2xlPSJpbWciIGFyaWEtbGFiZWw9Ik5leHVzU3luYyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJueGJnIiB4MT0iMCIgeTE9IjAiIHgyPSIxIiB5Mj0iMSI+PHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjNWIyZWZmIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmY0ZmEzIi8+PC9saW5lYXJHcmFkaWVudD48cmFkaWFsR3JhZGllbnQgaWQ9Im54Z2xvdyIgY3g9IjAuODIiIGN5PSIwLjE0IiByPSIwLjciPjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iIzdjZjlmZiIgc3RvcC1vcGFjaXR5PSIwLjU1Ii8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjN2NmOWZmIiBzdG9wLW9wYWNpdHk9IjAiLz48L3JhZGlhbEdyYWRpZW50PjxsaW5lYXJHcmFkaWVudCBpZD0ibnhwbGF5IiB4MT0iMCIgeTE9IjAiIHgyPSIxIiB5Mj0iMSI+PHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjZmZmZmZmIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZlM2YxIi8+PC9saW5lYXJHcmFkaWVudD48Y2xpcFBhdGggaWQ9Im54ciI+PHJlY3Qgd2lkdGg9IjI1NiIgaGVpZ2h0PSIyNTYiIHJ4PSI1OCIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNueHIpIj48cmVjdCB3aWR0aD0iMjU2IiBoZWlnaHQ9IjI1NiIgZmlsbD0idXJsKCNueGJnKSIvPjxyZWN0IHdpZHRoPSIyNTYiIGhlaWdodD0iMjU2IiBmaWxsPSJ1cmwoI254Z2xvdykiLz48ZyBmaWxsPSJub25lIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iMTUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTYwIDExNiBBNzAgNzAgMCAwIDEgMTc4IDcyIi8+PHBhdGggZD0iTTE5NiAxNDAgQTcwIDcwIDAgMCAxIDc4IDE4NCIvPjwvZz48cGF0aCBkPSJNMTg2IDUwIEwyMDAgOTIgTDE1NyA4NiBaIiBmaWxsPSIjZmZmZmZmIi8+PHBhdGggZD0iTTcwIDIwNiBMNTYgMTY0IEw5OSAxNzAgWiIgZmlsbD0iI2ZmZmZmZiIvPjxwYXRoIGQ9Ik0xMTAgOTIgUTEwNCA4OCAxMDQgOTYgTDEwNCAxNjAgUTEwNCAxNjggMTEwIDE2NCBMMTYyIDEzMiBRMTY4IDEyOCAxNjIgMTI0IFoiIGZpbGw9InVybCgjbnhwbGF5KSIvPjwvZz48L3N2Zz4=';
|
|
@@ -686,19 +686,22 @@ async function handle(m) {
|
|
|
686
686
|
}
|
|
687
687
|
_processToastQueue.waits = 0;
|
|
688
688
|
_toastRunning = true;
|
|
689
|
-
|
|
689
|
+
const msg = _toastQueue.shift();
|
|
690
|
+
el.textContent = msg;
|
|
690
691
|
el.style.opacity = '1';
|
|
691
692
|
clearTimeout(el._toastTimer);
|
|
693
|
+
// Long advice stays long enough to be read (about 25 characters a second).
|
|
694
|
+
const readMs = Math.min(9000, 1200 + String(msg).length * 40);
|
|
692
695
|
el._toastTimer = setTimeout(() => {
|
|
693
696
|
el.style.opacity = '0';
|
|
694
697
|
setTimeout(_processToastQueue, 250);
|
|
695
|
-
}, _toastQueue.length ? 1600 : 2400);
|
|
698
|
+
}, Math.max(_toastQueue.length ? 1600 : 2400, readMs));
|
|
696
699
|
}
|
|
697
700
|
// ───────────────────────── UI language (Korean / English)
|
|
698
701
|
const I18N = {
|
|
699
702
|
en: {
|
|
700
703
|
asrEngine: 'Speech recognition engine', asrBrowser: 'Browser built-in (free)', asrOpenAI: 'OpenAI gpt-4o-mini-transcribe (fast, accurate)', asrOpenAIHQ: 'OpenAI gpt-4o-transcribe (best accuracy)',
|
|
701
|
-
asrLocal: 'Whisper offline (this
|
|
704
|
+
asrLocal: 'Whisper offline (on this device, free, no key)', whisperModel_base: 'Whisper base · fast · {mb} MB', whisperModel_small: 'Whisper small · more accurate, slower · {mb} MB', whisperModel_turbo: 'Whisper large-v3 turbo · best · {mb} MB · needs a graphics card (WebGPU)', whisperDownload: 'Download ({mb} MB)', whisperRemove: 'Remove', whisperChecking: 'Checking…', whisperReady: 'Ready (offline)', whisperDownloading: 'Downloading the model — only this once on this site, then it works offline.', whisperDone: 'Offline Whisper is ready', whisperFailed: 'The Whisper download failed — check the connection and try again', whisperHelp: 'Open-source speech recognition that runs on this device: nothing is sent anywhere, no key needed. Downloaded once per site, then it works offline.', whisperReadyHelp: 'Recognition runs on this device. Bigger models are more accurate but slower.', whisperNeedsGpu: 'Needs a graphics card', whisperGpuHelp: 'This model needs WebGPU with 16-bit support, which this browser or PC does not offer. Pick base or small.', whisperBlocked: 'Not available here', whisperBlockedHelp: 'The helper NexusSync needs could not start here (blocked by the site, or the userscript manager does not run in frames). Allow it to run in frames, or use another site.', whisperBlockedHere: '⚠️ Offline Whisper cannot start on this site — using the browser engine.',
|
|
702
705
|
asrGroq: 'Groq Whisper large-v3 turbo (very fast)', providerClaude: 'Claude (context-aware, most natural)', providerGPT: 'GPT (context-aware)', providerDeepL: 'DeepL',
|
|
703
706
|
engineHelp: 'AI engines (OpenAI, Claude, Groq, DeepL) use your own API key and give the best accuracy; without a key the free engines are used.',
|
|
704
707
|
aiNeedKey: 'Enter the {names} API key under Advanced — until then the free engine is used.', aiKeys: 'API keys', aiTest: 'Test',
|
|
@@ -777,7 +780,11 @@ async function handle(m) {
|
|
|
777
780
|
heardSound: 'What to listen to', srcMedia: '🎬 Video sound (recommended)', srcMic: '🎤 Microphone',
|
|
778
781
|
srcMediaHelp: 'Listens to the video itself — no speakers needed. If the browser asks what to share, pick this tab and turn on “Share tab audio”.',
|
|
779
782
|
srcMicHelp: 'Listens through the microphone: play the video out loud through the speakers (not headphones).',
|
|
780
|
-
srcIosHelp: '
|
|
783
|
+
srcIosHelp: 'Safari\'s built-in engine on iPhone/iPad erases the phone\'s own sound, so it hears only voices in the room. To subtitle the video, pick offline Whisper or Groq/OpenAI as the recognition engine below.',
|
|
784
|
+
srcIosMediaHelp: 'The video is heard through the microphone with echo cancellation off — keep it playing through the speaker (not earphones) with the volume up.',
|
|
785
|
+
subIosSpeaker: 'Listening to the video through the microphone — play it through the speaker with the volume up (not earphones).',
|
|
786
|
+
subIosEngine: 'Safari\'s engine hears only voices in the room, not this phone\'s own sound. To subtitle the video, choose offline Whisper or Groq in AI settings → recognition engine.',
|
|
787
|
+
whisperMobileHelp: 'On a phone only the base model is offered; the first line can take a few seconds.',
|
|
781
788
|
videoLanguage: 'Language spoken in the video', subtitleLanguageReq: 'Subtitle language (required)', chooseLanguage: '— Choose a language —',
|
|
782
789
|
subPickLanguage: 'Choose the subtitle language first.', subAskMic: '🎤 Tap “Allow” when the browser asks for the microphone.',
|
|
783
790
|
subAskTab: '🎬 Choose this tab and turn on “Share tab audio”, then press Share.',
|
|
@@ -819,7 +826,7 @@ async function handle(m) {
|
|
|
819
826
|
},
|
|
820
827
|
ko: {
|
|
821
828
|
asrEngine: '음성 인식 엔진', asrBrowser: '브라우저 내장 (무료)', asrOpenAI: 'OpenAI gpt-4o-mini-transcribe (빠르고 정확)', asrOpenAIHQ: 'OpenAI gpt-4o-transcribe (최고 정확도)',
|
|
822
|
-
asrLocal: 'Whisper 오프라인 (이
|
|
829
|
+
asrLocal: 'Whisper 오프라인 (이 기기에서, 무료, 키 없음)', whisperModel_base: 'Whisper base · 빠름 · {mb}MB', whisperModel_small: 'Whisper small · 더 정확, 느림 · {mb}MB', whisperModel_turbo: 'Whisper large-v3 turbo · 최고 · {mb}MB · 그래픽카드(WebGPU) 필요', whisperDownload: '다운로드 ({mb}MB)', whisperRemove: '삭제', whisperChecking: '확인 중…', whisperReady: '준비됨 (오프라인)', whisperDownloading: '모델을 받는 중이에요 — 이 사이트에서는 이번 한 번만 받고, 이후엔 오프라인으로 동작해요.', whisperDone: '오프라인 Whisper 준비 완료', whisperFailed: 'Whisper 다운로드에 실패했어요 — 연결을 확인하고 다시 시도해 주세요', whisperHelp: '이 기기에서 직접 돌아가는 오픈소스 음성 인식이에요. 어디에도 보내지 않고 키도 필요 없어요. 사이트마다 한 번 받으면 이후엔 오프라인으로 동작해요.', whisperReadyHelp: '음성 인식이 이 기기에서 돌아가요. 큰 모델일수록 정확하지만 더 느려요.', whisperNeedsGpu: '그래픽카드 필요', whisperGpuHelp: '이 모델은 16비트를 지원하는 WebGPU가 필요한데, 이 브라우저나 PC에서는 쓸 수 없어요. base나 small을 골라 주세요.', whisperBlocked: '여기서는 쓸 수 없음', whisperBlockedHelp: 'NexusSync가 쓰는 도우미가 여기서 시작되지 못했어요 (사이트가 막았거나, 유저스크립트 관리자가 프레임 안에서 실행되지 않아요). 프레임 안 실행을 허용하거나 다른 사이트에서 써 주세요.', whisperBlockedHere: '⚠️ 이 사이트에서는 오프라인 Whisper를 시작할 수 없어 브라우저 엔진을 써요.',
|
|
823
830
|
asrGroq: 'Groq Whisper large-v3 turbo (매우 빠름)', providerClaude: 'Claude (문맥 이해, 가장 자연스러움)', providerGPT: 'GPT (문맥 이해)', providerDeepL: 'DeepL',
|
|
824
831
|
engineHelp: 'AI 엔진(OpenAI·Claude·Groq·DeepL)은 본인 API 키로 동작하며 정확도가 가장 높습니다. 키가 없으면 무료 엔진을 사용합니다.',
|
|
825
832
|
aiNeedKey: '고급 설정에서 {names} API 키를 입력하세요 — 그전까지는 무료 엔진을 사용합니다.', aiKeys: 'API 키', aiTest: '확인',
|
|
@@ -898,7 +905,11 @@ async function handle(m) {
|
|
|
898
905
|
heardSound: '들을 소리', srcMedia: '🎬 영상 소리 (권장)', srcMic: '🎤 마이크',
|
|
899
906
|
srcMediaHelp: '영상 소리를 직접 들어요. 브라우저가 공유할 화면을 물으면 이 탭을 고르고 “탭 오디오 공유”를 켜 주세요.',
|
|
900
907
|
srcMicHelp: '마이크로 들어요. 영상 소리를 이어폰이 아닌 스피커로 크게 틀어 주세요.',
|
|
901
|
-
srcIosHelp: '아이폰·아이패드의 Safari
|
|
908
|
+
srcIosHelp: '아이폰·아이패드의 Safari 기본 엔진은 휴대폰 자체 소리를 지워서 주변 사람 목소리만 들어요. 영상 자막을 보려면 아래 음성 인식 엔진을 오프라인 Whisper나 Groq/OpenAI로 골라 주세요.',
|
|
909
|
+
srcIosMediaHelp: '마이크의 에코 제거를 끄고 영상 소리를 들어요. 이어폰 말고 스피커로, 소리를 키워서 재생해 주세요.',
|
|
910
|
+
subIosSpeaker: '마이크로 영상 소리를 듣고 있어요. 이어폰 말고 스피커로, 소리를 키워서 재생해 주세요.',
|
|
911
|
+
subIosEngine: 'Safari 엔진은 이 휴대폰 자체 소리는 못 듣고 주변 목소리만 들어요. 영상 자막은 AI 설정 → 음성 인식 엔진에서 오프라인 Whisper나 Groq를 골라 주세요.',
|
|
912
|
+
whisperMobileHelp: '휴대폰에서는 base 모델만 쓸 수 있어요. 첫 줄은 몇 초 걸릴 수 있어요.',
|
|
902
913
|
videoLanguage: '영상 속 언어', subtitleLanguageReq: '자막 언어 (필수)', chooseLanguage: '— 언어를 선택하세요 —',
|
|
903
914
|
subPickLanguage: '먼저 자막 언어를 선택해 주세요.', subAskMic: '🎤 브라우저가 마이크 권한을 물으면 “허용”을 눌러 주세요.',
|
|
904
915
|
subAskTab: '🎬 이 탭을 고르고 “탭 오디오 공유”를 켠 뒤 공유를 눌러 주세요.',
|
|
@@ -2584,9 +2595,12 @@ async function handle(m) {
|
|
|
2584
2595
|
};
|
|
2585
2596
|
},
|
|
2586
2597
|
// Two sources only: the video's own sound (default) or the microphone. Older saved
|
|
2587
|
-
// values (auto / dual) mean "video sound". iPhone/iPad Safari
|
|
2598
|
+
// values (auto / dual) mean "video sound". On iPhone/iPad, Safari's own recognizer
|
|
2599
|
+
// listens with echo cancellation, which erases the phone's own speaker: there the video
|
|
2600
|
+
// sound needs Whisper or a cloud engine, which hear the speaker with echo cancellation off.
|
|
2601
|
+
_iosNeedsEngine() { return this._isAppleMobile() && AI.asrProvider() === 'browser'; },
|
|
2588
2602
|
_audioMode() {
|
|
2589
|
-
if (this.
|
|
2603
|
+
if (this._iosNeedsEngine()) return 'mic';
|
|
2590
2604
|
return STORE.get('nxu_audio_mode', 'media') === 'mic' ? 'mic' : 'media';
|
|
2591
2605
|
},
|
|
2592
2606
|
// The subtitle language is always chosen by the user (no guessing): empty until set.
|
|
@@ -2853,7 +2867,7 @@ async function handle(m) {
|
|
|
2853
2867
|
}
|
|
2854
2868
|
}
|
|
2855
2869
|
if (token !== this._startToken) { stopAll(web, mic); throw new Error('cancelled'); }
|
|
2856
|
-
if (mode === 'media' && !web && mic) showToast(t('subUsingMicFallback'));
|
|
2870
|
+
if (mode === 'media' && !web && mic) showToast(t(this._isAppleMobile() ? 'subIosSpeaker' : 'subUsingMicFallback'));
|
|
2857
2871
|
this.mediaStream = mic;
|
|
2858
2872
|
this.webMediaStream = web;
|
|
2859
2873
|
this.captureMode = web ? 'media' : 'mic';
|
|
@@ -4168,6 +4182,13 @@ async function handle(m) {
|
|
|
4168
4182
|
this._toldNoTrack = false;
|
|
4169
4183
|
this._toldNoWords = false;
|
|
4170
4184
|
this._startedAt = Date.now();
|
|
4185
|
+
// iPhone/iPad with Safari's own recognizer: it erases the phone's own speaker, so
|
|
4186
|
+
// say once how to subtitle the video itself.
|
|
4187
|
+
if (this._isAppleMobile() && !this._cloud && !this._toldIosEngine) { this._toldIosEngine = true; showToast(t('subIosEngine')); }
|
|
4188
|
+
try {
|
|
4189
|
+
const s = this.mediaStream?.getAudioTracks()[0]?.getSettings?.();
|
|
4190
|
+
if (s) logDebug(`AI Sub: microphone echo cancellation ${s.echoCancellation === false ? 'off' : s.echoCancellation ? 'on' : 'unknown'}.`, 'info');
|
|
4191
|
+
} catch (_) { }
|
|
4171
4192
|
this._soundMs = 0;
|
|
4172
4193
|
this._stageAt = Date.now();
|
|
4173
4194
|
this._stageSoundMs = 0;
|
|
@@ -4956,7 +4977,7 @@ async function handle(m) {
|
|
|
4956
4977
|
// pauses (with 300 ms pre-roll so first syllables are kept) and each utterance is sent
|
|
4957
4978
|
// as a small WAV clip. Results are released strictly in speaking order.
|
|
4958
4979
|
// Offline speech recognition with the open-source Whisper model (transformers.js, run by
|
|
4959
|
-
// the hidden helper frame above).
|
|
4980
|
+
// the hidden helper frame above). Downloaded once, only when the user asks for it.
|
|
4960
4981
|
const LOCAL_WHISPER = {
|
|
4961
4982
|
HELPER: 'https://cdn.jsdelivr.net/npm/@kangsicj/nexussync@1.6.4/package.json',
|
|
4962
4983
|
MODELS: {
|
|
@@ -4965,8 +4986,12 @@ async function handle(m) {
|
|
|
4965
4986
|
turbo: { repo: 'onnx-community/whisper-large-v3-turbo', mb: 536, device: 'webgpu', gpu: true, dtype: { encoder_model: 'q4f16', decoder_model_merged: 'q4f16' } }
|
|
4966
4987
|
},
|
|
4967
4988
|
_frame: null, _token: '', _ready: null, _n: 0, _wait: new Map(), _loaded: '', _gpu: null, _queue: 0,
|
|
4968
|
-
|
|
4969
|
-
|
|
4989
|
+
// Phones and tablets too (iPhone Safari cannot hear the video any other way without a
|
|
4990
|
+
// key); there only the small base model, which fits in a phone's memory.
|
|
4991
|
+
available() { return typeof Worker === 'function' && typeof WebAssembly === 'object'; },
|
|
4992
|
+
mobile() { return IS_IOS || /Android/i.test(navigator.userAgent); },
|
|
4993
|
+
ids() { return this.mobile() ? ['base'] : Object.keys(this.MODELS); },
|
|
4994
|
+
model() { const m = STORE.get('nxu_whisper_model', 'base'); return this.ids().includes(m) ? m : 'base'; },
|
|
4970
4995
|
files(id) {
|
|
4971
4996
|
const M = this.MODELS[id], base = `https://huggingface.co/${M.repo}/resolve/main/`;
|
|
4972
4997
|
const sfx = (d) => (d === 'q8' ? '_quantized' : d === 'fp32' ? '' : '_' + d);
|
|
@@ -8082,8 +8107,10 @@ async function handle(m) {
|
|
|
8082
8107
|
const paintSource = () => {
|
|
8083
8108
|
const mode = TRANSLATOR._audioMode();
|
|
8084
8109
|
[srcMedia, srcMic].forEach(b => { const on = b.dataset.mode === mode; b.classList.toggle('on', on); b.setAttribute('aria-checked', String(on)); });
|
|
8085
|
-
|
|
8086
|
-
|
|
8110
|
+
const iosLocked = TRANSLATOR._iosNeedsEngine();
|
|
8111
|
+
srcMedia.disabled = iosLocked;
|
|
8112
|
+
sourceHelp.textContent = iosLocked ? t('srcIosHelp') : ios ? t(mode === 'mic' ? 'srcMicHelp' : 'srcIosMediaHelp') : mode === 'mic' ? t('srcMicHelp') : t('srcMediaHelp');
|
|
8113
|
+
sourceHelp.classList.toggle('warn', iosLocked);
|
|
8087
8114
|
};
|
|
8088
8115
|
[srcMedia, srcMic].forEach(b => b.addEventListener('click', () => {
|
|
8089
8116
|
if (b.disabled || TRANSLATOR._audioMode() === b.dataset.mode) return;
|
|
@@ -8099,7 +8126,7 @@ async function handle(m) {
|
|
|
8099
8126
|
{ value: 'openai-hq', label: t('asrOpenAIHQ') }, { value: 'groq', label: t('asrGroq') }]);
|
|
8100
8127
|
// Offline Whisper: pick a model, download it once (explicitly), remove it again.
|
|
8101
8128
|
const whisperBox = createEl('div', 'whisper-box');
|
|
8102
|
-
const whisperModel = createSelect('stt-whisper-model',
|
|
8129
|
+
const whisperModel = createSelect('stt-whisper-model', LOCAL_WHISPER.ids().map(id => ({ value: id, label: t('whisperModel_' + id, { mb: LOCAL_WHISPER.MODELS[id].mb }) })));
|
|
8103
8130
|
whisperModel.value = LOCAL_WHISPER.model();
|
|
8104
8131
|
const whisperBtn = createEl('button', 'btn subtle', '', { type: 'button', id: 'nxu-whisper-btn' });
|
|
8105
8132
|
const whisperDel = createEl('button', 'btn subtle', '🗑️ ' + t('whisperRemove'), { type: 'button', id: 'nxu-whisper-del' });
|
|
@@ -8120,7 +8147,8 @@ async function handle(m) {
|
|
|
8120
8147
|
whisperBtn.disabled = !!st.cached;
|
|
8121
8148
|
whisperBtn.textContent = st.cached ? '✓ ' + t('whisperReady') : '⬇️ ' + t('whisperDownload', { mb: LOCAL_WHISPER.MODELS[id].mb });
|
|
8122
8149
|
whisperDel.style.display = st.cached ? '' : 'none';
|
|
8123
|
-
whisperInfo.textContent = t(st.cached ? 'whisperReadyHelp' : 'whisperHelp');
|
|
8150
|
+
whisperInfo.textContent = t(st.cached ? 'whisperReadyHelp' : 'whisperHelp') + (LOCAL_WHISPER.mobile() ? ' ' + t('whisperMobileHelp') : '');
|
|
8151
|
+
paintSource();
|
|
8124
8152
|
} catch (err) {
|
|
8125
8153
|
whisperBtn.textContent = '⚠️ ' + t('whisperBlocked');
|
|
8126
8154
|
whisperInfo.textContent = t('whisperBlockedHelp');
|
|
@@ -8276,7 +8304,7 @@ async function handle(m) {
|
|
|
8276
8304
|
});
|
|
8277
8305
|
positionSelect.addEventListener('change', () => { STORE.set('nxu_sub_position', positionSelect.value); SUB_LAYOUT.schedule(); });
|
|
8278
8306
|
providerSelect.addEventListener('change', () => { STORE.set('nxu_translation_provider', providerSelect.value); TRANSLATOR._cache.clear(); TRANSLATOR._llmHistory = []; refreshEngineHint(); });
|
|
8279
|
-
asrSelect.addEventListener('change', () => { STORE.set('nxu_asr_provider', asrSelect.value); refreshEngineHint(); paintWhisper(); TRANSLATOR.restart('recognition engine changed'); });
|
|
8307
|
+
asrSelect.addEventListener('change', () => { STORE.set('nxu_asr_provider', asrSelect.value); refreshEngineHint(); paintWhisper(); paintSource(); TRANSLATOR.restart('recognition engine changed'); });
|
|
8280
8308
|
localCheck.addEventListener('change', () => STORE.set('nxu_stt_local_first', !!localCheck.checked));
|
|
8281
8309
|
sizeSlider.addEventListener('input', () => {
|
|
8282
8310
|
STORE.set('nxu_sub_size', +sizeSlider.value);
|
|
@@ -8572,7 +8600,7 @@ async function handle(m) {
|
|
|
8572
8600
|
.key-input { flex:1; min-width:0; background:rgba(0,0,0,0.35); color:#fff; border:1px solid rgba(255,255,255,0.2); border-radius:6px; padding:5px 7px; font:12px ui-monospace, monospace; outline:none; }
|
|
8573
8601
|
.key-test { width:auto !important; flex:0 0 auto; padding:5px 8px !important; }
|
|
8574
8602
|
.key-status { width:18px; text-align:center; font-size:12px; }
|
|
8575
|
-
.engine-hint.warn { color:#ffcc80; }
|
|
8603
|
+
.engine-hint.warn, .trans-help.warn { color:#ffcc80; }
|
|
8576
8604
|
.ai-status { font-size:11px; line-height:1.45; color:rgba(255,255,255,0.75); background:rgba(0,0,0,0.25); border:1px solid rgba(255,255,255,0.08); border-radius:8px; padding:8px 10px; margin-top:8px; }
|
|
8577
8605
|
.debug-content { flex:1; padding:10px; overflow-y:auto; background:rgba(0,0,0,0.25); font-family:ui-monospace, Menlo, Consolas, monospace; font-size:11px; }
|
|
8578
8606
|
.debug-line { margin-bottom:3px; word-break:break-all; color:#ddd; }
|
|
@@ -13378,8 +13406,13 @@ async function handle(m) {
|
|
|
13378
13406
|
_bridgeHooked: new WeakSet(),
|
|
13379
13407
|
_waiting: new WeakSet(),
|
|
13380
13408
|
|
|
13409
|
+
// A scan already due sooner is kept: on busy pages (ads that keep inserting frames, a
|
|
13410
|
+
// player that keeps changing attributes) a pushed-back timer would never fire at all.
|
|
13381
13411
|
scheduleScan(delay = 80) {
|
|
13412
|
+
const due = Date.now() + delay;
|
|
13413
|
+
if (this._scanTimer && this._scanDue <= due) return;
|
|
13382
13414
|
clearTimeout(this._scanTimer);
|
|
13415
|
+
this._scanDue = due;
|
|
13383
13416
|
this._scanTimer = setTimeout(() => { this._scanTimer = null; this.scan(); }, delay);
|
|
13384
13417
|
},
|
|
13385
13418
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kangsicj/nexussync",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.11",
|
|
4
4
|
"description": "Watch-together userscript: media sync, cinema mode, live AI subtitles, chat bubbles and quick ink for Violentmonkey, Tampermonkey and iOS Userscripts.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"userscript",
|