From 5b1877d57e17772764090892026f58c76bfd220b Mon Sep 17 00:00:00 2001 From: tsukumi Date: Fri, 10 Nov 2023 11:08:40 +0000 Subject: [PATCH] =?UTF-8?q?Add:=20[Client][Settings/Caption]=20=E3=83=93?= =?UTF-8?q?=E3=83=87=E3=82=AA=E3=82=92=E3=81=BF=E3=82=8B=E3=81=A8=E3=81=8D?= =?UTF-8?q?=E3=81=AB=E6=96=87=E5=AD=97=E3=82=B9=E3=83=BC=E3=83=91=E3=83=BC?= =?UTF-8?q?=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E3=81=8B=E3=82=92?= =?UTF-8?q?=E5=88=87=E3=82=8A=E6=9B=BF=E3=81=88=E3=82=8B=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/services/Settings.ts | 1 + client/src/services/player/PlayerController.ts | 12 ++++++++---- client/src/stores/SettingsStore.ts | 4 ++++ client/src/views/Settings/Caption.vue | 9 +++++++++ client/src/views/Settings/General.vue | 6 +++--- server/app/config.py | 1 + 6 files changed, 26 insertions(+), 7 deletions(-) diff --git a/client/src/services/Settings.ts b/client/src/services/Settings.ts index 2f4d21db..8bff2792 100644 --- a/client/src/services/Settings.ts +++ b/client/src/services/Settings.ts @@ -27,6 +27,7 @@ export interface IClientSettings { specify_caption_opacity: boolean; caption_opacity: number; tv_show_superimpose: boolean; + video_show_superimpose: boolean; // tv_show_data_broadcasting: 同期無効 // capture_copy_to_clipboard: 同期無効 capture_save_mode: 'Browser' | 'UploadServer' | 'Both'; diff --git a/client/src/services/player/PlayerController.ts b/client/src/services/player/PlayerController.ts index 29ae7955..5f5e49e7 100644 --- a/client/src/services/player/PlayerController.ts +++ b/client/src/services/player/PlayerController.ts @@ -136,7 +136,6 @@ class PlayerController { const channels_store = useChannelsStore(); const player_store = usePlayerStore(); const settings_store = useSettingsStore(); - console.log('\u001b[31m[PlayerController] Initializing...'); // 破棄済みかどうかのフラグを下ろす @@ -152,6 +151,11 @@ class PlayerController { // こうしないと DPlayer が mpegts.js を認識できない (window as any).mpegts = mpegts; + // 文字スーパーの表示設定 + // ライブ視聴とビデオ視聴で設定キーが異なる + const is_show_superimpose = this.playback_mode === 'Live' ? + settings_store.settings.tv_show_superimpose : settings_store.settings.video_show_superimpose; + // DPlayer を初期化 this.player = new DPlayer({ // DPlayer を配置する要素 @@ -344,8 +348,8 @@ class PlayerController { }, // aribb24.js aribb24: { - // 文字スーパーを表示するかどうか - disableSuperimposeRenderer: settings_store.settings.tv_show_superimpose === false, + // 文字スーパーレンダラーを無効にするかどうか + disableSuperimposeRenderer: is_show_superimpose === false, // 描画フォント normalFont: `"${settings_store.settings.caption_font}", "Rounded M+ 1m for ARIB", sans-serif`, // 縁取りする色 @@ -383,7 +387,7 @@ class PlayerController { PRACallback: async (index: number) => { // 設定で文字スーパーが無効なら実行しない - if (settings_store.settings.tv_show_superimpose === false) return; + if (is_show_superimpose === false) return; // index に応じた内蔵音を鳴らす // ref: https://ics.media/entry/200427/ diff --git a/client/src/stores/SettingsStore.ts b/client/src/stores/SettingsStore.ts index 808308aa..cd736a6e 100644 --- a/client/src/stores/SettingsStore.ts +++ b/client/src/stores/SettingsStore.ts @@ -30,6 +30,7 @@ interface ILocalClientSettings { specify_caption_opacity: boolean; caption_opacity: number; tv_show_superimpose: boolean; + video_show_superimpose: boolean; tv_show_data_broadcasting: boolean; capture_copy_to_clipboard: boolean; capture_save_mode: 'Browser' | 'UploadServer' | 'Both'; @@ -77,6 +78,7 @@ const sync_settings_keys = [ 'specify_caption_opacity', 'caption_opacity', 'tv_show_superimpose', + 'video_show_superimpose', // tv_show_data_broadcasting: 同期無効 // capture_copy_to_clipboard: 同期無効 'capture_save_mode', @@ -153,6 +155,8 @@ const default_settings: ILocalClientSettings = { caption_opacity: 0.5, // テレビをみるときに文字スーパーを表示する (Default: 表示する) tv_show_superimpose: true, + // ビデオをみるときに文字スーパーを表示する (Default: 表示しない) + video_show_superimpose: false, // ***** 設定 → データ放送 ***** diff --git a/client/src/views/Settings/Caption.vue b/client/src/views/Settings/Caption.vue index 34007b5e..86d6b7fa 100644 --- a/client/src/views/Settings/Caption.vue +++ b/client/src/views/Settings/Caption.vue @@ -60,6 +60,15 @@ v-model="settingsStore.settings.tv_show_superimpose"> +
+ + + + +
diff --git a/client/src/views/Settings/General.vue b/client/src/views/Settings/General.vue index 3f0ac589..38dc8e86 100644 --- a/client/src/views/Settings/General.vue +++ b/client/src/views/Settings/General.vue @@ -21,12 +21,12 @@ ピン留め中チャンネルの並び替え設定を開く
- -
diff --git a/server/app/config.py b/server/app/config.py index a5e94ce6..53a31763 100644 --- a/server/app/config.py +++ b/server/app/config.py @@ -57,6 +57,7 @@ class ClientSettings(BaseModel): specify_caption_opacity: bool = Field(False) caption_opacity: float = Field(1.0) tv_show_superimpose: bool = Field(True) + video_show_superimpose: bool = Field(False) # tv_show_data_broadcasting: 同期無効 # capture_copy_to_clipboard: 同期無効 capture_save_mode: Literal['Browser', 'UploadServer', 'Both'] = Field('UploadServer')