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/local.js
CHANGED
|
@@ -236,7 +236,7 @@ var LocalMedia = (function () {
|
|
|
236
236
|
}).then(function () {
|
|
237
237
|
rebuild();
|
|
238
238
|
emit('drives');
|
|
239
|
-
U.toast(s.state === 'MOUNTED' ? 'USB drive connected' : 'USB drive removed', 2500);
|
|
239
|
+
U.toast(s.state === 'MOUNTED' ? U.t('USB drive connected') : U.t('USB drive removed'), 2500);
|
|
240
240
|
});
|
|
241
241
|
}, function () {});
|
|
242
242
|
} catch (e) {}
|
|
@@ -749,7 +749,7 @@ var LocalMedia = (function () {
|
|
|
749
749
|
}).map(function (s) {
|
|
750
750
|
var st = stem(nameOf(s)), rest = st.toLowerCase().indexOf(base) === 0 ? st.slice(base.length) : st;
|
|
751
751
|
var l = langFrom(rest);
|
|
752
|
-
return subTrack(drive, s, l.lang, 'Next to the file
|
|
752
|
+
return subTrack(drive, s, l.lang, l.forced ? U.t('Next to the file (forced)') : U.t('Next to the file'));
|
|
753
753
|
});
|
|
754
754
|
}
|
|
755
755
|
function subTrack(drive, s, lang, label) {
|
|
@@ -786,9 +786,9 @@ var LocalMedia = (function () {
|
|
|
786
786
|
var net = isNet(drive) ? drive.dav : null;
|
|
787
787
|
var abs = net ? NetFolders.fileUrl(net, file.p) : drive.root + '/' + file.p, name = nameOf(file.p), url = net ? abs : (uri || fileUri(abs));
|
|
788
788
|
var icon = net ? '🌐' : '💾';
|
|
789
|
-
var st = { name: icon + (net ? '
|
|
789
|
+
var st = { name: icon + ' ' + (net ? U.t('Network folder') : U.t('USB drive')), title: name + (file.size ? '\n' + icon + ' ' + humanSize(file.size) : ''), url: url,
|
|
790
790
|
behaviorHints: { filename: name, videoSize: file.size || undefined, bingeGroup: 'stremiok-local' },
|
|
791
|
-
_addon: net ? 'Your network folder' : 'Your USB drive', _local: MARK, _localSubs: subs || subsInIndex(drive, file.p),
|
|
791
|
+
_addon: net ? U.t('Your network folder') : U.t('Your USB drive'), _local: MARK, _localSubs: subs || subsInIndex(drive, file.p),
|
|
792
792
|
_localFile: { abs: abs, rel: file.p, size: file.size || 0, name: name } };
|
|
793
793
|
if (net) { st._localFile.dav = net.id; }
|
|
794
794
|
_recent.set(url, st);
|
|
@@ -824,14 +824,14 @@ var LocalMedia = (function () {
|
|
|
824
824
|
subsInIndex(x.drive, x.file.p).forEach(function (t) {
|
|
825
825
|
if (seen[t.id]) { return; }
|
|
826
826
|
seen[t.id] = 1;
|
|
827
|
-
t._addon = isNet(x.drive) ? 'Your network folder' : 'Your USB drive';
|
|
827
|
+
t._addon = isNet(x.drive) ? U.t('Your network folder') : U.t('Your USB drive');
|
|
828
828
|
out.push(t);
|
|
829
829
|
});
|
|
830
830
|
});
|
|
831
831
|
(_subsById[id] || []).forEach(function (x) { // (subtitle files of their own, matched to it)
|
|
832
832
|
if (seen['file:' + x.rel]) { return; }
|
|
833
833
|
seen['file:' + x.rel] = 1;
|
|
834
|
-
out.push(subTrack(x.drive, x.rel, langOfName(x.rel), isNet(x.drive) ? 'Your network folder' : 'Your USB drive'));
|
|
834
|
+
out.push(subTrack(x.drive, x.rel, langOfName(x.rel), isNet(x.drive) ? U.t('Your network folder') : U.t('Your USB drive')));
|
|
835
835
|
});
|
|
836
836
|
return out;
|
|
837
837
|
}
|
|
@@ -911,14 +911,14 @@ var LocalMedia = (function () {
|
|
|
911
911
|
var want = parsePlainId(e.id), rel = want.rel, dm = /^@dav:([a-z0-9]+)\/(.+)$/.exec(rel);
|
|
912
912
|
if (dm) { // a network folder's file
|
|
913
913
|
var nf = typeof NetFolders !== 'undefined' ? NetFolders.get(dm[1]) : null;
|
|
914
|
-
if (!nf) { U.toast('The network folder with “'
|
|
915
|
-
if (nf.off) { U.toast('“
|
|
914
|
+
if (!nf) { U.toast(U.t('The network folder with “{name}” was removed', { name: nameOf(dm[2]) }), 4000); return Promise.resolve(false); }
|
|
915
|
+
if (nf.off) { U.toast(U.t('“{name}” is off: Settings › Content › Network folders', { name: nf.name }), 4000); return Promise.resolve(false); }
|
|
916
916
|
playPlain(makeStream(NetFolders.driveOf(nf), { p: dm[2], size: want.size }), onExit, e.id, fromStart);
|
|
917
917
|
return Promise.resolve(true);
|
|
918
918
|
}
|
|
919
919
|
return ensure().then(function (ds) {
|
|
920
920
|
ds = ds.filter(function (x) { return !isNet(x); }); // (a USB drive's file)
|
|
921
|
-
if (!ds.length) { U.toast('Plug in the USB drive with “'
|
|
921
|
+
if (!ds.length) { U.toast(U.t('Plug in the USB drive with “{name}”', { name: nameOf(rel) }), 4000); return false; }
|
|
922
922
|
var d = null, f = null;
|
|
923
923
|
ds.forEach(function (x) {
|
|
924
924
|
var idx = _index[x.root], hit = idx && idx.files.filter(function (y) { return y.p === rel && (!want.size || y.size === want.size); })[0];
|
package/js/netfolders.js
CHANGED
|
@@ -38,7 +38,7 @@ var NetFolders = (function () {
|
|
|
38
38
|
function nameOf(url) {
|
|
39
39
|
var m = /^https?:\/\/([^\/:]+)(?::\d+)?(\/.*)?$/i.exec(url) || [], segs = (m[2] || '/').split('/').filter(Boolean), last = segs.length ? segs[segs.length - 1] : '';
|
|
40
40
|
try { last = decodeURIComponent(last); } catch (e) {}
|
|
41
|
-
return
|
|
41
|
+
return last ? U.t('{folder} on {host}', { folder: last, host: m[1] || url }) : (m[1] || url);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
// ---- through StremioK's service ----
|
|
@@ -51,23 +51,23 @@ var NetFolders = (function () {
|
|
|
51
51
|
}
|
|
52
52
|
function query(f, rel) { return '?u=' + encodeURIComponent(f.url) + (rel != null ? '&p=' + encodeURIComponent(rel) : ''); }
|
|
53
53
|
var WHY = {
|
|
54
|
-
auth: 'It refused the user name or password',
|
|
55
|
-
untrusted: 'Its certificate isn’t from a known authority',
|
|
56
|
-
unreachable: 'Couldn’t reach it',
|
|
57
|
-
notdav: 'Not a WebDAV folder',
|
|
58
|
-
missing: 'No such folder there',
|
|
59
|
-
elsewhere: 'It sent StremioK to another address (not followed)',
|
|
60
|
-
toolarge: 'Its answer was too large',
|
|
61
|
-
busy: 'Another folder is being indexed: try again when it’s done'
|
|
54
|
+
auth: U.t('It refused the user name or password'),
|
|
55
|
+
untrusted: U.t('Its certificate isn’t from a known authority'),
|
|
56
|
+
unreachable: U.t('Couldn’t reach it'),
|
|
57
|
+
notdav: U.t('Not a WebDAV folder'),
|
|
58
|
+
missing: U.t('No such folder there'),
|
|
59
|
+
elsewhere: U.t('It sent StremioK to another address (not followed)'),
|
|
60
|
+
toolarge: U.t('Its answer was too large'),
|
|
61
|
+
busy: U.t('Another folder is being indexed: try again when it’s done')
|
|
62
62
|
};
|
|
63
63
|
// The service's answer, or what went wrong: an Error with why (and, untrusted, the
|
|
64
64
|
// certificate: cert, fp, name, until).
|
|
65
65
|
function ask(f, path, rel, timeout, max, cancel) {
|
|
66
|
-
if (typeof LocalMedia === 'undefined' || !LocalMedia.askService) { return Promise.reject(new Error('no StremioK service here')); }
|
|
66
|
+
if (typeof LocalMedia === 'undefined' || !LocalMedia.askService) { return Promise.reject(new Error(U.t('no StremioK service here'))); }
|
|
67
67
|
return LocalMedia.askService('/dav/' + path + query(f, rel), timeout, max, cancel, headers(f)).then(function (r) {
|
|
68
|
-
if (!r || typeof r !== 'object') { throw new Error('No answer from StremioK’s service'); }
|
|
68
|
+
if (!r || typeof r !== 'object') { throw new Error(U.t('No answer from StremioK’s service')); }
|
|
69
69
|
if (r.why) {
|
|
70
|
-
var e = new Error((WHY[r.why] || 'It failed') + (r.message && r.why !== 'auth' && r.why !== 'busy' ? ' (' + r.message + ')' : ''));
|
|
70
|
+
var e = new Error((WHY[r.why] || U.t('It failed')) + (r.message && r.why !== 'auth' && r.why !== 'busy' ? ' (' + r.message + ')' : ''));
|
|
71
71
|
e.why = r.why;
|
|
72
72
|
if (r.why === 'untrusted' && typeof r.cert === 'string') { e.cert = r.cert; e.fp = '' + (r.fp || ''); e.name = '' + (r.name || ''); e.until = '' + (r.until || ''); }
|
|
73
73
|
throw e;
|
|
@@ -128,7 +128,7 @@ var NetFolders = (function () {
|
|
|
128
128
|
// Keep a folder probe() found (the same address again: replaced).
|
|
129
129
|
function add(p) {
|
|
130
130
|
var l = all().filter(function (f) { return f.url !== p.url; });
|
|
131
|
-
if (l.length >= MAX) { throw new Error('Up to
|
|
131
|
+
if (l.length >= MAX) { throw new Error(U.t('Up to {n} network folders', { n: MAX })); }
|
|
132
132
|
var f = { id: newId(), name: p.name || nameOf(p.url), url: p.url, user: p.user || '', pass: p.pass || '', cert: p.cert || '', at: Date.now() };
|
|
133
133
|
l.push(f);
|
|
134
134
|
save(l);
|
package/js/player-audio.js
CHANGED
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
setAudioTrack(tracks[pos].index);
|
|
70
70
|
_audioIdx = tracks[pos].index;
|
|
71
71
|
U.log('player', 'Audio picked before playback (Quick): ' + audioLabel(tracks[pos], pos));
|
|
72
|
-
U.toast('Audio: '
|
|
72
|
+
U.toast(U.t('Audio: {track}', { track: audioLabel(tracks[pos], pos) }));
|
|
73
73
|
return true;
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
var tracks = getAudioTracks();
|
|
137
137
|
_audioIdx = playingAudioIndex(tracks);
|
|
138
138
|
var pos = preferredPos(tracks);
|
|
139
|
-
if (pos >= 0 && tracks[pos].index !== _audioIdx) { selectAudio(tracks[pos].index, 'Audio: '
|
|
139
|
+
if (pos >= 0 && tracks[pos].index !== _audioIdx) { selectAudio(tracks[pos].index, U.t('Audio: {track}', { track: audioLabel(tracks[pos], pos) })); }
|
|
140
140
|
}
|
|
141
141
|
// The track to play (its position in tracks), or -1: leave the one playing.
|
|
142
142
|
function preferredPos(tracks) {
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
var lang = info && infoLang(info);
|
|
185
185
|
var ch = info && (info.channels || info.channel);
|
|
186
186
|
var parts = [];
|
|
187
|
-
parts.push((lang && lang !== 'und' && lang !== '') ? lang : ('Audio '
|
|
187
|
+
parts.push((lang && lang !== 'und' && lang !== '') ? lang : U.t('Audio {n}', { n: n + 1 }));
|
|
188
188
|
if (ch) { parts.push(ch + 'ch'); }
|
|
189
189
|
return parts.join(' · ');
|
|
190
190
|
}
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
function audioMenuLabel(tr, n) {
|
|
194
194
|
var info = trackInfo(tr), lang = infoLang(info);
|
|
195
195
|
var ch = info.channels || info.channel, codec = info.fourCC || info.codec || '';
|
|
196
|
-
var parts = [lang && lang !== 'und' ? langName(lang) : 'Audio '
|
|
196
|
+
var parts = [lang && lang !== 'und' ? langName(lang) : U.t('Audio {n}', { n: n + 1 })];
|
|
197
197
|
if (ch) { parts.push(ch + 'ch'); }
|
|
198
198
|
if (codec) { parts.push(('' + codec).toUpperCase()); }
|
|
199
199
|
var label = parts.join(' · ');
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
try { var at = S.videoEl.audioTracks; for (var i = 0; i < at.length; i++) { at[i].enabled = (i === index); } } catch (e3) {}
|
|
234
234
|
}
|
|
235
235
|
_audioIdx = index;
|
|
236
|
-
U.toast(message || 'Audio track changed');
|
|
236
|
+
U.toast(message || U.t('Audio track changed'));
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
// A series' episode: the series it's in (its choice of audio carries to the next episodes).
|
|
@@ -275,14 +275,14 @@
|
|
|
275
275
|
if (tries >= HOLD_TRIES) {
|
|
276
276
|
_held = null;
|
|
277
277
|
U.log('player', 'Audio switch to track ' + index + ': still refused after ' + HOLD_TRIES + ' tries, left');
|
|
278
|
-
U.toast('The TV didn’t switch the audio: choose it again', 4000);
|
|
278
|
+
U.toast(U.t('The TV didn’t switch the audio: choose it again'), 4000);
|
|
279
279
|
return;
|
|
280
280
|
}
|
|
281
281
|
var first = !_held || _held.index !== index;
|
|
282
282
|
_held = { index: index, message: message, force: force, tries: tries };
|
|
283
283
|
_audioIdx = index; // (the menu ticks it meanwhile)
|
|
284
284
|
if (first) { U.log('player', 'Audio switch to track ' + index + ' held (' + why + '): made once it plays on'); }
|
|
285
|
-
if (first && why === 'paused') { U.toast((message || 'Audio track changed')
|
|
285
|
+
if (first && why === 'paused') { U.toast(U.t('{what}: when you carry on', { what: message || U.t('Audio track changed') }), 3000); }
|
|
286
286
|
}
|
|
287
287
|
// ----- Diagnostics: what the TV said of its audio tracks around a switch -----
|
|
288
288
|
var SWITCH_CHECK_MS = 2500;
|
|
@@ -293,14 +293,14 @@
|
|
|
293
293
|
try {
|
|
294
294
|
var l = (avplay.getTotalTrackInfo() || []).filter(function (t) { return t && ('' + t.type).toUpperCase() === 'AUDIO'; }).map(rawOf);
|
|
295
295
|
return l.length ? l.join(' | ') : 'none';
|
|
296
|
-
} catch (e) { return '(unreadable: '
|
|
296
|
+
} catch (e) { return U.t('(unreadable: {why})', { why: trackError(e) }); }
|
|
297
297
|
}
|
|
298
298
|
// the audio track it says is playing (getCurrentStreamInfo)
|
|
299
299
|
function playingRaw() {
|
|
300
300
|
try {
|
|
301
301
|
var now = (avplay.getCurrentStreamInfo() || []).filter(function (t) { return t && ('' + t.type).toUpperCase() === 'AUDIO'; });
|
|
302
302
|
return now.length ? rawOf(now[0]) : 'none reported';
|
|
303
|
-
} catch (e) { return '(unreadable: '
|
|
303
|
+
} catch (e) { return U.t('(unreadable: {why})', { why: trackError(e) }); }
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
// No TV player (TizenBrew: the TV gives it only to installed apps; a desktop browser): the
|
|
@@ -309,8 +309,8 @@
|
|
|
309
309
|
function cantSwitch() { return !avplay; }
|
|
310
310
|
function cantSwitchText() {
|
|
311
311
|
return (typeof YTPlay !== 'undefined' && YTPlay.installMode && YTPlay.installMode() === 'tizenbrew')
|
|
312
|
-
? 'Under TizenBrew only a file’s first audio track plays: the TV gives its own player only to installed apps. The sideloaded app can switch.'
|
|
313
|
-
: 'Here only a file’s first audio track plays (no TV player).';
|
|
312
|
+
? U.t('Under TizenBrew only a file’s first audio track plays: the TV gives its own player only to installed apps. The sideloaded app can switch.')
|
|
313
|
+
: U.t('Here only a file’s first audio track plays (no TV player).');
|
|
314
314
|
}
|
|
315
315
|
// Tracks sorted by language (preferred languages first) and named in full, so the
|
|
316
316
|
// same language's tracks sit together.
|
|
@@ -331,7 +331,7 @@
|
|
|
331
331
|
run: function () {
|
|
332
332
|
if (stuck) { closeMenu(); U.toast(cantSwitchText(), 6000); return; }
|
|
333
333
|
// re-picking the checked track re-applies it (see selectAudio)
|
|
334
|
-
selectAudio(tr.index, 'Audio: '
|
|
334
|
+
selectAudio(tr.index, U.t('Audio: {track}', { track: audioLabel(tr, x.n) }), tr.index === _audioIdx);
|
|
335
335
|
var info = trackInfo(tr);
|
|
336
336
|
var sel = { url: S.ctx.url, index: tr.index, lang: infoLang(info), ch: info.channels || info.channel || '' };
|
|
337
337
|
rememberAudio(S.ctx.id, sel);
|
|
@@ -343,17 +343,17 @@
|
|
|
343
343
|
// (player-core's setLiveSound), after its tracks.
|
|
344
344
|
var ls = P.liveSound ? P.liveSound() : null;
|
|
345
345
|
if (ls) {
|
|
346
|
-
[[false, 'Sound: straight from the server'], [true, 'Sound: repacked by StremioK’s service']].forEach(function (o) {
|
|
346
|
+
[[false, U.t('Sound: straight from the server'), U.t('Already straight from the server')], [true, U.t('Sound: repacked by StremioK’s service'), U.t('Already repacked by StremioK’s service')]].forEach(function (o) {
|
|
347
347
|
var on = o[0] === ls.repacked;
|
|
348
|
-
items.push({ label: o[1], sel: on, detail: on && ls.mine ? 'your choice' : '', run: function () {
|
|
348
|
+
items.push({ label: o[1], sel: on, detail: on && ls.mine ? U.t('your choice') : '', run: function () {
|
|
349
349
|
closeMenu();
|
|
350
|
-
if (on) { U.toast(o[
|
|
350
|
+
if (on) { U.toast(o[2], 2500); return; }
|
|
351
351
|
P.setLiveSound(o[0]);
|
|
352
352
|
} });
|
|
353
353
|
});
|
|
354
354
|
}
|
|
355
|
-
if (stuck) { return { title: 'Audio track', items: items, idx: idx, wide: true, node: U.el('div', 'sm-detail', cantSwitchText()) }; }
|
|
356
|
-
return { title: 'Audio track', items: items, idx: idx };
|
|
355
|
+
if (stuck) { return { title: U.t('Audio track'), items: items, idx: idx, wide: true, node: U.el('div', 'sm-detail', cantSwitchText()) }; }
|
|
356
|
+
return { title: U.t('Audio track'), items: items, idx: idx };
|
|
357
357
|
}
|
|
358
358
|
|
|
359
359
|
// ----- for the other parts (and js/player.js) -----
|