Add setting to enable/disable Game Bar feature

This commit is contained in:
redphx
2024-05-11 10:42:30 +07:00
parent 72579249b1
commit 6b88f73e34
5 changed files with 31 additions and 9 deletions

View File

@@ -149,12 +149,17 @@ window.addEventListener(BxEvent.STREAM_PLAYING, e => {
STATES.isPlaying = true;
injectStreamMenuButtons();
GameBar.reset();
GameBar.enable();
GameBar.showBar();
if (getPref(PrefKey.GAME_BAR_ENABLED)) {
GameBar.reset();
GameBar.enable();
GameBar.showBar();
}
if (STATES.currentStream.$screenshotCanvas) {
STATES.currentStream.$screenshotCanvas.width = $video.videoWidth;
STATES.currentStream.$screenshotCanvas.height = $video.videoHeight;
}
STATES.currentStream.$screenshotCanvas!.width = $video.videoWidth;
STATES.currentStream.$screenshotCanvas!.height = $video.videoHeight;
updateVideoPlayerCss();
});