stremiok 2.4.2 → 2.4.3

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 CHANGED
@@ -3,6 +3,16 @@
3
3
  What changed in each version of StremioK, newest first. How everything works is in the
4
4
  [user guide](docs/USER-GUIDE.md).
5
5
 
6
+ ## 2.4.3 — 2026-11-17
7
+ - **Through StremioK's service, your languages come first:** your preferred audio and subtitle
8
+ tracks listed first, no need to 'safely switch'.
9
+ - **Subtitles in your language: the file's own first,** then an addon's (in your addon order), a
10
+ USB drive's, a YouTube caption; then your second choice the same way. A built-in one comes on
11
+ as soon as the video plays.
12
+ - **When it ends:** under the time at the top right of the player, *Ends 21:47* (not on live
13
+ channels).
14
+ - **Fixed: built-in subtitles back in English** after the audio switched, on 2017 TVs.
15
+
6
16
  ## 2.4.2 — 2026-11-16
7
17
  - **Built-in audio and subtitle tracks named from the file** more often: also when the TV lists
8
18
  fewer tracks than the file. The subtitle list says each language in full, and of your
package/config.xml CHANGED
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets"
3
- id="http://stremiok.tizen/StremioKTizen" version="2.4.2" viewmodes="maximized">
3
+ id="http://stremiok.tizen/StremioKTizen" version="2.4.3" viewmodes="maximized">
4
4
  <tizen:application id="StremioK01.StremioK" package="StremioK01" required_version="3.0"/>
5
5
  <content src="index.html"/>
6
6
  <feature name="http://tizen.org/feature/screen.size.all"/>
