@oxymoron.13/tizentube-s95b 0.2.0 → 0.2.1

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.
@@ -47,7 +47,7 @@ JSON.parse = function () {
47
47
  }
48
48
 
49
49
  selectCodecFormats(r, configRead('preferredVideoCodec'));
50
- // Drop "masthead"
50
+
51
51
  // Drop "masthead" ad from home screen
52
52
  if (
53
53
  r?.contents?.tvBrowseRenderer?.content?.tvSurfaceContentRenderer?.content
@@ -1,29 +1,31 @@
1
1
  /* S95B Performance Edition – GPL-3.0-only */
2
2
  export const STRINGS = Object.freeze({
3
3
  de: Object.freeze({
4
- title: 'S95B · Performance', subtitle: 'TizenTube Performance Edition 0.2.0',
5
- language: 'Sprache', codec: 'Videocodec', automatic: 'Automatisch',
4
+ title: 'S95B · Performance', subtitle: 'TizenTube Performance Edition 0.2.1',
5
+ language: 'Sprache', codec: 'Videocodec', quality: 'Bevorzugte Qualität', automatic: 'Automatisch',
6
6
  light: 'Ressourcenschonender Modus', diag: 'Diagnoseanzeige',
7
7
  reset: 'Änderungen zurücksetzen', close: 'Schließen', on: 'Ein', off: 'Aus',
8
8
  hint: 'Gelbe Taste: Einstellungen · Pfeile: Navigieren · OK: Ändern · Zurück: Schließen',
9
- restart: 'Codec-Änderungen gelten ab dem nächsten Video. Eventuell ist ein Neustart nötig.',
9
+ restart: 'Codec-Änderungen gelten ab dem nächsten Video. Eine feste Qualität gilt sofort; „Automatisch“ wirkt eventuell erst nach einem Neustart von YouTube.',
10
10
  safe: 'Kein Eingriff in Firmware, Bildrate oder Decoder.',
11
11
  statVideo: 'Video', statFrames: 'Verlorene Bilder', statCodec: 'Codec-Wunsch',
12
12
  statUnavailable: 'Vom Web-Player nicht verfügbar', statWait: 'Warte auf Video',
13
+ codecHint: 'H.264 liefert bei YouTube in der Regel höchstens 1080p; 4K gibt es nur als VP9 oder AV1. Ein Codec wird nur erzwungen, wenn dadurch keine Qualität verloren geht.',
13
14
  lightHint: 'Schaltet Vorschauen und DeArrow ab; vorherige Werte werden gesichert.',
14
15
  restoreHint: 'Stellt nur die von diesem Menü geänderten Werte wieder her.',
15
16
  languageDE: 'Deutsch', languageEN: 'English',
16
17
  }),
17
18
  en: Object.freeze({
18
- title: 'S95B · Performance', subtitle: 'TizenTube Performance Edition 0.2.0',
19
- language: 'Language', codec: 'Video codec', automatic: 'Automatic',
19
+ title: 'S95B · Performance', subtitle: 'TizenTube Performance Edition 0.2.1',
20
+ language: 'Language', codec: 'Video codec', quality: 'Preferred quality', automatic: 'Automatic',
20
21
  light: 'Low-overhead mode', diag: 'Diagnostic overlay',
21
22
  reset: 'Restore changed settings', close: 'Close', on: 'On', off: 'Off',
22
23
  hint: 'Yellow button: settings · Arrows: navigate · OK: change · Back: close',
23
- restart: 'Codec changes take effect with the next video. A restart may be needed.',
24
+ restart: 'Codec changes apply from the next video. A fixed quality applies immediately; “Automatic” may only take effect after restarting YouTube.',
24
25
  safe: 'No firmware, display-rate or decoder changes.',
25
26
  statVideo: 'Video', statFrames: 'Dropped frames', statCodec: 'Codec preference',
26
27
  statUnavailable: 'Not available from web player', statWait: 'Waiting for video',
28
+ codecHint: 'On YouTube, H.264 usually tops out at 1080p; 4K is only available as VP9 or AV1. A codec is only forced if no quality is lost.',
27
29
  lightHint: 'Disables previews and DeArrow; original values are backed up.',
28
30
  restoreHint: 'Restores only values changed from this menu.',
29
31
  languageDE: 'Deutsch', languageEN: 'English',
@@ -8,7 +8,7 @@ import { translate } from './s95bI18n.js';
8
8
 
9
9
  const STATE_KEY = 's95b-perf-edition-v1';
10
10
  const EDITED = ['enablePreviews', 'enableDeArrow', 'enableDeArrowThumbnails'];
11
- const defaultState = { lang: 'de', light: false, diagnostics: false, previous: null, codecPrevious: null };
11
+ const defaultState = { lang: 'de', light: false, diagnostics: false, previous: null, codecPrevious: null, qualityPrevious: null };
12
12
  let state = { ...defaultState };
13
13
  let overlay = null;
14
14
  let diagnostic = null;
@@ -24,7 +24,8 @@ function readState() {
24
24
  lang: data.lang === 'en' ? 'en' : 'de', light: data.light === true,
25
25
  diagnostics: data.diagnostics === true,
26
26
  previous: data.previous && typeof data.previous === 'object' ? data.previous : null,
27
- codecPrevious: typeof data.codecPrevious === 'string' ? data.codecPrevious : null };
27
+ codecPrevious: typeof data.codecPrevious === 'string' ? data.codecPrevious : null,
28
+ qualityPrevious: typeof data.qualityPrevious === 'string' ? data.qualityPrevious : null };
28
29
  }
29
30
  } catch (_) { state = { ...defaultState }; }
30
31
  }
@@ -38,9 +39,24 @@ function currentCodec() {
38
39
  function codecLabel(value) {
39
40
  return value === 'any' ? translate(state.lang, 'automatic') : value === 'vp9' ? 'VP9' : value === 'av01' ? 'AV1' : 'H.264';
40
41
  }
42
+ const CODECS = ['any', 'vp9', 'av01', 'avc1'];
41
43
  function changeCodec() {
42
44
  if (state.codecPrevious === null) state.codecPrevious = String(configRead('preferredVideoCodec') || 'any');
43
- configWrite('preferredVideoCodec', currentCodec() === 'vp9' ? 'any' : 'vp9');
45
+ configWrite('preferredVideoCodec', CODECS[(CODECS.indexOf(currentCodec()) + 1) % CODECS.length]);
46
+ save();
47
+ }
48
+ // Uses TizenTube's own preferredVideoQuality setting and handler (same values as its settings menu).
49
+ const QUALITIES = ['auto', '2160p', '1440p', '1080p', '720p'];
50
+ function currentQuality() {
51
+ const value = String(configRead('preferredVideoQuality') || 'auto');
52
+ return QUALITIES.indexOf(value) >= 0 ? value : 'auto';
53
+ }
54
+ function qualityLabel(value) {
55
+ return value === 'auto' ? translate(state.lang, 'automatic') : value === '2160p' ? '2160p (4K)' : value;
56
+ }
57
+ function changeQuality() {
58
+ if (state.qualityPrevious === null) state.qualityPrevious = String(configRead('preferredVideoQuality') || 'auto');
59
+ configWrite('preferredVideoQuality', QUALITIES[(QUALITIES.indexOf(currentQuality()) + 1) % QUALITIES.length]);
44
60
  save();
45
61
  }
46
62
  function turnLight(enable) {
@@ -68,6 +84,10 @@ function reset() {
68
84
  configWrite('preferredVideoCodec', state.codecPrevious);
69
85
  state.codecPrevious = null;
70
86
  }
87
+ if (state.qualityPrevious !== null) {
88
+ configWrite('preferredVideoQuality', state.qualityPrevious);
89
+ state.qualityPrevious = null;
90
+ }
71
91
  state.diagnostics = false;
72
92
  stopDiagnostics();
73
93
  save();
@@ -92,6 +112,7 @@ function drawMenu() {
92
112
  const fields = [
93
113
  [t('language'), state.lang === 'de' ? t('languageDE') : t('languageEN'), () => { state.lang = state.lang === 'de' ? 'en' : 'de'; save(); }],
94
114
  [t('codec'), codecLabel(currentCodec()), changeCodec],
115
+ [t('quality'), qualityLabel(currentQuality()), changeQuality],
95
116
  [t('light'), state.light ? t('on') : t('off'), () => turnLight(!state.light)],
96
117
  [t('diag'), state.diagnostics ? t('on') : t('off'), () => { state.diagnostics = !state.diagnostics; save(); if (state.diagnostics) startDiagnostics(); else stopDiagnostics(); }],
97
118
  [t('reset'), '', reset],
@@ -104,6 +125,7 @@ function drawMenu() {
104
125
  card.appendChild(button);
105
126
  return button;
106
127
  });
128
+ card.append(create('p', { className: 's95b-explanation' }, t('codecHint')));
107
129
  card.append(create('p', { className: 's95b-explanation' }, t('lightHint')));
108
130
  card.append(create('p', { className: 's95b-note' }, t('restart')));
109
131
  card.append(create('p', { className: 's95b-note' }, t('restoreHint')));
@@ -172,9 +194,10 @@ function stopDiagnostics() {
172
194
  function onKeys(e) {
173
195
  const code = e.keyCode || e.which;
174
196
  const isKeydown = e.type === undefined || e.type === 'keydown';
175
- // Samsung ColorF2Yellow (405) or an optional external keyboard's F2.
197
+ // Samsung ColorF2Yellow: 405 per Tizen docs; 170 is the alternative code TizenTube
198
+ // documents for yellow (it handles 172/191 for green/blue the same way). F2 = keyboard.
176
199
  // Red (403), green (404) and blue (406) are already used by TizenTube itself.
177
- if (code === 405 || e.key === 'F2') {
200
+ if (code === 405 || code === 170 || e.key === 'ColorF2Yellow' || e.key === 'F2') {
178
201
  e.preventDefault(); e.stopImmediatePropagation();
179
202
  if (isKeydown) openMenu();
180
203
  return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oxymoron.13/tizentube-s95b",
3
3
  "appName": "TizenTube S95B Performance (Fork)",
4
- "version": "0.2.0",
4
+ "version": "0.2.1",
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",