Skip to content

Commit e1e67d2

Browse files
committed
Fix: [Client][Player/PlayerController] 「モバイル回線向け画質」スイッチをオンにした際にモバイル回線向けプロファイルのデフォルト画質に切り替わらず、プレイヤー再起動前の画質設定が維持されてしまう問題の修正を試みる
多分これで直るはず…!普段デフォルト画質を 1080p (60fps) に設定していたのでこの問題を偶然回避できており気づけなかった…
1 parent 3d36aee commit e1e67d2

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

client/src/services/player/PlayerController.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,9 +803,14 @@ class PlayerController {
803803

804804
// 現在の再生画質・再生速度・再生位置を取得
805805
// この情報がプレイヤー再起動後にレジュームされる
806-
const current_quality = this.player?.qualityIndex ? this.player.options.video.quality![this.player.qualityIndex] : null;
807-
const current_playback_rate = this.player?.video.playbackRate ?? null;
808-
const current_time = this.player?.video.currentTime ?? null;
806+
const should_resume_quality = event.should_resume_quality !== false;
807+
const quality_index = this.player.qualityIndex ?? null;
808+
// 画質プロファイルの既定値を優先する場合は直前の画質を引き継がない
809+
const current_quality = should_resume_quality === true && this.player.options.video.quality && typeof quality_index === 'number'
810+
? this.player.options.video.quality[quality_index]
811+
: null;
812+
const current_playback_rate = this.player.video.playbackRate ?? null;
813+
const current_time = this.player.video.currentTime ?? null;
809814

810815
// PlayerController 自身を破棄
811816
await this.destroy();
@@ -1585,6 +1590,8 @@ class PlayerController {
15851590
// 他の通知と被らないように、メッセージを遅らせて表示する
15861591
message_delay_seconds: this.quality_profile.tv_low_latency_mode || this.playback_mode === 'Video' ? 2 : 4.5,
15871592
is_error_message: false,
1593+
// モバイル回線プロファイル切り替え時、切り替え後の画質プロファイルのデフォルト画質を優先する
1594+
should_resume_quality: false,
15881595
});
15891596
// 画質プロファイルを Wi-Fi 回線向けに切り替えてから、プレイヤーを再起動
15901597
} else {
@@ -1594,6 +1601,8 @@ class PlayerController {
15941601
// 他の通知と被らないように、メッセージを遅らせて表示する
15951602
message_delay_seconds: this.quality_profile.tv_low_latency_mode || this.playback_mode === 'Video' ? 2 : 4.5,
15961603
is_error_message: false,
1604+
// Wi-Fi プロファイル切り替え時、切り替え後の画質プロファイルのデフォルト画質を優先する
1605+
should_resume_quality: false,
15971606
});
15981607
}
15991608
});

client/src/stores/PlayerStore.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export type PlayerEvents = {
2626
message?: string; // プレイヤーに通知するメッセージ
2727
message_delay_seconds?: number; // メッセージを表示するまでの待機時間 (秒)
2828
is_error_message?: boolean; // メッセージをエラーメッセージとして表示するか (既定は true)
29+
should_resume_quality?: boolean; // 再起動後に直前の画質を引き継ぐかどうか (既定は true)
2930
};
3031
// PlayerController.setControlDisplayTimer() をそのまま呼び出す
3132
SetControlDisplayTimer: {

0 commit comments

Comments
 (0)