stremiok 2.3.3 → 2.3.5
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/CHANGELOG.md +19 -0
- package/README.md +6 -5
- package/config.xml +1 -1
- package/css/style.css +5 -0
- package/index.html +42 -39
- package/js/app.js +7 -3
- package/js/downloads.js +16 -16
- package/js/epg.js +2 -3
- package/js/hubpreview.js +1 -1
- package/js/i18n.js +108 -0
- package/js/iptv.js +13 -13
- package/js/jellyfin.js +62 -29
- package/js/lang/ar.js +1941 -0
- package/js/lang/de.js +1941 -0
- package/js/lang/es.js +1941 -0
- package/js/lang/fi.js +1941 -0
- package/js/lang/fr.js +1941 -0
- package/js/lang/he.js +1941 -0
- package/js/lang/hi.js +1941 -0
- package/js/lang/it.js +1941 -0
- package/js/lang/ja.js +1941 -0
- package/js/lang/ko.js +1941 -0
- package/js/lang/languages.js +21 -0
- package/js/lang/pl.js +1941 -0
- package/js/lang/pt-BR.js +1941 -0
- package/js/lang/ru.js +1941 -0
- package/js/lang/tr.js +1941 -0
- package/js/lang/zh-CN.js +1941 -0
- package/js/local.js +9 -9
- package/js/netfolders.js +13 -13
- package/js/player-audio.js +17 -17
- package/js/player-controls.js +100 -100
- package/js/player-core.js +60 -57
- package/js/player-lang.js +22 -22
- package/js/player-quality.js +15 -15
- package/js/player-store.js +25 -18
- package/js/player-subs.js +69 -69
- package/js/plex.js +69 -21
- package/js/stremio-account.js +17 -12
- package/js/stremio-sync.js +641 -0
- package/js/stremio.js +79 -76
- package/js/stvod.js +4 -4
- package/js/trakt.js +23 -23
- package/js/tvapps.js +4 -4
- package/js/util.js +39 -27
- package/js/view-core.js +109 -92
- package/js/view-detail.js +135 -126
- package/js/view-discover.js +27 -27
- package/js/view-guide.js +13 -13
- package/js/view-home.js +148 -120
- package/js/view-search.js +25 -25
- package/js/view-settings.js +735 -643
- package/js/xtvod.js +2 -2
- package/js/youtube.js +17 -17
- package/js/ytplay.js +11 -6
- package/package.json +1 -1
- package/tizenbrew.html +1 -1
package/js/player-core.js
CHANGED
|
@@ -148,7 +148,7 @@ var PlayerParts = {};
|
|
|
148
148
|
applyAspect(true);
|
|
149
149
|
} catch (e) {
|
|
150
150
|
U.log('player', 'The TV\'s player couldn\'t be restored after the background: opening the stream again');
|
|
151
|
-
reopen('Opening the stream again…');
|
|
151
|
+
reopen(U.t('Opening the stream again…'));
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
@@ -186,6 +186,7 @@ var PlayerParts = {};
|
|
|
186
186
|
added: added || undefined };
|
|
187
187
|
}
|
|
188
188
|
writeProgress(all);
|
|
189
|
+
if (typeof StremioSync !== 'undefined' && StremioSync.onProgress) { StremioSync.onProgress(S.ctx, S.cur, S.dur, !fromTicker); } // (your Stremio account's place)
|
|
189
190
|
}
|
|
190
191
|
// What's saved to resume: a converted playback's own link (not the server's conversion), and a
|
|
191
192
|
// torrent's infoHash, file and trackers (its link depends on the server set when it resumes).
|
|
@@ -229,7 +230,7 @@ var PlayerParts = {};
|
|
|
229
230
|
}
|
|
230
231
|
function chapterLabel(i) {
|
|
231
232
|
var list = chapters(), c = list[i];
|
|
232
|
-
return c ? (i + 1) + '/' + list.length + ' · ' + (c.title || 'Chapter '
|
|
233
|
+
return c ? (i + 1) + '/' + list.length + ' · ' + (c.title || U.t('Chapter {n}', { n: i + 1 })) : '';
|
|
233
234
|
}
|
|
234
235
|
// A gap in the bar where each chapter starts (but the first), as on YouTube; redrawn
|
|
235
236
|
// only when the chapters or the length change.
|
|
@@ -331,12 +332,12 @@ var PlayerParts = {};
|
|
|
331
332
|
var t = Date.now() / 1000;
|
|
332
333
|
U.byId('osd-bar').style.display = '';
|
|
333
334
|
U.byId('osd-progress').style.width = Math.max(0, Math.min(100, Math.round((t - g.now.start) / (g.now.stop - g.now.start) * 100))) + '%';
|
|
334
|
-
cur.textContent = '● LIVE ' + clock(g.now.start) + '–' + clock(g.now.stop) + ' ' + g.now.title;
|
|
335
|
-
U.byId('osd-dur').textContent = g.next ? 'Next ' + clock(g.next.start) + ' ' + g.next.title : '';
|
|
335
|
+
cur.textContent = '● ' + U.t('LIVE') + ' ' + clock(g.now.start) + '–' + clock(g.now.stop) + ' ' + g.now.title;
|
|
336
|
+
U.byId('osd-dur').textContent = g.next ? U.t('Next') + ' ' + clock(g.next.start) + ' ' + g.next.title : '';
|
|
336
337
|
return;
|
|
337
338
|
}
|
|
338
339
|
U.byId('osd-bar').style.display = 'none';
|
|
339
|
-
cur.textContent = '● LIVE';
|
|
340
|
+
cur.textContent = U.t('● LIVE');
|
|
340
341
|
U.byId('osd-dur').textContent = '';
|
|
341
342
|
return;
|
|
342
343
|
}
|
|
@@ -390,7 +391,7 @@ var PlayerParts = {};
|
|
|
390
391
|
Object.keys(old).forEach(function (k) { if (!/^_(relay|relayFor|relayCc|ccOffer|liveChecked)$/.test(k)) { ctx[k] = old[k]; } });
|
|
391
392
|
ctx.switching = true;
|
|
392
393
|
play(ctx, _onExit);
|
|
393
|
-
U.spinner(true, 'Opening it as '
|
|
394
|
+
U.spinner(true, U.t('Opening it as {format}…', { format: fmt === 'hls' ? 'HLS' : 'MPEG-TS' }));
|
|
394
395
|
}
|
|
395
396
|
P.liveFormat = function () { return S.active && S.ctx && S.isLive && S.ctx._ownUrl ? liveFormat(S.ctx.url) : ''; };
|
|
396
397
|
P.setLiveFormat = setLiveFormat;
|
|
@@ -435,7 +436,7 @@ var PlayerParts = {};
|
|
|
435
436
|
// (private viewing, a link played as it is, or one started from a private playback —
|
|
436
437
|
// a video followed from it, another source: nothing recorded, see player-store)
|
|
437
438
|
ctx.private = !ctx.trailer && (ctx.private === true || !!ctx.link || isPrivate());
|
|
438
|
-
if (ctx.private && !ctx.switching) { U.toast('Private viewing: not tracked', 2500); }
|
|
439
|
+
if (ctx.private && !ctx.switching) { U.toast(U.t('Private viewing: not tracked'), 2500); }
|
|
439
440
|
if (_exitTimer) { clearTimeout(_exitTimer); _exitTimer = null; }
|
|
440
441
|
if (U.crumb) { U.crumb('play ' + (ctx.type || '') + ' ' + (ctx.private ? '(private)' : /^file:/i.test(ctx.url || '') ? 'file .' + ('' + ctx.url).split('.').pop() : ('' + (ctx.url || '')).replace(/^https?:\/\/([^\/?#]+).*$/i, '$1'))); } // (Diagnostics, after an unexpected close)
|
|
441
442
|
S.active = true; S.cur = 0; S.dur = 0; _bg = null; S.actual = null;
|
|
@@ -449,7 +450,7 @@ var PlayerParts = {};
|
|
|
449
450
|
var jfAt = Jellyfin.resumeFor(ctx.stream._jf, P.progressFor ? P.progressFor(ctx.type, ctx.id) : null, S.ctx.resumeSec);
|
|
450
451
|
if (jfAt !== S.ctx.resumeSec) {
|
|
451
452
|
S.ctx.resumeSec = jfAt;
|
|
452
|
-
if (jfAt > 5) { U.toast('Carrying on from where '
|
|
453
|
+
if (jfAt > 5) { U.toast(U.t('Carrying on from where {server} had it: {at}', { server: Jellyfin.sourceKind ? Jellyfin.sourceKind(ctx.stream._jf) : 'Jellyfin', at: U.fmtTime(jfAt) }), 3500); }
|
|
453
454
|
}
|
|
454
455
|
}
|
|
455
456
|
|
|
@@ -469,7 +470,7 @@ var PlayerParts = {};
|
|
|
469
470
|
document.body.style.background = 'transparent';
|
|
470
471
|
showOSD(true);
|
|
471
472
|
renderOSD(); // show the NEW title immediately (not the previous item's)
|
|
472
|
-
U.spinner(true, ctx.switching ? 'Switching source…' : ctx.initialQualityHeight ? 'Opening stream at '
|
|
473
|
+
U.spinner(true, ctx.switching ? U.t('Switching source…') : ctx.initialQualityHeight ? U.t('Opening stream at {height}p…', { height: ctx.initialQualityHeight }) : U.t('Opening stream…'));
|
|
473
474
|
|
|
474
475
|
engineFor(ctx); // (the TV's player, or a ClearKey channel's own: see startShaka)
|
|
475
476
|
// (a TorrServer torrent that doesn't say which of its files: its file list asked for first)
|
|
@@ -479,13 +480,13 @@ var PlayerParts = {};
|
|
|
479
480
|
++_playToken; _openedAt = 0;
|
|
480
481
|
if (useAV) { try { avplay.stop(); } catch (e0) {} try { avplay.close(); } catch (e1) {} }
|
|
481
482
|
else if (S.videoEl) { try { S.videoEl.pause(); S.videoEl.removeAttribute('src'); } catch (e2) {} }
|
|
482
|
-
U.spinner(true, 'Asking your streaming server for the torrent’s files…');
|
|
483
|
+
U.spinner(true, U.t('Asking your streaming server for the torrent’s files…'));
|
|
483
484
|
var ep = /:(\d+):(\d+)$/.exec(ctx.id || ''), look = _fileLook = U.cancelToken();
|
|
484
485
|
Stremio.torrentFile(ctx.stream, ep ? +ep[1] : 0, ep ? +ep[2] : 0, look).then(function (url) {
|
|
485
486
|
if (look.cancelled || S.ctx !== ctx || !S.active) { return; }
|
|
486
487
|
_fileLook = null;
|
|
487
488
|
if (url) { ctx.url = url; go(); return; }
|
|
488
|
-
var why = 'The torrent has no file for S' + ep[1] + 'E' + ep[2]; // (another episode isn't played in its place)
|
|
489
|
+
var why = U.t('The torrent has no file for {ep}', { ep: 'S' + ep[1] + 'E' + ep[2] }); // (another episode isn't played in its place)
|
|
489
490
|
U.log('player', why);
|
|
490
491
|
U.spinner(false);
|
|
491
492
|
if (nextSourceOnFail({ text: why })) { return; }
|
|
@@ -522,7 +523,7 @@ var PlayerParts = {};
|
|
|
522
523
|
.filter(function (g) { return g.mode !== 'off'; });
|
|
523
524
|
S.sponsor = segs;
|
|
524
525
|
var whole = segs.filter(function (g) { return g.action === 'full'; })[0];
|
|
525
|
-
if (whole) { U.toast('SponsorBlock: this whole video is marked “'
|
|
526
|
+
if (whole) { U.toast(U.t('SponsorBlock: this whole video is marked “{what}”', { what: YouTube.SB_NAMES[whole.cat] }), 5000); }
|
|
526
527
|
if (!osdHidden()) { renderOSD(); }
|
|
527
528
|
}, function () {});
|
|
528
529
|
}
|
|
@@ -591,8 +592,8 @@ var PlayerParts = {};
|
|
|
591
592
|
}
|
|
592
593
|
|
|
593
594
|
function updateHint() {
|
|
594
|
-
var base = S.isLive ? 'OK: Play/Pause' : 'OK: Play/Pause ←/→: Seek';
|
|
595
|
-
base += ' UP: Controls DOWN: Menu RETURN: Back';
|
|
595
|
+
var base = S.isLive ? U.t('OK: Play/Pause') : U.t('OK: Play/Pause ←/→: Seek');
|
|
596
|
+
base += ' ' + U.t('UP: Controls DOWN: Menu RETURN: Back');
|
|
596
597
|
var h = U.byId('osd-hint');
|
|
597
598
|
if (h) { h.textContent = base; }
|
|
598
599
|
}
|
|
@@ -697,7 +698,7 @@ var PlayerParts = {};
|
|
|
697
698
|
function drmEvent(drm, data, token) {
|
|
698
699
|
if (!drm || drm.sys !== 'widevine' || !data || data.name !== 'Challenge' || !data.challenge) { return; }
|
|
699
700
|
var ctx = S.ctx;
|
|
700
|
-
if (typeof YTPlay === 'undefined' || !YTPlay.drmLicense) { ctx._drmWhy = 'StremioK’s service isn’t there'; return; }
|
|
701
|
+
if (typeof YTPlay === 'undefined' || !YTPlay.drmLicense) { ctx._drmWhy = U.t('StremioK’s service isn’t there'); return; }
|
|
701
702
|
YTPlay.drmLicense(drm.url, drm.h, data.challenge, drm.b64).then(function (r) {
|
|
702
703
|
if (!S.active || token !== _playToken) { return; }
|
|
703
704
|
if (!r || !r.license) { throw new Error((r && r.why) || 'no answer'); }
|
|
@@ -708,14 +709,14 @@ var PlayerParts = {};
|
|
|
708
709
|
U.log('player', 'DRM: no license for this channel (' + ctx._drmWhy + ')');
|
|
709
710
|
});
|
|
710
711
|
}
|
|
711
|
-
function drmName(d) { return { clearkey: 'ClearKey', widevine: 'Widevine', playready: 'PlayReady' }[d.sys] || 'its DRM'; }
|
|
712
|
+
function drmName(d) { return { clearkey: 'ClearKey', widevine: 'Widevine', playready: 'PlayReady' }[d.sys] || U.t('its DRM'); }
|
|
712
713
|
var BUFFERS = { more: [8, 10], most: [15, 20] };
|
|
713
714
|
function openAV(url, token) {
|
|
714
715
|
var drm = S.ctx && S.ctx.stream && S.ctx.stream._drm;
|
|
715
716
|
if (drm && !drm.ok) { // (ClearKey, or a license StremioK can't ask for)
|
|
716
717
|
U.log('player', 'Not played: ' + drmName(drm) + (drm.sys === 'clearkey' ? '' : ' without a license server StremioK can use') + ' (' + where(url) + ')');
|
|
717
718
|
U.spinner(false);
|
|
718
|
-
failedStart(drm.sys === 'clearkey' ? 'This ClearKey channel’s keys can’t be read (its playlist’s #KODIPROP lines)' : 'This channel’s DRM can’t be played on the TV ('
|
|
719
|
+
failedStart(drm.sys === 'clearkey' ? U.t('This ClearKey channel’s keys can’t be read (its playlist’s #KODIPROP lines)') : U.t('This channel’s DRM can’t be played on the TV ({drm})', { drm: drmName(drm) }));
|
|
719
720
|
return;
|
|
720
721
|
}
|
|
721
722
|
try {
|
|
@@ -740,7 +741,7 @@ var PlayerParts = {};
|
|
|
740
741
|
avplay.setListener({
|
|
741
742
|
onbufferingstart: function () {
|
|
742
743
|
if (!S.active || token !== _playToken) { return; }
|
|
743
|
-
S.buffering = true; U.spinner(true, S.playStarted ? 'Buffering…' : undefined);
|
|
744
|
+
S.buffering = true; U.spinner(true, S.playStarted ? U.t('Buffering…') : undefined);
|
|
744
745
|
},
|
|
745
746
|
onbufferingcomplete: function () {
|
|
746
747
|
if (!S.active || token !== _playToken) { return; }
|
|
@@ -788,13 +789,13 @@ var PlayerParts = {};
|
|
|
788
789
|
// A live channel that played: its connection dropped → opened again (liveDropped).
|
|
789
790
|
if (S.playing && liveReconnects()) { U.log('player', 'Playback error: ' + err + ' (' + where(S.ctx.url) + ')'); liveDropped('Connection lost'); return; }
|
|
790
791
|
// A reconnect's try that didn't play → the next try.
|
|
791
|
-
if (!S.playing && _reco.tries) { if (!relayFailed()) { liveDropped('Couldn’t reconnect'); } return; }
|
|
792
|
+
if (!S.playing && _reco.tries) { if (!relayFailed()) { liveDropped(U.t('Couldn’t reconnect')); } return; }
|
|
792
793
|
// Failed before it ever played (opened, maybe, but nothing shown) → retry / step down / Auto.
|
|
793
794
|
if (!S.playing && (relayFailed() || tryFallback())) { return; }
|
|
794
795
|
reportStart(false, err); // (unless it had already played)
|
|
795
796
|
U.log('player', 'Playback error: ' + err + ' (' + where(S.ctx && S.ctx.url) + ')');
|
|
796
|
-
if (!S.playing) { failedStart('Playback error: '
|
|
797
|
-
U.toast('Playback error: '
|
|
797
|
+
if (!S.playing) { failedStart(U.t('Playback error: {why}', { why: err })); return; }
|
|
798
|
+
U.toast(U.t('Playback error: {why}', { why: err }));
|
|
798
799
|
exitLater();
|
|
799
800
|
}
|
|
800
801
|
});
|
|
@@ -829,17 +830,17 @@ var PlayerParts = {};
|
|
|
829
830
|
if (!S.active || token !== _playToken) { return; }
|
|
830
831
|
U.spinner(false);
|
|
831
832
|
if (relayFailed()) { return; }
|
|
832
|
-
if (_reco.tries) { liveDropped('Couldn’t reconnect'); return; } // (a reconnect's try: the next one)
|
|
833
|
+
if (_reco.tries) { liveDropped(U.t('Couldn’t reconnect')); return; } // (a reconnect's try: the next one)
|
|
833
834
|
// Prepare failed → retry / step down / Auto.
|
|
834
835
|
if (tryFallback()) { return; }
|
|
835
836
|
U.log('player', 'Could not open: ' + (err && (err.name || err.message || err)) + ' (' + where(url) + ')');
|
|
836
837
|
reportStart(false, err && (err.name || err.message || err));
|
|
837
|
-
failedStart(S.ctx && S.ctx._drmWhy ? 'No license for this channel: '
|
|
838
|
+
failedStart(S.ctx && S.ctx._drmWhy ? U.t('No license for this channel: {why}', { why: S.ctx._drmWhy }) : U.t('Could not open stream'));
|
|
838
839
|
});
|
|
839
840
|
} catch (e) {
|
|
840
841
|
U.log('player', 'AVPlay failed: ' + (e && e.message));
|
|
841
842
|
reportStart(false, e && e.message);
|
|
842
|
-
U.spinner(false); U.toast('AVPlay failed: '
|
|
843
|
+
U.spinner(false); U.toast(U.t('AVPlay failed: {why}', { why: e.message })); exitLater();
|
|
843
844
|
}
|
|
844
845
|
}
|
|
845
846
|
// What a log entry names: the link, or, playing privately, nothing that says what.
|
|
@@ -921,7 +922,7 @@ var PlayerParts = {};
|
|
|
921
922
|
function shakaLoadInto(url, drm, token, fail) {
|
|
922
923
|
loadShaka().then(function () {
|
|
923
924
|
if (!S.active || token !== _playToken) { return; }
|
|
924
|
-
if (typeof shaka === 'undefined' || !shaka.Player.isBrowserSupported()) { throw new Error('this TV’s browser can’t play it'); }
|
|
925
|
+
if (typeof shaka === 'undefined' || !shaka.Player.isBrowserSupported()) { throw new Error(U.t('this TV’s browser can’t play it')); }
|
|
925
926
|
return shakaStop().then(function () {
|
|
926
927
|
if (!S.active || token !== _playToken) { return; }
|
|
927
928
|
var pl = _shakaPl = new shaka.Player(), cfg = { streaming: { bufferingGoal: 10 } };
|
|
@@ -943,7 +944,7 @@ var PlayerParts = {};
|
|
|
943
944
|
});
|
|
944
945
|
}).then(null, function (e) { if (S.active && token === _playToken) { fail(shakaWhy(e)); } });
|
|
945
946
|
}
|
|
946
|
-
function shakaWhy(e) { return e && e.code ? 'Shaka error '
|
|
947
|
+
function shakaWhy(e) { return e && e.code ? U.t('Shaka error {code}', { code: e.code }) : (e && e.message) || U.t('it didn’t start'); }
|
|
947
948
|
var HTML5_START_MS = 20000;
|
|
948
949
|
function startHTML5(url) {
|
|
949
950
|
url = opened(url);
|
|
@@ -955,7 +956,7 @@ var PlayerParts = {};
|
|
|
955
956
|
reportStart(false, 'TIMEOUT');
|
|
956
957
|
U.spinner(false);
|
|
957
958
|
if (!drm) { U.log('player', 'Not played (the page’s video player): no start in ' + Math.round(HTML5_START_MS / 1000) + ' s (' + where(url) + ')'); }
|
|
958
|
-
U.toast('This stream didn\'t start'); exitLater();
|
|
959
|
+
U.toast(U.t('This stream didn\'t start')); exitLater();
|
|
959
960
|
}, drm ? SHAKA_START_MS : HTML5_START_MS);
|
|
960
961
|
S.videoEl.onloadedmetadata = function () {
|
|
961
962
|
if (!S.active || token !== _playToken) { return; }
|
|
@@ -983,14 +984,14 @@ var PlayerParts = {};
|
|
|
983
984
|
// (the page's player says little: its code, and a message where the engine has one)
|
|
984
985
|
U.log('player', (loaded ? 'Stopped' : 'Not played') + ' (the page’s video player): ' + (['', 'aborted', 'a network error', 'the file couldn’t be decoded', 'a format or link it can’t play'][mcode] || 'an error') +
|
|
985
986
|
(me && me.message ? ' (' + me.message + ')' : '') + ' (' + where(url) + ')');
|
|
986
|
-
U.toast('Playback error'); exitLater();
|
|
987
|
+
U.toast(U.t('Playback error')); exitLater();
|
|
987
988
|
};
|
|
988
989
|
if (drm) {
|
|
989
990
|
shakaLoadInto(url, drm, token, function (why) {
|
|
990
991
|
if (loaded) { U.log('player', 'ClearKey channel: ' + why); U.toast('Playback error: ' + why); exitLater(); return; }
|
|
991
992
|
U.log('player', 'ClearKey channel didn’t play (' + why + ')');
|
|
992
993
|
U.spinner(false);
|
|
993
|
-
failedStart('This ClearKey channel didn’t play ('
|
|
994
|
+
failedStart(U.t('This ClearKey channel didn’t play ({why})', { why: why }));
|
|
994
995
|
});
|
|
995
996
|
} else {
|
|
996
997
|
var p = S.videoEl.play();
|
|
@@ -1019,9 +1020,9 @@ var PlayerParts = {};
|
|
|
1019
1020
|
}
|
|
1020
1021
|
function onEnded() {
|
|
1021
1022
|
// a live channel whose stream ended (its server stopped it): opened again (liveDropped)
|
|
1022
|
-
if (liveReconnects()) { liveDropped('The stream ended'); return; }
|
|
1023
|
+
if (liveReconnects()) { liveDropped(U.t('The stream ended')); return; }
|
|
1023
1024
|
if (isNotice()) { // (back to its sources: another one, or this one later)
|
|
1024
|
-
U.toast('That source isn\'t ready yet (the debrid service is still getting it): try another, or this one later', 6000);
|
|
1025
|
+
U.toast(U.t('That source isn\'t ready yet (the debrid service is still getting it): try another, or this one later'), 6000);
|
|
1025
1026
|
exit();
|
|
1026
1027
|
return;
|
|
1027
1028
|
}
|
|
@@ -1109,9 +1110,9 @@ var PlayerParts = {};
|
|
|
1109
1110
|
var name = YouTube.SB_NAMES[g.cat] || 'section';
|
|
1110
1111
|
if (g.mode === 'skip') {
|
|
1111
1112
|
seekTo(g.end);
|
|
1112
|
-
U.toast('Skipped: '
|
|
1113
|
+
U.toast(U.t('Skipped: {what} ({length})', { what: name, length: U.fmtTime(g.end - g.start) }), 3000);
|
|
1113
1114
|
} else {
|
|
1114
|
-
showSkip('sb', { end: g.end, label: 'Skip '
|
|
1115
|
+
showSkip('sb', { end: g.end, label: U.t('Skip {what}', { what: name }) });
|
|
1115
1116
|
}
|
|
1116
1117
|
return;
|
|
1117
1118
|
}
|
|
@@ -1182,7 +1183,7 @@ var PlayerParts = {};
|
|
|
1182
1183
|
}
|
|
1183
1184
|
|
|
1184
1185
|
function seekTo(sec) {
|
|
1185
|
-
if (S.isLive) { showOSD(false); U.toast('Live — seeking unavailable', 1500); return; }
|
|
1186
|
+
if (S.isLive) { showOSD(false); U.toast(U.t('Live — seeking unavailable'), 1500); return; }
|
|
1186
1187
|
// keep a small margin from the very end (seeking to EOF can error)
|
|
1187
1188
|
var maxT = S.dur ? Math.max(0, S.dur - 2) : 1e9;
|
|
1188
1189
|
var target = Math.max(0, Math.min(maxT, sec));
|
|
@@ -1255,7 +1256,8 @@ var PlayerParts = {};
|
|
|
1255
1256
|
try { n = c.nextSource(tried, c._avoid || []); } catch (e) { n = null; }
|
|
1256
1257
|
if (!n || !n.source || !n.source.url) { return false; }
|
|
1257
1258
|
c._tried = tried; // (kept by the next one: not a source's own field)
|
|
1258
|
-
var
|
|
1259
|
+
var next = { n: tried.length + 1, of: Math.min(n.total, NEXT_TRIES + 1) };
|
|
1260
|
+
var msg = notice ? notice.text + ' · ' + U.t('trying the next source ({n} of {of})…', next) : U.t('Didn’t start: trying the next source ({n} of {of})…', next);
|
|
1259
1261
|
U.log('player', 'Source didn’t start: trying the next one (' + (tried.length + 1) + ')');
|
|
1260
1262
|
replaceSource(n.source, true);
|
|
1261
1263
|
U.spinner(true, msg); U.toast(msg, notice ? 7000 : 4000);
|
|
@@ -1270,7 +1272,7 @@ var PlayerParts = {};
|
|
|
1270
1272
|
var u = (typeof Stremio !== 'undefined' && Stremio.convertUrl) ? Stremio.convertUrl(c.url) : null;
|
|
1271
1273
|
if (!u) { return false; }
|
|
1272
1274
|
c._converted = true; c._convertedFrom = c.url; // (kept by what replaces it: Continue Watching saves its own link)
|
|
1273
|
-
var msg = 'Didn’t start: converting it on your streaming server…';
|
|
1275
|
+
var msg = U.t('Didn’t start: converting it on your streaming server…');
|
|
1274
1276
|
U.log('player', 'Source didn’t start: converting it on the streaming server');
|
|
1275
1277
|
replaceSource({ url: u, stream: c.stream, subExtra: c.subExtra, sourceSubs: c.sourceSubs, localSubs: c.localSubs, converted: true }, true);
|
|
1276
1278
|
U.spinner(true, msg); U.toast(msg, 5000);
|
|
@@ -1317,13 +1319,14 @@ var PlayerParts = {};
|
|
|
1317
1319
|
}
|
|
1318
1320
|
function describeNotice(kind, st) {
|
|
1319
1321
|
var d = (typeof Stremio !== 'undefined' && Stremio.debridOf) ? Stremio.debridOf(st) : null;
|
|
1320
|
-
var svc = d ? d.name : 'The debrid service', addon = st._addon || 'the addon', key = d ?
|
|
1322
|
+
var svc = d ? d.name : U.t('The debrid service'), addon = st._addon || U.t('the addon'), key = d ? U.t('{service} key', { service: d.name }) : U.t('debrid key');
|
|
1321
1323
|
var n = { kind: kind, service: d ? d.name : '', tag: d ? d.tag : '', account: false, text: '' };
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
else if (/
|
|
1325
|
-
else if (/
|
|
1326
|
-
else { n.text =
|
|
1324
|
+
var w = { service: svc, addon: addon, key: key, what: kind.replace(/_/g, ' ') };
|
|
1325
|
+
if (/access|auth|unauthorized|forbidden|premium/.test(kind)) { n.account = true; n.text = U.t('{service} refused access ({addon}): check its {key} in the addon’s settings', w); }
|
|
1326
|
+
else if (/limit|too_many|exceeded/.test(kind)) { n.account = true; n.text = U.t('{service}: your limit is reached for now ({addon})', w); }
|
|
1327
|
+
else if (/infring|blocked|dmca|removed/.test(kind)) { n.text = U.t('{service} won’t give this file ({addon}): try another source', w); }
|
|
1328
|
+
else if (/download|caching|queued/.test(kind)) { n.text = U.t('Still downloading on {service} ({addon}): try again later', w); }
|
|
1329
|
+
else { n.text = U.t('{service} couldn’t give this file ({addon}: “{what}”)', w); }
|
|
1327
1330
|
return n;
|
|
1328
1331
|
}
|
|
1329
1332
|
// Not playing after AV_START_MS (no answer from the server, or opened and nothing shown): the
|
|
@@ -1336,12 +1339,12 @@ var PlayerParts = {};
|
|
|
1336
1339
|
}
|
|
1337
1340
|
function startCheck() {
|
|
1338
1341
|
if (!S.active || S.playing || !useAV || !_openedAt || Date.now() - _openedAt < startMs()) { return; }
|
|
1339
|
-
if (_reco.tries) { liveDropped('Couldn’t reconnect'); return; } // (a reconnect's try: the next one)
|
|
1342
|
+
if (_reco.tries) { liveDropped(U.t('Couldn’t reconnect')); return; } // (a reconnect's try: the next one)
|
|
1340
1343
|
if (nextSourceOnFail()) { return; }
|
|
1341
1344
|
if (S.playStarted && isPaused()) { return; }
|
|
1342
1345
|
U.log('player', 'Didn’t start: nothing played in ' + (startMs() / 1000) + ' s (' + where(S.ctx && S.ctx.url) + ')');
|
|
1343
1346
|
U.spinner(false);
|
|
1344
|
-
U.toast('Didn’t start: nothing played in
|
|
1347
|
+
U.toast(U.t('Didn’t start: nothing played in {n} seconds. Try another source.', { n: startMs() / 1000 }), 6000);
|
|
1345
1348
|
exitLater();
|
|
1346
1349
|
}
|
|
1347
1350
|
P.startCheck = startCheck;
|
|
@@ -1426,9 +1429,9 @@ var PlayerParts = {};
|
|
|
1426
1429
|
var known = liveKnown(ctx.url), cc = ctx._relayCc || null, raw = !!(known && known.raw);
|
|
1427
1430
|
liveKeep(ctx.url, repack, known ? ccOf(known) : null, true); // (its hls answer kept)
|
|
1428
1431
|
U.log('player', 'Live sound ' + (repack ? 'repacked by StremioK\'s service' : 'straight from the server') + ': your choice for this channel');
|
|
1429
|
-
var msg = repack ? 'Repacking this channel’s sound…' : 'Playing the sound straight from the server…';
|
|
1432
|
+
var msg = repack ? U.t('Repacking this channel’s sound…') : U.t('Playing the sound straight from the server…');
|
|
1430
1433
|
if (!repack && !cc) { ctx._relay = null; ctx._relayFor = null; ctx._relayFix = false; reopen(msg); return; }
|
|
1431
|
-
function failed() { if (S.ctx === ctx && S.active) { U.toast('StremioK’s service didn’t answer: the sound stays as it was', 5000); } }
|
|
1434
|
+
function failed() { if (S.ctx === ctx && S.active) { U.toast(U.t('StremioK’s service didn’t answer: the sound stays as it was'), 5000); } }
|
|
1432
1435
|
YTPlay.liveOpen(ctx.url, ctx._headers, true, { fix: !!repack, cc: raw ? null : cc, raw: raw }).then(function (r) {
|
|
1433
1436
|
if (S.ctx !== ctx || !S.active) { return; }
|
|
1434
1437
|
if (!relayed(ctx, r, cc, repack)) { failed(); return; }
|
|
@@ -1496,10 +1499,10 @@ var PlayerParts = {};
|
|
|
1496
1499
|
liveKeep(url, fix, cc, false, hls, !!r.raw);
|
|
1497
1500
|
if (S.ctx !== ctx || !S.active || ctx.url !== url) { return; }
|
|
1498
1501
|
if (cc && cc.length && !ctx._relayCc) { ctx._ccOffer = cc; }
|
|
1499
|
-
if (cc && cc.length && ccWanted(ctx, cc)) { ccOn(ctx, 'Adding this channel’s captions…'); return; }
|
|
1502
|
+
if (cc && cc.length && ccWanted(ctx, cc)) { ccOn(ctx, U.t('Adding this channel’s captions…')); return; }
|
|
1500
1503
|
if (known || !fix || ctx._relay || !relayed(ctx, r, null, true)) { return; } // (the sound: restarted for on its first look only)
|
|
1501
1504
|
U.log('player', 'Live sound repacked by StremioK\'s service (' + (r.why || '') + ')');
|
|
1502
|
-
reopen('Fixing this channel’s sound…');
|
|
1505
|
+
reopen(U.t('Fixing this channel’s sound…'));
|
|
1503
1506
|
}, function () {});
|
|
1504
1507
|
}
|
|
1505
1508
|
// The channel again through the relay with its closed captions as subtitle tracks (the sound
|
|
@@ -1517,7 +1520,7 @@ var PlayerParts = {};
|
|
|
1517
1520
|
return true;
|
|
1518
1521
|
}, function () { return false; });
|
|
1519
1522
|
}
|
|
1520
|
-
P.ccOn = function (want) { return S.ctx ? ccOn(S.ctx, 'Adding this channel’s captions…', want) : Promise.resolve(false); };
|
|
1523
|
+
P.ccOn = function (want) { return S.ctx ? ccOn(S.ctx, U.t('Adding this channel’s captions…'), want) : Promise.resolve(false); };
|
|
1521
1524
|
// The relay didn't start (StremioK's service gone): the channel as it is.
|
|
1522
1525
|
function relayFailed() {
|
|
1523
1526
|
if (S.playStarted || !S.ctx || !S.ctx._relay) { return false; }
|
|
@@ -1538,12 +1541,12 @@ var PlayerParts = {};
|
|
|
1538
1541
|
var now = Date.now();
|
|
1539
1542
|
if (S.buffering) {
|
|
1540
1543
|
if (!_stall.bufSince) { _stall.bufSince = now; }
|
|
1541
|
-
else if (now - _stall.bufSince > BUFFER_STALL_SECS * 1000) { recoverStall('Stream stopped loading'); }
|
|
1544
|
+
else if (now - _stall.bufSince > BUFFER_STALL_SECS * 1000) { recoverStall(U.t('Stream stopped loading')); }
|
|
1542
1545
|
return;
|
|
1543
1546
|
}
|
|
1544
1547
|
_stall.bufSince = 0;
|
|
1545
1548
|
if (isPaused() || S.cur !== _stall.t) { _stall.t = S.cur; _stall.since = now; return; }
|
|
1546
|
-
if (_stall.since && now - _stall.since > STALL_SECS * 1000) { recoverStall('Playback stalled'); }
|
|
1549
|
+
if (_stall.since && now - _stall.since > STALL_SECS * 1000) { recoverStall(U.t('Playback stalled')); }
|
|
1547
1550
|
}
|
|
1548
1551
|
function recoverStall(why) {
|
|
1549
1552
|
if (liveReconnects()) { liveDropped(why); return; }
|
|
@@ -1551,12 +1554,12 @@ var PlayerParts = {};
|
|
|
1551
1554
|
_stall.recoveries = _stall.recoveries.filter(function (t) { return now - t < STALL_WINDOW_MS; });
|
|
1552
1555
|
if (_stall.recoveries.length >= STALL_MAX) {
|
|
1553
1556
|
U.spinner(false);
|
|
1554
|
-
U.toast('This source keeps stalling — try another one', 4000);
|
|
1557
|
+
U.toast(U.t('This source keeps stalling — try another one'), 4000);
|
|
1555
1558
|
exit();
|
|
1556
1559
|
return;
|
|
1557
1560
|
}
|
|
1558
1561
|
_stall.recoveries.push(now);
|
|
1559
|
-
reopen(why
|
|
1562
|
+
reopen(U.t('{why} — reloading…', { why: why }));
|
|
1560
1563
|
}
|
|
1561
1564
|
|
|
1562
1565
|
// ---------- a live channel that drops ----------
|
|
@@ -1577,20 +1580,20 @@ var PlayerParts = {};
|
|
|
1577
1580
|
var mode = P.playerCfg().reconnect, now = Date.now();
|
|
1578
1581
|
if (mode === 'off') {
|
|
1579
1582
|
U.log('player', 'Live channel: ' + why + '; reconnecting is off');
|
|
1580
|
-
U.spinner(false); U.toast(why
|
|
1583
|
+
U.spinner(false); U.toast(U.t('{why}: the channel stopped (reconnecting is off)', { why: why }), 5000);
|
|
1581
1584
|
exitLater();
|
|
1582
1585
|
return;
|
|
1583
1586
|
}
|
|
1584
1587
|
_stall.recoveries = _stall.recoveries.filter(function (t) { return now - t < STALL_WINDOW_MS; });
|
|
1585
1588
|
if (mode !== 'always' && _stall.recoveries.length >= STALL_MAX) {
|
|
1586
1589
|
U.log('player', 'Live channel: ' + why + '; dropped ' + STALL_MAX + ' times in ' + (STALL_WINDOW_MS / 60000) + ' minutes, given up');
|
|
1587
|
-
U.spinner(false); U.toast('This channel keeps dropping — try it again later', 5000);
|
|
1590
|
+
U.spinner(false); U.toast(U.t('This channel keeps dropping — try it again later'), 5000);
|
|
1588
1591
|
exit();
|
|
1589
1592
|
return;
|
|
1590
1593
|
}
|
|
1591
1594
|
_stall.recoveries.push(now);
|
|
1592
1595
|
var n = ++_reco.tries, wait = RECO_WAIT_S[Math.min(n - 1, RECO_WAIT_S.length - 1)] * 1000, ctx = S.ctx;
|
|
1593
|
-
var msg =
|
|
1596
|
+
var msg = n > 1 ? U.t('{why} — reconnecting (try {n})…', { why: why, n: n }) : U.t('{why} — reconnecting…', { why: why });
|
|
1594
1597
|
U.log('player', 'Live channel: ' + why + ', reconnecting (try ' + n + (wait ? ', in ' + (wait / 1000) + ' s' : '') + ')');
|
|
1595
1598
|
if (!wait) { reopen(msg); return; }
|
|
1596
1599
|
U.spinner(true, msg);
|
|
@@ -1667,5 +1670,5 @@ var PlayerParts = {};
|
|
|
1667
1670
|
P.sponsorHighlight = sponsorHighlight;
|
|
1668
1671
|
P.chapters = chapters; P.chapterAt = chapterAt; P.chapterLabel = chapterLabel;
|
|
1669
1672
|
P.seekTo = seekTo; P.doAVSeek = doAVSeek; P.seekBy = seekBy; P.exit = exit;
|
|
1670
|
-
P.reload = function () { if (S.active && S.ctx) { reopen(S.isLive ? 'Reloading the channel…' : 'Reloading…'); } }; // (the menu's Reload)
|
|
1673
|
+
P.reload = function () { if (S.active && S.ctx) { reopen(S.isLive ? U.t('Reloading the channel…') : U.t('Reloading…')); } }; // (the menu's Reload)
|
|
1671
1674
|
})(PlayerParts);
|
package/js/player-lang.js
CHANGED
|
@@ -135,32 +135,32 @@
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
// Display names for language codes (the aliases above, plus other common ones).
|
|
138
|
-
var LANG_NAMES = { eng: 'English', spa: 'Spanish', fre: 'French', ger: 'German', ita: 'Italian', por: 'Portuguese',
|
|
139
|
-
dut: 'Dutch', rus: 'Russian', ara: 'Arabic', tur: 'Turkish', pol: 'Polish',
|
|
140
|
-
jpn: 'Japanese', ja: 'Japanese', kor: 'Korean', ko: 'Korean', chi: 'Chinese', zho: 'Chinese', zh: 'Chinese',
|
|
141
|
-
hin: 'Hindi', hi: 'Hindi', swe: 'Swedish', sv: 'Swedish', nor: 'Norwegian', no: 'Norwegian', nob: 'Norwegian',
|
|
142
|
-
dan: 'Danish', da: 'Danish', fin: 'Finnish', fi: 'Finnish', gre: 'Greek', ell: 'Greek', el: 'Greek',
|
|
143
|
-
heb: 'Hebrew', he: 'Hebrew', hun: 'Hungarian', hu: 'Hungarian', cze: 'Czech', ces: 'Czech', cs: 'Czech',
|
|
144
|
-
rum: 'Romanian', ron: 'Romanian', ro: 'Romanian', ukr: 'Ukrainian', uk: 'Ukrainian', tha: 'Thai', th: 'Thai',
|
|
145
|
-
vie: 'Vietnamese', vi: 'Vietnamese', ind: 'Indonesian', id: 'Indonesian', cat: 'Catalan', ca: 'Catalan',
|
|
146
|
-
bul: 'Bulgarian', bg: 'Bulgarian', hrv: 'Croatian', hr: 'Croatian', srp: 'Serbian', sr: 'Serbian',
|
|
147
|
-
per: 'Persian', fas: 'Persian', fa: 'Persian', slo: 'Slovak', slv: 'Slovenian', may: 'Malay', fil: 'Filipino',
|
|
148
|
-
baq: 'Basque', glg: 'Galician', est: 'Estonian', lav: 'Latvian', lit: 'Lithuanian', ice: 'Icelandic',
|
|
149
|
-
tam: 'Tamil', tel: 'Telugu', ben: 'Bengali', mul: 'Multiple languages', zxx: 'No language',
|
|
150
|
-
afr: 'Afrikaans', alb: 'Albanian', arg: 'Aragonese', arm: 'Armenian', ast: 'Asturian', aze: 'Azerbaijani',
|
|
151
|
-
bel: 'Belarusian', bos: 'Bosnian', bre: 'Breton', bur: 'Burmese', prs: 'Dari', epo: 'Esperanto', ext:
|
|
152
|
-
'Extremaduran', gla: 'Scottish Gaelic', geo: 'Georgian', ibo: 'Igbo', ina: 'Interlingua', gle: 'Irish', kan:
|
|
153
|
-
'Kannada', kaz: 'Kazakh', khm: 'Khmer', kur: 'Kurdish', ltz: 'Luxembourgish', mac: 'Macedonian', mal:
|
|
154
|
-
'Malayalam', mni: 'Manipuri', mar: 'Marathi', mon: 'Mongolian', mne: 'Montenegrin', nav: 'Navajo', nep:
|
|
155
|
-
'Nepali', sme: 'Northern Sami', oci: 'Occitan', ori: 'Odia', pan: 'Punjabi', pus: 'Pashto', sat: 'Santali',
|
|
156
|
-
snd: 'Sindhi', sin: 'Sinhala', som: 'Somali', swa: 'Swahili', syr: 'Syriac', tat: 'Tatar', tok: 'Toki Pona',
|
|
157
|
-
tuk: 'Turkmen', urd: 'Urdu', uzb: 'Uzbek', wel: 'Welsh',
|
|
158
|
-
und: 'Unknown language', '': 'Unknown language' };
|
|
138
|
+
var LANG_NAMES = { eng: U.t('English'), spa: U.t('Spanish'), fre: U.t('French'), ger: U.t('German'), ita: U.t('Italian'), por: U.t('Portuguese'),
|
|
139
|
+
dut: U.t('Dutch'), rus: U.t('Russian'), ara: U.t('Arabic'), tur: U.t('Turkish'), pol: U.t('Polish'),
|
|
140
|
+
jpn: U.t('Japanese'), ja: U.t('Japanese'), kor: U.t('Korean'), ko: U.t('Korean'), chi: U.t('Chinese'), zho: U.t('Chinese'), zh: U.t('Chinese'),
|
|
141
|
+
hin: U.t('Hindi'), hi: U.t('Hindi'), swe: U.t('Swedish'), sv: U.t('Swedish'), nor: U.t('Norwegian'), no: U.t('Norwegian'), nob: U.t('Norwegian'),
|
|
142
|
+
dan: U.t('Danish'), da: U.t('Danish'), fin: U.t('Finnish'), fi: U.t('Finnish'), gre: U.t('Greek'), ell: U.t('Greek'), el: U.t('Greek'),
|
|
143
|
+
heb: U.t('Hebrew'), he: U.t('Hebrew'), hun: U.t('Hungarian'), hu: U.t('Hungarian'), cze: U.t('Czech'), ces: U.t('Czech'), cs: U.t('Czech'),
|
|
144
|
+
rum: U.t('Romanian'), ron: U.t('Romanian'), ro: U.t('Romanian'), ukr: U.t('Ukrainian'), uk: U.t('Ukrainian'), tha: U.t('Thai'), th: U.t('Thai'),
|
|
145
|
+
vie: U.t('Vietnamese'), vi: U.t('Vietnamese'), ind: U.t('Indonesian'), id: U.t('Indonesian'), cat: U.t('Catalan'), ca: U.t('Catalan'),
|
|
146
|
+
bul: U.t('Bulgarian'), bg: U.t('Bulgarian'), hrv: U.t('Croatian'), hr: U.t('Croatian'), srp: U.t('Serbian'), sr: U.t('Serbian'),
|
|
147
|
+
per: U.t('Persian'), fas: U.t('Persian'), fa: U.t('Persian'), slo: U.t('Slovak'), slv: U.t('Slovenian'), may: U.t('Malay'), fil: U.t('Filipino'),
|
|
148
|
+
baq: U.t('Basque'), glg: U.t('Galician'), est: U.t('Estonian'), lav: U.t('Latvian'), lit: U.t('Lithuanian'), ice: U.t('Icelandic'),
|
|
149
|
+
tam: U.t('Tamil'), tel: U.t('Telugu'), ben: U.t('Bengali'), mul: U.t('Multiple languages'), zxx: U.t('No language'),
|
|
150
|
+
afr: U.t('Afrikaans'), alb: U.t('Albanian'), arg: U.t('Aragonese'), arm: U.t('Armenian'), ast: U.t('Asturian'), aze: U.t('Azerbaijani'),
|
|
151
|
+
bel: U.t('Belarusian'), bos: U.t('Bosnian'), bre: U.t('Breton'), bur: U.t('Burmese'), prs: U.t('Dari'), epo: U.t('Esperanto'), ext:
|
|
152
|
+
U.t('Extremaduran'), gla: U.t('Scottish Gaelic'), geo: U.t('Georgian'), ibo: U.t('Igbo'), ina: U.t('Interlingua'), gle: U.t('Irish'), kan:
|
|
153
|
+
U.t('Kannada'), kaz: U.t('Kazakh'), khm: U.t('Khmer'), kur: U.t('Kurdish'), ltz: U.t('Luxembourgish'), mac: U.t('Macedonian'), mal:
|
|
154
|
+
U.t('Malayalam'), mni: U.t('Manipuri'), mar: U.t('Marathi'), mon: U.t('Mongolian'), mne: U.t('Montenegrin'), nav: U.t('Navajo'), nep:
|
|
155
|
+
U.t('Nepali'), sme: U.t('Northern Sami'), oci: U.t('Occitan'), ori: U.t('Odia'), pan: U.t('Punjabi'), pus: U.t('Pashto'), sat: U.t('Santali'),
|
|
156
|
+
snd: U.t('Sindhi'), sin: U.t('Sinhala'), som: U.t('Somali'), swa: U.t('Swahili'), syr: U.t('Syriac'), tat: U.t('Tatar'), tok: U.t('Toki Pona'),
|
|
157
|
+
tuk: U.t('Turkmen'), urd: U.t('Urdu'), uzb: U.t('Uzbek'), wel: U.t('Welsh'),
|
|
158
|
+
und: U.t('Unknown language'), '': U.t('Unknown language') };
|
|
159
159
|
function langName(lang) {
|
|
160
160
|
var k = langKey(lang);
|
|
161
161
|
if (LANG_NAMES[k]) { return LANG_NAMES[k]; }
|
|
162
162
|
var raw = ('' + (lang || '')).trim();
|
|
163
|
-
return raw ? raw.charAt(0).toUpperCase() + raw.slice(1) : 'Unknown language';
|
|
163
|
+
return raw ? raw.charAt(0).toUpperCase() + raw.slice(1) : U.t('Unknown language');
|
|
164
164
|
}
|
|
165
165
|
// Order for language groups: current choice, then the preferred languages, then by name.
|
|
166
166
|
function langRank(k, prefs) {
|
package/js/player-quality.js
CHANGED
|
@@ -105,10 +105,10 @@
|
|
|
105
105
|
_ytRetried = false; // new pick → its one-shot retry is available again
|
|
106
106
|
_autoRetried = false; // ...and so is the final Auto fallback
|
|
107
107
|
_userPicked = true;
|
|
108
|
-
var label = bw == null ? 'Auto quality' : (labelForBw(bw) || 'new quality');
|
|
109
|
-
_startNote = bw == null ? 'Playing with Auto quality' : 'Playing at '
|
|
108
|
+
var label = bw == null ? U.t('Auto quality') : (labelForBw(bw) || U.t('new quality'));
|
|
109
|
+
_startNote = bw == null ? U.t('Playing with Auto quality') : U.t('Playing at {quality}', { quality: label });
|
|
110
110
|
S.ctx.resumeSec = S.isLive ? 0 : S.cur;
|
|
111
|
-
_switchNote = message || 'Switching to '
|
|
111
|
+
_switchNote = message || U.t('Switching to {quality}…', { quality: label });
|
|
112
112
|
U.spinner(true, _switchNote);
|
|
113
113
|
// YouTube: don't re-open the same (cached, now-stale) master and lean on an AVPlay cap.
|
|
114
114
|
// Rebuild the proxy URL so the service serves a single-rung master (&h=) from a FRESH
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
S.ctx.resumeSec = S.isLive ? 0 : S.cur;
|
|
135
135
|
S.ctx.url = YTPlay.resolverUrl(S.ctx.yt, retryHeight, true, S.ctx.ytLang);
|
|
136
136
|
// Right after a switch this retry is routine: keep saying "Switching to …"
|
|
137
|
-
U.spinner(true, _switchNote || (
|
|
137
|
+
U.spinner(true, _switchNote || (retryHeight ? U.t('{quality} didn\'t start — retrying…', { quality: retryHeight + 'p' }) : U.t('The stream didn\'t start — retrying…')));
|
|
138
138
|
_switchNote = null;
|
|
139
139
|
if (P.useAV) { startAV(S.ctx.url, true); } else { startHTML5(S.ctx.url); }
|
|
140
140
|
return true;
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
if (_qualityBw == null) { return false; }
|
|
147
147
|
var lower = nextLowerBw(_qualityBw);
|
|
148
148
|
if (lower == null) { return false; }
|
|
149
|
-
setQuality(lower, (
|
|
149
|
+
setQuality(lower, U.t('{quality} didn\'t start — trying {lower}…', { quality: labelForBw(_qualityBw) || U.t('That quality'), lower: labelForBw(lower) }));
|
|
150
150
|
return true;
|
|
151
151
|
}
|
|
152
152
|
|
|
@@ -162,8 +162,8 @@
|
|
|
162
162
|
S.ctx.initialQualityHeight = 0;
|
|
163
163
|
S.ctx.resumeSec = S.isLive ? 0 : S.cur;
|
|
164
164
|
if (S.ctx.yt && typeof YTPlay !== 'undefined') { S.ctx.url = YTPlay.resolverUrl(S.ctx.yt, 0, true, S.ctx.ytLang); }
|
|
165
|
-
_startNote = wasAuto ? '' : 'Playing with Auto quality';
|
|
166
|
-
U.spinner(true, wasAuto ? 'Stream didn\'t start — retrying…' : 'Retrying with Auto quality…');
|
|
165
|
+
_startNote = wasAuto ? '' : U.t('Playing with Auto quality');
|
|
166
|
+
U.spinner(true, wasAuto ? U.t('Stream didn\'t start — retrying…') : U.t('Retrying with Auto quality…'));
|
|
167
167
|
if (P.useAV) { startAV(S.ctx.url); } else { startHTML5(S.ctx.url); }
|
|
168
168
|
return true;
|
|
169
169
|
}
|
|
@@ -289,8 +289,8 @@
|
|
|
289
289
|
S.ctx.resumeSec = S.cur;
|
|
290
290
|
var v = variantByBw(_qualityBw);
|
|
291
291
|
S.ctx.url = YTPlay.resolverUrl(S.ctx.yt, v ? v.h : (S.ctx.initialQualityHeight || 0), true, lang);
|
|
292
|
-
_switchNote = 'Switching to '
|
|
293
|
-
_startNote = 'Audio: '
|
|
292
|
+
_switchNote = U.t('Switching to {quality}…', { quality: ytLangLabel(a) });
|
|
293
|
+
_startNote = U.t('Audio: {track}', { track: ytLangLabel(a) });
|
|
294
294
|
U.spinner(true, _switchNote);
|
|
295
295
|
if (P.useAV) { startAV(S.ctx.url, true); } else { startHTML5(S.ctx.url); }
|
|
296
296
|
}
|
|
@@ -300,20 +300,20 @@
|
|
|
300
300
|
var idx = 0;
|
|
301
301
|
var items = list.map(function (a, i) {
|
|
302
302
|
if (a === cur) { idx = i; }
|
|
303
|
-
return { label: ytLangLabel(a), detail: a.original ? 'Original' : 'AI-dubbed by YouTube', sel: a === cur,
|
|
303
|
+
return { label: ytLangLabel(a), detail: a.original ? U.t('Original') : U.t('AI-dubbed by YouTube'), sel: a === cur,
|
|
304
304
|
run: function () { closeMenu(); setYtLanguage(a); } };
|
|
305
305
|
});
|
|
306
|
-
return { title: 'Audio language', items: items, idx: idx };
|
|
306
|
+
return { title: U.t('Audio language'), items: items, idx: idx };
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
function qualityLabel() {
|
|
310
|
-
if (_qualityBw == null) { return 'Auto'; }
|
|
310
|
+
if (_qualityBw == null) { return U.t('Auto'); }
|
|
311
311
|
for (var i = 0; i < _variants.length; i++) { if (_variants[i].bw === _qualityBw) { return _variants[i].label; } }
|
|
312
|
-
return 'Auto';
|
|
312
|
+
return U.t('Auto');
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
function qualityMenu() {
|
|
316
|
-
var items = [{ label: 'Auto', detail: 'Adapt to bandwidth', sel: _qualityBw == null,
|
|
316
|
+
var items = [{ label: U.t('Auto'), detail: U.t('Adapt to bandwidth'), sel: _qualityBw == null,
|
|
317
317
|
run: function () { setQuality(null); closeMenu(); } }];
|
|
318
318
|
_variants.forEach(function (v) {
|
|
319
319
|
items.push({ label: v.label, detail: Math.round(v.bw / 1000) + ' kbps', sel: _qualityBw === v.bw,
|
|
@@ -321,7 +321,7 @@
|
|
|
321
321
|
});
|
|
322
322
|
var idx = 0;
|
|
323
323
|
for (var i = 0; i < items.length; i++) { if (items[i].sel) { idx = i; break; } }
|
|
324
|
-
return { title: 'Video quality', items: items, idx: idx };
|
|
324
|
+
return { title: U.t('Video quality'), items: items, idx: idx };
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
// ----- for the other parts (and js/player.js) -----
|