@oxymoron.13/tizentube-s95b 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/S95B-CHANGES.txt +2 -2
- package/dist/userScript.js +1 -1
- package/mods/features/s95bI18n.js +10 -0
- package/mods/features/s95bMenu.js +34 -3
- package/mods/features/s95bVersion.js +2 -0
- package/package.json +2 -2
|
@@ -10,6 +10,11 @@ export const STRINGS = Object.freeze({
|
|
|
10
10
|
statVideo: 'Video', statFrames: 'Verlorene Bilder', statCodec: 'Codec-Wunsch',
|
|
11
11
|
statUnavailable: 'nicht verfügbar', statWait: 'wartet auf Video',
|
|
12
12
|
languageDE: 'Deutsch', languageEN: 'English',
|
|
13
|
+
exit: 'Beenden',
|
|
14
|
+
exitHintTizen: 'Beendet die App (TizenTube und TizenBrew, wie die Zurück-Taste in TizenBrew). TizenBrews Hintergrunddienst wird dabei nicht gestoppt.',
|
|
15
|
+
exitHintSignal: 'Die Tizen-Funktion zum Beenden ist hier nicht verfügbar; es wird YouTubes Beenden-Signal versucht (am TV ungeprüft). Sonst die Home-Taste der Fernbedienung benutzen.',
|
|
16
|
+
exitCancel: 'Abbrechen', exitNow: 'Ja, App beenden',
|
|
17
|
+
exitFailed: 'Beenden nicht möglich. Bitte die Home-Taste der Fernbedienung benutzen.',
|
|
13
18
|
mini: 'Mini-Player',
|
|
14
19
|
miniHint: 'TizenTubes Mini-Player (Eintrag „MiniPlayer“ im Video-Menü). Änderungen gelten beim nächsten Start des Mini-Players. Ein neu gestartetes Video öffnet im Vollbild und ersetzt den Mini-Player.',
|
|
15
20
|
miniOn: 'Mini-Player anbieten',
|
|
@@ -29,6 +34,11 @@ export const STRINGS = Object.freeze({
|
|
|
29
34
|
statVideo: 'Video', statFrames: 'Dropped frames', statCodec: 'Codec preference',
|
|
30
35
|
statUnavailable: 'not available', statWait: 'waiting for video',
|
|
31
36
|
languageDE: 'Deutsch', languageEN: 'English',
|
|
37
|
+
exit: 'Exit',
|
|
38
|
+
exitHintTizen: 'Closes the app (TizenTube and TizenBrew, like the Back key in TizenBrew). TizenBrew’s background service is not stopped.',
|
|
39
|
+
exitHintSignal: 'The Tizen exit function is not available here; YouTube’s exit signal is tried instead (untested on the TV). Otherwise use the remote’s Home key.',
|
|
40
|
+
exitCancel: 'Cancel', exitNow: 'Yes, exit the app',
|
|
41
|
+
exitFailed: 'Could not exit. Please use the remote’s Home key.',
|
|
32
42
|
mini: 'Mini player',
|
|
33
43
|
miniHint: 'TizenTube’s mini player (“MiniPlayer” row in the video menu). Changes apply the next time the mini player starts. A newly started video opens full screen and replaces the mini player.',
|
|
34
44
|
miniOn: 'Offer mini player',
|
|
@@ -5,12 +5,16 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { configRead, configWrite, configChangeEmitter } from '../config.js';
|
|
7
7
|
import { optionShow } from '../ui/settings.js';
|
|
8
|
+
import { showToast } from '../ui/ytUI.js';
|
|
9
|
+
import resolveCommand from '../resolveCommand.js';
|
|
10
|
+
import { S95B_VERSION_TAG } from './s95bVersion.js';
|
|
8
11
|
import { translate } from './s95bI18n.js';
|
|
9
12
|
import { codecMenu, qualityMenu, codecLabel, currentCodec } from './s95bOptions.js';
|
|
10
13
|
import { MINI_POSITIONS, MINI_SIZES, MINI_BROWSE } from './s95bMiniPlayer.js';
|
|
11
14
|
|
|
12
15
|
const STATE_KEY = 's95b-perf-edition-v1';
|
|
13
16
|
const EDITED = ['enablePreviews', 'enableDeArrow', 'enableDeArrowThumbnails'];
|
|
17
|
+
const VERSION = String(S95B_VERSION_TAG).split(':')[1] || '?';
|
|
14
18
|
const defaultState = { lang: 'de', light: false, previous: null };
|
|
15
19
|
let state = { ...defaultState };
|
|
16
20
|
|
|
@@ -103,6 +107,27 @@ function miniMenu() {
|
|
|
103
107
|
] };
|
|
104
108
|
}
|
|
105
109
|
|
|
110
|
+
// Exit: the same call TizenBrew's own Back key uses; YouTube's exit signal is the fallback.
|
|
111
|
+
function canExitViaTizen() {
|
|
112
|
+
try { return !!(window.tizen && window.tizen.application && typeof window.tizen.application.getCurrentApplication === 'function'); }
|
|
113
|
+
catch (_) { return false; }
|
|
114
|
+
}
|
|
115
|
+
function exitMenu() {
|
|
116
|
+
return { name: t('exit'), value: null, menuId: 's95b-exit',
|
|
117
|
+
menuHeader: { title: t('exit'), subtitle: canExitViaTizen() ? t('exitHintTizen') : t('exitHintSignal') },
|
|
118
|
+
options: [
|
|
119
|
+
{ name: t('exitCancel'), key: 's95bExit', value: 'no' },
|
|
120
|
+
{ name: t('exitNow'), key: 's95bExit', value: 'now' }
|
|
121
|
+
] };
|
|
122
|
+
}
|
|
123
|
+
function exitApp() {
|
|
124
|
+
if (canExitViaTizen()) {
|
|
125
|
+
try { window.tizen.application.getCurrentApplication().exit(); return; } catch (_) { /* try the signal */ }
|
|
126
|
+
}
|
|
127
|
+
try { resolveCommand({ signalAction: { signal: 'EXIT_APP' } }); }
|
|
128
|
+
catch (e) { showToast('TizenTube', t('exitFailed')); }
|
|
129
|
+
}
|
|
130
|
+
|
|
106
131
|
function buildOptions() {
|
|
107
132
|
return [
|
|
108
133
|
{ name: t('language'), value: null, menuId: 's95b-language',
|
|
@@ -114,7 +139,8 @@ function buildOptions() {
|
|
|
114
139
|
codecMenu(t),
|
|
115
140
|
qualityMenu(t),
|
|
116
141
|
miniMenu(),
|
|
117
|
-
{ name: t('light'), subtitle: t('lightHint'), value: 's95bLowOverhead' }
|
|
142
|
+
{ name: t('light'), subtitle: t('lightHint'), value: 's95bLowOverhead' },
|
|
143
|
+
exitMenu()
|
|
118
144
|
];
|
|
119
145
|
}
|
|
120
146
|
|
|
@@ -122,7 +148,7 @@ function openMenu() {
|
|
|
122
148
|
try {
|
|
123
149
|
optionShow({
|
|
124
150
|
menuId: 's95b-menu',
|
|
125
|
-
menuHeader: { title: t('title'), subtitle: statsLine() },
|
|
151
|
+
menuHeader: { title: t('title') + ' v' + VERSION, subtitle: statsLine() },
|
|
126
152
|
selectedIndex: 0,
|
|
127
153
|
options: buildOptions()
|
|
128
154
|
}, false);
|
|
@@ -143,13 +169,18 @@ function onConfigChange(event) {
|
|
|
143
169
|
const detail = event && event.detail;
|
|
144
170
|
if (!detail) return;
|
|
145
171
|
if (detail.key === 's95bLowOverhead') turnLight(detail.value === true);
|
|
146
|
-
else if (detail.key === '
|
|
172
|
+
else if (detail.key === 's95bExit') {
|
|
173
|
+
if (detail.value !== 'now') return;
|
|
174
|
+
configWrite('s95bExit', 'no'); // never leave "now" stored
|
|
175
|
+
exitApp();
|
|
176
|
+
} else if (detail.key === 's95bLanguage') { state.lang = detail.value === 'en' ? 'en' : 'de'; save(); }
|
|
147
177
|
}
|
|
148
178
|
|
|
149
179
|
function init() {
|
|
150
180
|
// Menu entries read their current value from the TizenTube config, so mirror our stored state into it first.
|
|
151
181
|
if (configRead('s95bLowOverhead') !== state.light) configWrite('s95bLowOverhead', state.light);
|
|
152
182
|
if (configRead('s95bLanguage') !== state.lang) configWrite('s95bLanguage', state.lang);
|
|
183
|
+
if (configRead('s95bExit') !== 'no') configWrite('s95bExit', 'no');
|
|
153
184
|
Object.keys(MINI_DEFAULTS).forEach(key => {
|
|
154
185
|
if (MINI_VALUES[key].indexOf(configRead(key)) < 0) configWrite(key, MINI_DEFAULTS[key]);
|
|
155
186
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxymoron.13/tizentube-s95b",
|
|
3
|
-
"appName": "TizenTube S95B
|
|
4
|
-
"version": "0.3.
|
|
3
|
+
"appName": "TizenTube S95B 0.3.2 (Fork)",
|
|
4
|
+
"version": "0.3.2",
|
|
5
5
|
"description": "Unofficial fork of TizenTube (@foxreis/tizentube) for TizenBrew: reversible performance profile, German/English settings, smaller bundle.",
|
|
6
6
|
"packageType": "mods",
|
|
7
7
|
"websiteURL": "https://youtube.com/tv?additionalDataUrl=http%3A%2F%2Flocalhost%3A8085%2Fdial%2Fapps%2FYouTube",
|