package/css/style.css CHANGED
@@ -582,3 +582,4 @@ html, body {
582
582
  .home-info-pic.hidden { display: none; }
583
583
  #osd-clock { position: fixed; top: 40px; right: 60px; font-size: 34px; font-weight: bold; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.9); } /* (the time of day, top right, while the bar shows) */
584
584
  #osd-clock:empty { display: none; }
585
+ #osd-clock .osd-ends { font-size: 22px; font-weight: normal; text-align: right; opacity: 0.85; margin-top: 2px; } /* (when what plays ends, under the time) */
package/index.html CHANGED
@@ -4,8 +4,8 @@
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=1920, height=1080, user-scalable=no">
6
6
  <title>StremioK</title>
7
- <link rel="stylesheet" href="css/style.css?v=2.4.2">
8
- <link rel="stylesheet" href="css/modern.css?v=2.4.2">
7
+ <link rel="stylesheet" href="css/style.css?v=2.4.3">
8
+ <link rel="stylesheet" href="css/modern.css?v=2.4.3">
9
9
  </head>
10
10
  <body>
11
11
  <!-- CSS-applied sentinel (kept off-screen); app.js waits for its width before rendering -->
@@ -54,49 +54,49 @@
54
54
 
55
55
  <!-- Load order matters: polyfills -> util -> iptv -> data -> input -> tvapps -> player parts -> player -> ytplay -> view parts -> views -> app -->
56
56
  <!-- ?v= busts the TV webview cache on every release (keep in sync with package.json) -->
57
- <script src="js/polyfills.js?v=2.4.2"></script>
58
- <script src="js/profiles.js?v=2.4.2"></script>
59
- <script src="js/lang/languages.js?v=2.4.2"></script>
60
- <script src="js/i18n.js?v=2.4.2"></script>
61
- <script src="js/util.js?v=2.4.2"></script>
62
- <script src="js/iptv.js?v=2.4.2"></script>
63
- <script src="js/xtvod.js?v=2.4.2"></script>
64
- <script src="js/stvod.js?v=2.4.2"></script>
65
- <script src="js/plugins.js?v=2.4.2"></script>
66
- <script src="js/jellyfin.js?v=2.4.2"></script>
67
- <script src="js/plex.js?v=2.4.2"></script>
68
- <script src="js/epg.js?v=2.4.2"></script>
69
- <script src="js/youtube.js?v=2.4.2"></script>
70
- <script src="js/stremio.js?v=2.4.2"></script>
71
- <script src="js/trakt.js?v=2.4.2"></script>
72
- <script src="js/keys.js?v=2.4.2"></script>
73
- <script src="js/focus.js?v=2.4.2"></script>
74
- <script src="js/tvapps.js?v=2.4.2"></script>
75
- <script src="js/player-core.js?v=2.4.2"></script>
76
- <script src="js/player-store.js?v=2.4.2"></script>
77
- <script src="js/player-lang.js?v=2.4.2"></script>
78
- <script src="js/player-quality.js?v=2.4.2"></script>
79
- <script src="js/player-subs.js?v=2.4.2"></script>
80
- <script src="js/player-audio.js?v=2.4.2"></script>
81
- <script src="js/player-controls.js?v=2.4.2"></script>
82
- <script src="js/player.js?v=2.4.2"></script>
83
- <script src="js/ytplay.js?v=2.4.2"></script>
84
- <script src="js/netfolders.js?v=2.4.2"></script>
85
- <script src="js/local.js?v=2.4.2"></script>
86
- <script src="js/downloads.js?v=2.4.2"></script>
87
- <script src="js/stremio-account.js?v=2.4.2"></script>
88
- <script src="js/nuvio-import.js?v=2.4.2"></script>
89
- <script src="js/nuvio-sync.js?v=2.4.2"></script>
90
- <script src="js/stremio-sync.js?v=2.4.2"></script>
91
- <script src="js/view-core.js?v=2.4.2"></script>
92
- <script src="js/view-home.js?v=2.4.2"></script>
93
- <script src="js/view-guide.js?v=2.4.2"></script>
94
- <script src="js/view-detail.js?v=2.4.2"></script>
95
- <script src="js/view-search.js?v=2.4.2"></script>
96
- <script src="js/view-settings.js?v=2.4.2"></script>
97
- <script src="js/view-discover.js?v=2.4.2"></script>
98
- <script src="js/views.js?v=2.4.2"></script>
99
- <script src="js/app.js?v=2.4.2"></script>
100
- <script src="js/hubpreview.js?v=2.4.2"></script>
57
+ <script src="js/polyfills.js?v=2.4.3"></script>
58
+ <script src="js/profiles.js?v=2.4.3"></script>
59
+ <script src="js/lang/languages.js?v=2.4.3"></script>
60
+ <script src="js/i18n.js?v=2.4.3"></script>
61
+ <script src="js/util.js?v=2.4.3"></script>
62
+ <script src="js/iptv.js?v=2.4.3"></script>
63
+ <script src="js/xtvod.js?v=2.4.3"></script>
64
+ <script src="js/stvod.js?v=2.4.3"></script>
65
+ <script src="js/plugins.js?v=2.4.3"></script>
66
+ <script src="js/jellyfin.js?v=2.4.3"></script>
67
+ <script src="js/plex.js?v=2.4.3"></script>
68
+ <script src="js/epg.js?v=2.4.3"></script>
69
+ <script src="js/youtube.js?v=2.4.3"></script>
70
+ <script src="js/stremio.js?v=2.4.3"></script>
71
+ <script src="js/trakt.js?v=2.4.3"></script>
72
+ <script src="js/keys.js?v=2.4.3"></script>
73
+ <script src="js/focus.js?v=2.4.3"></script>
74
+ <script src="js/tvapps.js?v=2.4.3"></script>
75
+ <script src="js/player-core.js?v=2.4.3"></script>
76
+ <script src="js/player-store.js?v=2.4.3"></script>
77
+ <script src="js/player-lang.js?v=2.4.3"></script>
78
+ <script src="js/player-quality.js?v=2.4.3"></script>
79
+ <script src="js/player-subs.js?v=2.4.3"></script>
80
+ <script src="js/player-audio.js?v=2.4.3"></script>
81
+ <script src="js/player-controls.js?v=2.4.3"></script>
82
+ <script src="js/player.js?v=2.4.3"></script>
83
+ <script src="js/ytplay.js?v=2.4.3"></script>
84
+ <script src="js/netfolders.js?v=2.4.3"></script>
85
+ <script src="js/local.js?v=2.4.3"></script>
86
+ <script src="js/downloads.js?v=2.4.3"></script>
87
+ <script src="js/stremio-account.js?v=2.4.3"></script>
88
+ <script src="js/nuvio-import.js?v=2.4.3"></script>
89
+ <script src="js/nuvio-sync.js?v=2.4.3"></script>
90
+ <script src="js/stremio-sync.js?v=2.4.3"></script>
91
+ <script src="js/view-core.js?v=2.4.3"></script>
92
+ <script src="js/view-home.js?v=2.4.3"></script>
93
+ <script src="js/view-guide.js?v=2.4.3"></script>
94
+ <script src="js/view-detail.js?v=2.4.3"></script>
95
+ <script src="js/view-search.js?v=2.4.3"></script>
96
+ <script src="js/view-settings.js?v=2.4.3"></script>
97
+ <script src="js/view-discover.js?v=2.4.3"></script>
98
+ <script src="js/views.js?v=2.4.3"></script>
99
+ <script src="js/app.js?v=2.4.3"></script>
100
+ <script src="js/hubpreview.js?v=2.4.3"></script>
101
101
  </body>
102
102
  </html>
package/js/lang/ar.js CHANGED
@@ -432,6 +432,7 @@ I18N.add("ar", {
432
432
  "Emby {v} is too old: 4.7 or newer is needed.": "إصدار Emby {v} قديم جدًا: يلزم 4.7 أو أحدث.",
433
433
  "Emerald": "زمردي",
434
434
  "Endcards / credits": "البطاقات الختامية / الشارة",
435
+ "Ends {time}": "ينتهي {time}",
435
436
  "English": "الإنجليزية",
436
437
  "Enter a Stremio addon manifest URL on its own page": "أدخل URL ملف manifest لإضافة Stremio في صفحتها الخاصة",
437
438
  "Enter a URL": "أدخل URL",
package/js/lang/ca.js CHANGED
@@ -432,6 +432,7 @@ I18N.add("ca", {
432
432
  "Emby {v} is too old: 4.7 or newer is needed.": "Emby {v} és massa antic: cal la 4.7 o una de més nova.",
433
433
  "Emerald": "Maragda",
434
434
  "Endcards / credits": "Targetes finals / crèdits",
435
+ "Ends {time}": "Acaba a les {time}",
435
436
  "English": "Anglès",
436
437
  "Enter a Stremio addon manifest URL on its own page": "Introdueix l’URL del manifest d’un complement de Stremio a la seva pròpia pàgina",
437
438
  "Enter a URL": "Introdueix un URL",
package/js/lang/de.js CHANGED
@@ -432,6 +432,7 @@ I18N.add("de", {
432
432
  "Emby {v} is too old: 4.7 or newer is needed.": "Emby {v} ist zu alt: 4.7 oder neuer wird benötigt.",
433
433
  "Emerald": "Smaragd",
434
434
  "Endcards / credits": "Endkarten / Abspann",
435
+ "Ends {time}": "Endet {time}",
435
436
  "English": "Englisch",
436
437
  "Enter a Stremio addon manifest URL on its own page": "Gib eine Stremio-Addon-Manifest-URL auf ihrer eigenen Seite ein",
437
438
  "Enter a URL": "URL eingeben",
package/js/lang/es.js CHANGED
@@ -432,6 +432,7 @@ I18N.add("es", {
432
432
  "Emby {v} is too old: 4.7 or newer is needed.": "Emby {v} es demasiado antiguo: se necesita 4.7 o posterior.",
433
433
  "Emerald": "Esmeralda",
434
434
  "Endcards / credits": "Tarjetas finales / créditos",
435
+ "Ends {time}": "Termina {time}",
435
436
  "English": "Inglés",
436
437
  "Enter a Stremio addon manifest URL on its own page": "Ingresa la URL del manifiesto de un complemento de Stremio en su propia página",
437
438
  "Enter a URL": "Ingresa una URL",
package/js/lang/fi.js CHANGED
@@ -432,6 +432,7 @@ I18N.add("fi", {
432
432
  "Emby {v} is too old: 4.7 or newer is needed.": "Emby {v} on liian vanha: tarvitaan 4.7 tai uudempi.",
433
433
  "Emerald": "Smaragdi",
434
434
  "Endcards / credits": "Loppukortit / lopputekstit",
435
+ "Ends {time}": "Päättyy {time}",
435
436
  "English": "Englanti",
436
437
  "Enter a Stremio addon manifest URL on its own page": "Syötä Stremio-lisäosan manifestin URL sen omalla sivulla",
437
438
  "Enter a URL": "Syötä URL",
package/js/lang/fr.js CHANGED
@@ -432,6 +432,7 @@ I18N.add("fr", {
432
432
  "Emby {v} is too old: 4.7 or newer is needed.": "Emby {v} est trop ancien : la version 4.7 ou plus récente est requise.",
433
433
  "Emerald": "Émeraude",
434
434
  "Endcards / credits": "Écrans de fin / générique",
435
+ "Ends {time}": "Fin à {time}",
435
436
  "English": "Anglais",
436
437
  "Enter a Stremio addon manifest URL on its own page": "Saisir l’URL du manifeste d’un addon Stremio sur sa propre page",
437
438
  "Enter a URL": "Saisissez une URL",
package/js/lang/he.js CHANGED
@@ -432,6 +432,7 @@ I18N.add("he", {
432
432
  "Emby {v} is too old: 4.7 or newer is needed.": "Emby {v} ישן מדי: נדרשת גרסה 4.7 ומעלה.",
433
433
  "Emerald": "אזמרגד",
434
434
  "Endcards / credits": "מסכי סיום / כתוביות סיום",
435
+ "Ends {time}": "מסתיים ב-{time}",
435
436
  "English": "אנגלית",
436
437
  "Enter a Stremio addon manifest URL on its own page": "הזנת כתובת URL של מניפסט תוסף Stremio בדף נפרד",
437
438
  "Enter a URL": "יש להזין URL",
package/js/lang/hi.js CHANGED
@@ -432,6 +432,7 @@ I18N.add("hi", {
432
432
  "Emby {v} is too old: 4.7 or newer is needed.": "Emby {v} बहुत पुराना है: 4.7 या नया चाहिए।",
433
433
  "Emerald": "एमरल्ड",
434
434
  "Endcards / credits": "एंडकार्ड / क्रेडिट",
435
+ "Ends {time}": "{time} पर खत्म",
435
436
  "English": "अंग्रेज़ी",
436
437
  "Enter a Stremio addon manifest URL on its own page": "Stremio ऐडऑन मैनिफ़ेस्ट URL उसके अपने पेज पर डालें",
437
438
  "Enter a URL": "URL डालें",
package/js/lang/it.js CHANGED
@@ -432,6 +432,7 @@ I18N.add("it", {
432
432
  "Emby {v} is too old: 4.7 or newer is needed.": "Emby {v} è troppo vecchio: serve la 4.7 o successiva.",
433
433
  "Emerald": "Smeraldo",
434
434
  "Endcards / credits": "Schermate finali / titoli di coda",
435
+ "Ends {time}": "Finisce alle {time}",
435
436
  "English": "Inglese",
436
437
  "Enter a Stremio addon manifest URL on its own page": "Inserisci l’URL del manifest di un addon Stremio nella sua pagina",
437
438
  "Enter a URL": "Inserisci un URL",
package/js/lang/ja.js CHANGED
@@ -432,6 +432,7 @@ I18N.add("ja", {
432
432
  "Emby {v} is too old: 4.7 or newer is needed.": "Emby {v} は古すぎます。4.7 以降が必要です。",
433
433
  "Emerald": "エメラルド",
434
434
  "Endcards / credits": "終了画面 / クレジット",
435
+ "Ends {time}": "{time} に終了",
435
436
  "English": "英語",
436
437
  "Enter a Stremio addon manifest URL on its own page": "Stremio アドオンのマニフェスト URL を専用ページで入力",
437
438
  "Enter a URL": "URL を入力してください",
package/js/lang/ko.js CHANGED
@@ -432,6 +432,7 @@ I18N.add("ko", {
432
432
  "Emby {v} is too old: 4.7 or newer is needed.": "Emby {v}은(는) 너무 오래되었습니다. 4.7 이상이 필요합니다.",
433
433
  "Emerald": "에메랄드",
434
434
  "Endcards / credits": "엔드 카드 / 크레딧",
435
+ "Ends {time}": "{time} 종료",
435
436
  "English": "영어",
436
437
  "Enter a Stremio addon manifest URL on its own page": "Stremio 애드온 매니페스트 URL을 별도 페이지에서 입력",
437
438
  "Enter a URL": "URL을 입력하세요",
package/js/lang/pl.js CHANGED
@@ -432,6 +432,7 @@ I18N.add("pl", {
432
432
  "Emby {v} is too old: 4.7 or newer is needed.": "Emby {v} jest za stary: wymagana wersja 4.7 lub nowsza.",
433
433
  "Emerald": "Szmaragdowy",
434
434
  "Endcards / credits": "Plansze końcowe / napisy końcowe",
435
+ "Ends {time}": "Koniec {time}",
435
436
  "English": "Angielski",
436
437
  "Enter a Stremio addon manifest URL on its own page": "Wpisz URL manifestu dodatku Stremio na osobnej stronie",
437
438
  "Enter a URL": "Wpisz URL",
package/js/lang/pt-BR.js CHANGED
@@ -432,6 +432,7 @@ I18N.add("pt-BR", {
432
432
  "Emby {v} is too old: 4.7 or newer is needed.": "Emby {v} é antigo demais: é preciso 4.7 ou mais novo.",
433
433
  "Emerald": "Esmeralda",
434
434
  "Endcards / credits": "Telas finais / créditos",
435
+ "Ends {time}": "Termina às {time}",
435
436
  "English": "Inglês",
436
437
  "Enter a Stremio addon manifest URL on its own page": "Digite a URL do manifesto de um complemento do Stremio numa página própria",
437
438
  "Enter a URL": "Digite uma URL",
package/js/lang/ru.js CHANGED
@@ -432,6 +432,7 @@ I18N.add("ru", {
432
432
  "Emby {v} is too old: 4.7 or newer is needed.": "Emby {v} слишком старый: нужна версия 4.7 или новее.",
433
433
  "Emerald": "Изумрудный",
434
434
  "Endcards / credits": "Конечные заставки / титры",
435
+ "Ends {time}": "Конец в {time}",
435
436
  "English": "Английский",
436
437
  "Enter a Stremio addon manifest URL on its own page": "Ввести URL манифеста аддона Stremio на отдельной странице",
437
438
  "Enter a URL": "Введите URL",
package/js/lang/tr.js CHANGED
@@ -432,6 +432,7 @@ I18N.add("tr", {
432
432
  "Emby {v} is too old: 4.7 or newer is needed.": "Emby {v} çok eski: 4.7 veya daha yenisi gerekir.",
433
433
  "Emerald": "Zümrüt",
434
434
  "Endcards / credits": "Bitiş kartları / jenerik",
435
+ "Ends {time}": "{time} bitiyor",
435
436
  "English": "İngilizce",
436
437
  "Enter a Stremio addon manifest URL on its own page": "Kendi sayfasında bir Stremio eklenti manifest URL’si girin",
437
438
  "Enter a URL": "Bir URL girin",
package/js/lang/zh-CN.js CHANGED
@@ -432,6 +432,7 @@ I18N.add("zh-CN", {
432
432
  "Emby {v} is too old: 4.7 or newer is needed.": "Emby {v} 版本过旧:需要 4.7 或更高版本。",
433
433
  "Emerald": "翠绿色",
434
434
  "Endcards / credits": "片尾卡片 / 片尾字幕",
435
+ "Ends {time}": "{time} 结束",
435
436
  "English": "英语",
436
437
  "Enter a Stremio addon manifest URL on its own page": "在单独的页面中输入 Stremio 插件清单 URL",
437
438
  "Enter a URL": "输入 URL",
@@ -225,6 +225,7 @@
225
225
  U.log('player', 'Audio switch to track ' + index + (force ? ' (again)' : '') + '. The TV lists: ' + rawAudio() + '. Playing: ' + playingRaw());
226
226
  if (!setAudioTrack(index)) { hold(index, message, false, 'refused'); return; }
227
227
  _held = null;
228
+ if (P.subsAfterAudio) { P.subsAfterAudio(); } // (the 2017 TV drops back to its first text track on an audio switch)
228
229
  setTimeout(function () { // (what the TV says it plays once it's had time: a switch it took without following shows here)
229
230
  if (S.active && _audioIdx === index && Date.now() - asked < 10000) { U.log('player', 'Audio switch to track ' + index + ': the TV now plays ' + playingRaw()); }
230
231
  }, SWITCH_CHECK_MS);
@@ -910,9 +910,11 @@
910
910
  if (mi.duration > 0) { parts.push(U.fmtTime(mi.duration)); }
911
911
  lines.push([U.t('In the file'), parts.filter(Boolean).join(' · ')]);
912
912
  if (v && v.dv) { lines.push([U.t('Dolby Vision'), dvNote(v.dv)]); }
913
- if (mi.audio && mi.audio.length) { lines.push([U.t('Audio tracks'), trackList(mi.audio)]); }
913
+ var auds = mi.audio || [], ao = S.ctx && S.ctx._relay && S.ctx._blank && S.ctx._audioOrder;
914
+ if (ao && ao.length) { auds = ao.map(function (i) { return auds[i]; }).filter(Boolean).concat(auds.filter(function (t, i) { return ao.indexOf(i) === -1; })); } // (as the service put them: yours first)
915
+ if (auds.length) { lines.push([U.t('Audio tracks'), trackList(auds)]); }
914
916
  var subs = mi.subs || [], bl = S.ctx && S.ctx._relay && S.ctx._blank;
915
- if (bl) { subs = subs.filter(function (t, i) { return bl.indexOf(i) !== -1; }); } // (the others left out: "Plays" says how many)
917
+ if (bl) { subs = bl.map(function (i) { return subs[i]; }).filter(Boolean); } // (the others left out: "Plays" says how many; in the order the service put them in)
916
918
  if (subs.length) { lines.push([U.t('Subtitle tracks'), trackList(subs)]); }
917
919
  }
918
920
  // How it reaches the player (no link): straight from its server, or through StremioK's service.
package/js/player-core.js CHANGED
@@ -325,7 +325,12 @@ var PlayerParts = {};
325
325
  function renderOSD() {
326
326
  U.byId('osd-title').textContent = S.ctx ? S.ctx.name : '';
327
327
  var ck = U.byId('osd-clock'); // (the time of day, top right while the bar is on screen)
328
- if (ck) { ck.textContent = clock(Date.now() / 1000); }
328
+ if (ck) {
329
+ ck.textContent = clock(Date.now() / 1000);
330
+ // (under it, when what plays has a length: when it ends, at this pace — later while paused)
331
+ var left = !S.isLive && S.dur > 0 ? S.dur - S.cur : 0;
332
+ if (left > 30) { ck.appendChild(U.el('div', 'osd-ends', U.t('Ends {time}', { time: clock(Date.now() / 1000 + left) }))); }
333
+ }
329
334
  renderTags();
330
335
  renderChapters();
331
336
  if (S.isLive) {
@@ -461,11 +466,13 @@ var PlayerParts = {};
461
466
  var known = _miSeen.get(job.key);
462
467
  if (known) { fileInfoIn(ctx, known); return; }
463
468
  var look = _miLook = U.cancelToken();
469
+ // (meanwhile a built-in subtitle pick waits for it when the TV states no language: P.miPending)
470
+ function over() { if (_miLook === look) { _miLook = null; } if (P.subsMiIn && S.ctx === ctx && S.active) { P.subsMiIn(); } }
464
471
  job.ask(look).then(function (mi) {
465
- if (look.cancelled || !mi || typeof mi !== 'object' || !mi.container) { return; }
466
- _miSeen.set(job.key, mi);
467
- if (S.ctx === ctx && S.active) { fileInfoIn(ctx, mi); }
468
- }, function (e) { if (!look.cancelled) { U.log('player', 'The file\'s details couldn\'t be read: ' + ((e && e.message) || 'unknown')); } });
472
+ if (look.cancelled) { return; }
473
+ if (mi && typeof mi === 'object' && mi.container) { _miSeen.set(job.key, mi); if (S.ctx === ctx && S.active) { S.mi = mi; fileInfoIn(ctx, mi); } }
474
+ over();
475
+ }, function (e) { if (!look.cancelled) { U.log('player', 'The file\'s details couldn\'t be read: ' + ((e && e.message) || 'unknown')); over(); } });
469
476
  }
470
477
  // The answer in: S.mi, and the source's details corrected by it (Stremio.withFileInfo): what
471
478
  // the player shows (its tags, Stream info) and what Formats learns from it are the file's.
@@ -482,6 +489,7 @@ var PlayerParts = {};
482
489
  var what = P.fileSummary(S.mi);
483
490
  return what ? U.t('This TV didn’t play this file: {what}', { what: what }) : why;
484
491
  }
492
+ P.miPending = function () { return !!_miLook && !_miLook.cancelled && !S.mi; };
485
493
  P.fileInfoFor = function (ctx) { var j = fileInfoAsk(ctx); return j ? _miSeen.get(j.key) || null : null; };
486
494
 
487
495
  function play(ctx, onExit) {
@@ -1313,8 +1321,15 @@ var PlayerParts = {};
1313
1321
  function blankKeep(ctx, mi) {
1314
1322
  var cfg = P.getSubCfg(), mine = P.recallSub ? P.recallSub(ctx.id) : null;
1315
1323
  var keys = [mine && mine.lang, cfg.lang, cfg.lang2].filter(function (l) { return l && l !== 'off' && l !== 'none'; }).map(P.langKey);
1316
- var keep = [];
1317
- (mi.subs || []).forEach(function (t, i) { if (keep.length < BLANK_KEEP && keys.some(function (k) { return P.langMatches(k, t.lang || ''); })) { keep.push(i); } });
1324
+ // (in the order wanted: the service puts them first in that order, so the TV's first text
1325
+ // track is yours. A language's: plain, then SDH, then forced, then pictures)
1326
+ var keep = [], subs = mi.subs || [];
1327
+ var rank = function (t) { return t.text === false ? 3 : t.forced ? 2 : t.hi ? 1 : 0; };
1328
+ keys.forEach(function (k) {
1329
+ subs.map(function (t, i) { return i; }).filter(function (i) { return keep.indexOf(i) === -1 && P.langMatches(k, subs[i].lang || ''); })
1330
+ .sort(function (a, b) { return rank(subs[a]) - rank(subs[b]) || a - b; })
1331
+ .forEach(function (i) { if (keep.length < BLANK_KEEP) { keep.push(i); } });
1332
+ });
1318
1333
  return keep;
1319
1334
  }
1320
1335
  function blankFits(ctx, mi) {
@@ -1326,7 +1341,18 @@ var PlayerParts = {};
1326
1341
  if (blankKeep(ctx, mi).length >= mi.subs.length) { return false; } // (every one kept: nothing to leave out)
1327
1342
  return typeof YTPlay !== 'undefined' && !!YTPlay.fileOpen && YTPlay.installMode() !== 'browser';
1328
1343
  }
1329
- function setBlank(ctx, mi) { ctx._blank = blankKeep(ctx, mi); ctx._blankOf = mi.subs.length; }
1344
+ // The audio tracks in the order wanted (a choice made for the title, your language, your second
1345
+ // choice; commentaries last): the service puts them so, the first is the one the TV starts on.
1346
+ function audioOrder(ctx, mi) {
1347
+ var cfg = P.getAudioCfg ? P.getAudioCfg() : {}, mine = P.recallAudio ? P.recallAudio(ctx.id) : null, aud = mi.audio || [];
1348
+ var keys = [mine && mine.lang, cfg.lang, cfg.lang2].filter(function (l) { return l && l !== 'default' && l !== 'none'; }).map(P.langKey);
1349
+ var out = [];
1350
+ keys.forEach(function (k) {
1351
+ aud.forEach(function (t, i) { if (out.indexOf(i) === -1 && !t.commentary && P.langMatches(k, t.lang || '')) { out.push(i); } });
1352
+ });
1353
+ return out;
1354
+ }
1355
+ function setBlank(ctx, mi) { ctx._blank = blankKeep(ctx, mi); ctx._blankOf = mi.subs.length; ctx._audioOrder = audioOrder(ctx, mi); }
1330
1356
  // Always / More than 5: an MKV's tracks read before it starts (when not known yet); then(): on.
1331
1357
  function blankBefore(ctx, then) {
1332
1358
  var mode = P.playerCfg().blank;
@@ -1660,7 +1686,7 @@ var PlayerParts = {};
1660
1686
  if (S.ctx !== ctx || !S.active) { return; }
1661
1687
  if (useAV) { startLive(ctx, settle); } else { startHTML5(ctx._relay && ctx._relayFor === ctx.url ? ctx._relay : ctx.url); }
1662
1688
  }
1663
- YTPlay.fileOpen(ctx.url, U.sanitizeHeaders(ctx._headers), lan, ctx._blank || null).then(function (r) {
1689
+ YTPlay.fileOpen(ctx.url, U.sanitizeHeaders(ctx._headers), lan, ctx._blank || null, ctx._blank ? ctx._audioOrder : null).then(function (r) {
1664
1690
  if (S.ctx === ctx && S.active && relayed(ctx, r, null, false)) {
1665
1691
  U.log('player', ctx._blank ? 'Through StremioK\'s service: ' + ctx._blankOf + ' subtitle tracks, ' + ctx._blank.length + ' kept, the others left out (jumps stay clean; ' + where(ctx.url) + ')' : 'Through StremioK\'s service, with the source\'s headers (' + where(ctx.url) + ')');
1666
1692
  }
package/js/player-lang.js CHANGED
@@ -34,7 +34,7 @@
34
34
  fre: ['fre', 'fra', 'fr', 'french', 'français', 'francais'],
35
35
  ger: ['ger', 'deu', 'de', 'german', 'deutsch'],
36
36
  ita: ['ita', 'it', 'italian', 'italiano'],
37
- por: ['por', 'pob', 'pom', 'pt', 'portuguese', 'português', 'portugues'],
37
+ por: ['por', 'pob', 'pom', 'pt', 'po', 'portuguese', 'português', 'portugues'], // ("po": the 2017 TV's)
38
38
  dut: ['dut', 'nld', 'nl', 'dutch', 'nederlands'],
39
39
  rus: ['rus', 'ru', 'russian'],
40
40
  ara: ['ara', 'ar', 'arabic'],
@@ -221,7 +221,9 @@
221
221
  var list = P.S.mi && P.S.mi[kind];
222
222
  if (!list || !tracks || !list.length || !tracks.length) { return null; }
223
223
  var bl = kind === 'subs' && P.S.ctx && P.S.ctx._relay && P.S.ctx._blank; // (the others blanked by the service: the kept ones, in order)
224
- if (bl) { list = list.filter(function (t, i) { return bl.indexOf(i) !== -1; }); }
224
+ if (bl) { list = bl.map(function (i) { return list[i]; }).filter(Boolean); } // (in the order the service put them in)
225
+ var ao = kind === 'audio' && P.S.ctx && P.S.ctx._relay && P.S.ctx._blank && P.S.ctx._audioOrder; // (the audio reordered by the service too: yours first)
226
+ if (ao && ao.length) { var all = list; list = ao.map(function (i) { return all[i]; }).filter(Boolean).concat(all.filter(function (t, i) { return ao.indexOf(i) === -1; })); }
225
227
  var got = byPosition(list, tracks);
226
228
  if (!got && list.length > tracks.length) {
227
229
  got = byPosition(list.filter(function (t) { return t.text !== false; }), tracks) || inOrder(list, tracks) || firstOnes(list, tracks);
package/js/player-subs.js CHANGED
@@ -90,8 +90,13 @@
90
90
  ? LocalMedia.ensure().then(function () { return LocalMedia.ready(); }).then(function () { return LocalMedia.subsForTitle(ctx.type, ctx.id); }).then(null, function () { return []; })
91
91
  : Promise.resolve([]);
92
92
  if (localSubs.length) { localReady.then(function () { early = pickSubs(localSubs, true); }); }
93
+ // (your default language built into the file: on as soon as it plays, not after the addons)
94
+ var cfg0 = getSubCfg();
95
+ if (!recallSub(ctx.id) && cfg0.lang && cfg0.lang !== 'off' && P.useAV) { wantEmbedded({ lang: cfg0.lang, early: true }); }
93
96
  Promise.all([fromAddons, fromYouTube, localReady, usbSubs]).then(function (r) {
94
- var all = localSubs.concat(ctx.sourceSubs || [], r[0] || [], r[1], r[3] || []); // (a source's own: made for its file, so first after a USB file's)
97
+ // (in the order they're picked in: a source's own, made for its file, then the addons' in
98
+ // their order, then a USB drive's, then YouTube's; built-in tracks before all: applyEmbeddedWant)
99
+ var all = (ctx.sourceSubs || []).concat(r[0] || [], localSubs, r[3] || [], r[1] || []);
95
100
  if (!S.active || S.ctx !== ctx) { return; } // (another playback started meanwhile: not its tracks)
96
101
  if (early || _subOn || _embSub != null) { _subTracks = all; updateHint(); startSecond(); return; }
97
102
  pickSubs(all, false);
@@ -128,16 +133,13 @@
128
133
  if (partial) { return false; }
129
134
  }
130
135
 
131
- // 2) Otherwise the default language: an addon track, else one built into the file;
132
- // then the second choice, the same way (see applyEmbeddedWant: once the file's own
133
- // tracks are known, so the default language built into it comes first).
136
+ // 2) Otherwise your default language: built into the file, else an addon's (in their
137
+ // order), a USB drive's, YouTube's; then the second choice, the same way. Decided in
138
+ // applyEmbeddedWant, once the file's own tracks are known (all the files in by then).
134
139
  var cfg = getSubCfg();
135
140
  if (!cfg.lang || cfg.lang === 'off') { return !partial; }
136
- // "spa" also matches "es", "es-419", "Spanish", "Español"...
137
- var match = _subTracks.find(function (t) { return langMatches(cfg.lang, t.lang); });
138
- if (match) { loadTrack(match); return true; }
139
141
  if (partial) { return false; }
140
- wantEmbedded({ lang: cfg.lang, lang2: (cfg.lang2 && cfg.lang2 !== 'none' && cfg.lang2 !== cfg.lang) ? cfg.lang2 : null });
142
+ wantEmbedded({ lang: cfg.lang, lang2: (cfg.lang2 && cfg.lang2 !== 'none' && cfg.lang2 !== cfg.lang) ? cfg.lang2 : null, auto: true });
141
143
  return true;
142
144
  }
143
145
  }
@@ -178,17 +180,39 @@
178
180
  // screen; picking it again by hand works). So it's picked once more when playback has run
179
181
  // a moment: through another text track first (or off and on, with only one), since picking
180
182
  // the track the TV already reports is ignored.
181
- var EMB_NUDGE_MS = 2500, _embNudge = null;
183
+ // The way back after a moment (EMB_NUDGE_GAP_MS: the 2017 TV ignores two switches in a row,
184
+ // as with audio; its lines meanwhile not shown), then a look at what the TV reports a few
185
+ // seconds on (EMB_CHECK_MS): not the track picked, picked once more.
186
+ var EMB_NUDGE_MS = 2500, EMB_NUDGE_GAP_MS = 1000, EMB_CHECK_MS = 4000, _embNudge = null, _embQuiet = 0;
187
+ function selectText(index) {
188
+ try { avplay.setSelectTrack('TEXT', index); }
189
+ catch (e) { try { avplay.setSelectTrack('TEXT', '' + index); } catch (e2) {} }
190
+ }
191
+ function textNow() { // the text track the TV reports playing, or null
192
+ try { var l = avplay.getCurrentStreamInfo() || []; for (var i = 0; i < l.length; i++) { if (('' + l[i].type).toUpperCase() === 'TEXT') { return '' + l[i].index; } } } catch (e) {}
193
+ return null;
194
+ }
182
195
  function nudgeEmbedded() {
183
196
  var n = _embNudge; _embNudge = null;
184
197
  if (!n || _subOn || _embSub !== n.index) { return; } // (another choice meanwhile)
185
198
  var other = getTextTracks().filter(function (t) { return t.index !== n.index; })[0];
186
- if (other) { try { avplay.setSelectTrack('TEXT', other.index); } catch (e1) {} }
199
+ _embQuiet = Date.now() + EMB_NUDGE_GAP_MS + 500;
200
+ if (other) { selectText(other.index); }
187
201
  else { try { avplay.setSilentSubtitle(true); } catch (e2) {} }
188
- try { avplay.setSilentSubtitle(false); } catch (e3) {}
189
- try { avplay.setSelectTrack('TEXT', n.index); }
190
- catch (e4) { try { avplay.setSelectTrack('TEXT', '' + n.index); } catch (e5) {} }
202
+ setTimeout(function () {
203
+ if (_subOn || _embSub !== n.index || !S.active) { return; }
204
+ try { avplay.setSilentSubtitle(false); } catch (e3) {}
205
+ selectText(n.index);
206
+ setTimeout(function () {
207
+ if (_subOn || _embSub !== n.index || !S.active) { return; }
208
+ var now = textNow();
209
+ if (now !== null && now !== '' + n.index) { U.log('player', 'Built-in subtitle: the TV played track ' + now + ', not ' + n.index + ': picked again'); selectText(n.index); }
210
+ }, EMB_CHECK_MS);
211
+ }, EMB_NUDGE_GAP_MS);
191
212
  }
213
+ // An audio switch: the 2017 TV goes back to its first text track meanwhile (the one picked
214
+ // still ticked; a pause and play brings it back): picked once more, the same way, a moment on.
215
+ P.subsAfterAudio = function () { if (_embSub != null && !_subOn) { _embNudge = { index: _embSub, at: Date.now() + EMB_NUDGE_MS }; } };
192
216
  // Stream info's "Subtitles" line.
193
217
  function subtitleSummary() {
194
218
  return _subOn ? (_subLabel + (_subDelay ? ' (' + fmtDelay(_subDelay) + ')' : '')) : (_embSub != null ? (_embLang || U.t('on')) + ' ' + U.t('(built-in)') : U.t('Off'));
@@ -684,7 +708,12 @@
684
708
  return own && own.lang ? own.lang : l;
685
709
  }
686
710
 
687
- function wantEmbedded(w) { _embWant = w; if (_ticked) { applyEmbeddedWant(); } }
711
+ // (applied once playback runs and the TV lists its tracks; at once when there can be none to
712
+ // wait for: no TV player, a YouTube video, a file whose details list no subtitle track)
713
+ function noBuiltIn() { return !P.useAV || !!(S.ctx && S.ctx.yt) || !!(S.mi && S.mi.container && !(S.mi.subs || []).length); }
714
+ function wantEmbedded(w) { _embWant = w; if (_ticked || noBuiltIn()) { applyEmbeddedWant(); } }
715
+ // The file's details in (or not to be had): a pick that waited for them, now.
716
+ P.subsMiIn = function () { if (_embWant && _ticked) { try { applyEmbeddedWant(); } catch (e) {} } };
688
717
  function applyEmbeddedWant() {
689
718
  var w = _embWant; _embWant = null;
690
719
  if (!w || _subOn) { return; } // an addon track was chosen meanwhile
@@ -703,12 +732,19 @@
703
732
  pick = tracks.find(function (t) { return t.index === w.index && (!key || langKey(textLang(t)) === key); }) || null;
704
733
  }
705
734
  if (!pick && key) { pick = best(function (t) { return langMatches(key, textLang(t)); }); }
735
+ // (no language from the TV, the file's details still being read: picked once they're in,
736
+ // subsMiIn, so your language built into the file isn't passed over)
737
+ if (!pick && P.miPending && P.miPending() && tracks.length && tracks.every(function (t) { return P.langUnstated(trackLang(t)); })) { _embWant = w; return; }
738
+ if (!pick && w.early) { return; } // (only a built-in one, early: the rest once the files are in)
739
+ // (your default language not built in: a subtitle file in it, in the list's order)
740
+ var file = !pick && key && w.auto ? _subTracks.find(function (t) { return langMatches(key, t.lang); }) : null;
741
+ if (file) { loadTrack(file); return; }
706
742
  if (!pick && w.nth != null && S.ctx && S.ctx._relayCc) { pick = tracks[w.nth] || null; } // (a live channel's closed captions: in the order asked for)
707
- if (!pick && w.lang2) { // nothing in the default language anywhere: the second choice, a track to download first
743
+ if (!pick && w.lang2) { // nothing in the default language anywhere: the second choice, the same way
708
744
  var key2 = langKey(w.lang2);
709
- var dl = _subTracks.find(function (t) { return langMatches(key2, t.lang); });
710
- if (dl) { loadTrack(dl); return; }
711
745
  pick = best(function (t) { return langMatches(key2, textLang(t)); });
746
+ var dl = pick ? null : _subTracks.find(function (t) { return langMatches(key2, t.lang); });
747
+ if (dl) { loadTrack(dl); return; }
712
748
  }
713
749
  if (pick) { selectEmbeddedSub(pick); _embNudge = { index: pick.index, at: Date.now() + EMB_NUDGE_MS }; }
714
750
  }
@@ -744,7 +780,7 @@
744
780
  };
745
781
  }
746
782
  function showEmbeddedText(text, duration) {
747
- if (_embSub == null || _subOn) { return; }
783
+ if (_embSub == null || _subOn || Date.now() < _embQuiet) { return; } // (the other track's, while nudging)
748
784
  text = skipper()('' + (text || ''));
749
785
  if (!text) { return; }
750
786
  if (_embDelay > 0) {
package/js/ytplay.js CHANGED
@@ -114,10 +114,10 @@ var YTPlay = (function () {
114
114
  // (Settings › Content › Addons › Local-network links from internet addons).
115
115
  // keep: an MKV's subtitle tracks to keep, by their place among its subtitle tracks; the others
116
116
  // are blanked (the service's mkvBlanker); none: the file as it is.
117
- function fileOpen(url, h, lan, keep) {
117
+ function fileOpen(url, h, lan, keep, audio) {
118
118
  if (MODE === 'browser') { return Promise.reject(new Error('no service')); }
119
119
  return ensureService().then(entryAuth).then(function (a) {
120
- return U.getJSON(PROXY + '/live/file?u=' + encodeURIComponent(url) + headerQuery(h) + (lan ? '&lan=1' : '') + (keep ? '&blank=1&keep=' + keep.join(',') : '') + a.q, 5000, 65536, null, a.h);
120
+ return U.getJSON(PROXY + '/live/file?u=' + encodeURIComponent(url) + headerQuery(h) + (lan ? '&lan=1' : '') + (keep ? '&blank=1&keep=' + keep.join(',') + (audio && audio.length ? '&audio=' + audio.join(',') : '') : '') + a.q, 5000, 65536, null, a.h);
121
121
  });
122
122
  }
123
123
  // What's in a source's file, from its header (the service's /live/mi: its container, codecs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stremiok",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "description": "StremioK streaming client for Tizen 3.0+ Samsung TVs (TizenBrew app module).",
5
5
  "packageType": "app",
6
6
  "appName": "StremioK",
package/service/index.js CHANGED
@@ -3325,7 +3325,7 @@ function plugControl(res, query, text, leaving) {
3325
3325
  // headers and its byte range (seeking works), the answer streamed back as it comes, nothing kept.
3326
3326
  // Shares the relays' count (LIVE_MAX); dropped after LIVE_FILM_IDLE_MS unused. Redirects: the
3327
3327
  // downloads' host rule (never the TV itself), and into the home network only when allowed (lan).
3328
- function liveFileSession(u, who, lan, keep) {
3328
+ function liveFileSession(u, who, lan, keep, audio) {
3329
3329
  var ids = Object.keys(_live);
3330
3330
  if (ids.length >= LIVE_MAX) {
3331
3331
  ids.sort(function (x, y) { return _live[x].last - _live[y].last; });
@@ -3333,7 +3333,7 @@ function liveFileSession(u, who, lan, keep) {
3333
3333
  delete _live[ids[0]];
3334
3334
  }
3335
3335
  var s = { id: crypto.randomBytes(16).toString('hex'), file: u, ua: who.ua, ref: who.ref, cookie: who.cookie || '', origin: who.origin || '', accept: who.accept || '', lang: who.lang || '',
3336
- lan: !!lan, film: true, links: {}, last: Date.now(), keep: keep || null };
3336
+ lan: !!lan, film: true, links: {}, last: Date.now(), keep: keep || null, audio: audio || [] };
3337
3337
  _live[s.id] = s;
3338
3338
  return s;
3339
3339
  }
@@ -3381,17 +3381,44 @@ function blankPlan(s, cb) {
3381
3381
  o = d + z;
3382
3382
  }
3383
3383
  }
3384
+ // The track list: the others' entries made Void, and the kept subtitle tracks put in the
3385
+ // order asked for (keep: your languages first), right after the video and audio, so the TV's
3386
+ // first text track is the one wanted (the 2017 TV goes back to its first one now and then).
3387
+ // The same entries in another order: the list is as long as it was, nothing after it moves.
3384
3388
  function tracks(b, abs) { // abs: where b[0] is in the file
3385
- var subs = 0;
3389
+ var subs = 0, auds = 0, parts = [], odd = false;
3386
3390
  children(b, 0, b.length, function (id, st, d, z) {
3387
- if (id !== 0xAE) { return; }
3391
+ var piece = { st: st, end: d + z, sub: -1 };
3392
+ parts.push(piece);
3393
+ if (id !== 0xAE) { if (id !== EBML_VOID) { odd = true; } return; } // (a CRC or anything else: not reordered)
3388
3394
  var no = 0, type = 0;
3389
3395
  children(b, d, d + z, function (cid, cst, cd, cz) { if (cid === 0xD7) { no = ebmlUint(b, cd, cz); } else if (cid === 0x83) { type = ebmlUint(b, cd, cz); } });
3396
+ if (type === 2) { piece.aud = auds++; return; }
3390
3397
  if (type !== 17 || !no) { return; }
3391
- if (!keep[subs]) { plan.blank[no] = 1; plan.patches.push(abs + st); plan.blanked++; }
3398
+ piece.sub = subs;
3399
+ if (!keep[subs]) { plan.blank[no] = 1; piece.blank = true; plan.blanked++; }
3392
3400
  subs++;
3393
3401
  });
3394
3402
  plan.subs = subs;
3403
+ var whole = parts.length && parts[0].st === 0 && parts[parts.length - 1].end === b.length;
3404
+ if (odd || !whole) { // (as it is, only the others' IDs made Void)
3405
+ parts.forEach(function (p) { if (p.blank) { plan.patches.push(abs + p.st); } });
3406
+ return;
3407
+ }
3408
+ // (video first as it was; the audio tracks in the order asked for (your language first: no
3409
+ // switch to make), the rest after; the kept subtitle tracks; the others)
3410
+ var order = parts.filter(function (p) { return p.sub < 0 && p.aud === undefined; });
3411
+ s.audio.forEach(function (k) { parts.forEach(function (p) { if (p.aud === k && order.indexOf(p) === -1) { order.push(p); } }); });
3412
+ parts.forEach(function (p) { if (p.aud !== undefined && order.indexOf(p) === -1) { order.push(p); } });
3413
+ (s.keep || []).forEach(function (k) { parts.forEach(function (p) { if (p.sub === k && !p.blank && order.indexOf(p) === -1) { order.push(p); } }); });
3414
+ parts.forEach(function (p) { if (order.indexOf(p) === -1) { order.push(p); } });
3415
+ var out = allocBuffer(b.length), at = 0;
3416
+ order.forEach(function (p) {
3417
+ b.copy(out, at, p.st, p.end);
3418
+ if (p.blank) { out[at] = EBML_VOID; }
3419
+ at += p.end - p.st;
3420
+ });
3421
+ if (Buffer.compare(out, b) !== 0) { plan.rewrite = { at: abs, bytes: out }; }
3395
3422
  }
3396
3423
  function cues(b, abs) {
3397
3424
  children(b, 0, b.length, function (id, st, d, z) {
@@ -3446,7 +3473,7 @@ function blankPlan(s, cb) {
3446
3473
  function finish() {
3447
3474
  if (plan.firstCluster < 0) { done(null, null); return; }
3448
3475
  if (!seek.gotTracks && seek.tracks >= 0) { var t = seek.tracks; seek.tracks = -1; element(plan.segData + t, function () { finish(); }); return; }
3449
- if (!seek.gotTracks || !plan.blanked) { done(null, null); return; }
3476
+ if (!seek.gotTracks || (!plan.blanked && !plan.rewrite)) { done(null, null); return; }
3450
3477
  if (!seek.gotCues && seek.cues >= 0) { var c = seek.cues; seek.cues = -1; element(plan.segData + c, function () { finish(); }); return; }
3451
3478
  var ends = [seek.cues >= 0 ? plan.segData + seek.cues : Infinity];
3452
3479
  if (seek.after !== undefined) { ends.push(plan.segData + seek.after); }
@@ -3476,10 +3503,15 @@ function mkvBlanker(plan, start) {
3476
3503
  else if (start >= plan.clustersEnd || plan.clusters.indexOf(start) === -1) { mode = 'skip'; skipTo = Infinity; afterSkip = ''; }
3477
3504
  else { mode = 'seg'; }
3478
3505
  var out = [];
3506
+ var rw = plan.rewrite || null;
3479
3507
  function emit(n) {
3480
3508
  if (n <= 0) { return; }
3481
3509
  var piece = pend.slice(0, n);
3482
3510
  while (pi < plan.patches.length && plan.patches[pi] < base + n) { piece[plan.patches[pi] - base] = EBML_VOID; pi++; }
3511
+ if (rw && base < rw.at + rw.bytes.length && base + n > rw.at) { // (the track list, reordered)
3512
+ var from = Math.max(base, rw.at), to = Math.min(base + n, rw.at + rw.bytes.length);
3513
+ rw.bytes.copy(piece, from - base, from - rw.at, to - rw.at);
3514
+ }
3483
3515
  out.push(piece);
3484
3516
  pend = pend.slice(n); base += n;
3485
3517
  }
@@ -3696,7 +3728,8 @@ function liveControl(req, res, path, query, leaving) {
3696
3728
  var fu = q.u || '';
3697
3729
  if (!/^https?:\/\/[^\s]+$/i.test(fu) || fu.length > 2000) { send(res, 400, 'text/plain', 'bad link'); return; }
3698
3730
  var keep = q.blank === '1' ? String(q.keep || '').split(',').filter(function (k) { return /^\d{1,3}$/.test(k); }).map(Number).slice(0, 16) : null;
3699
- var fsn = liveFileSession(fu, liveWho(q), q.lan === '1', keep);
3731
+ var aorder = q.blank === '1' ? String(q.audio || '').split(',').filter(function (k) { return /^\d{1,3}$/.test(k); }).map(Number).slice(0, 16) : [];
3732
+ var fsn = liveFileSession(fu, liveWho(q), q.lan === '1', keep, aorder);
3700
3733
  send(res, 200, 'application/json', JSON.stringify({ url: liveBase(fsn) + 'f' }));
3701
3734
  return;
3702
3735
  }
package/tizenbrew.html CHANGED
@@ -10,7 +10,7 @@
10
10
  // from there: it opens this version's own copy (npm/stremiok@<version>/index.html), whose
11
11
  // files all come from that address. build.sh stamps the ?v= below.
12
12
  (function () {
13
- var v = '?v=2.4.2'.slice(3), l = location, rest = (l.search || '') + (l.hash || '');
13
+ var v = '?v=2.4.3'.slice(3), l = location, rest = (l.search || '') + (l.hash || '');
14
14
  var m = /^(\/module\/npm%2F[^\/%@]+)\//i.exec(l.pathname || '');
15
15
  l.replace(m ? m[1] + '%40' + v + '/index.html' + rest : 'index.html' + rest);
16
16
  })();