diff --git a/src/renderer/components/ft-shaka-video-player/ft-shaka-video-player.js b/src/renderer/components/ft-shaka-video-player/ft-shaka-video-player.js index 730328a243ab9..8605918d7330e 100644 --- a/src/renderer/components/ft-shaka-video-player/ft-shaka-video-player.js +++ b/src/renderer/components/ft-shaka-video-player/ft-shaka-video-player.js @@ -156,7 +156,8 @@ export default defineComponent({ const activeLegacyFormat = shallowRef(null) - const fullWindowEnabled = ref(props.startInFullwindow) + const fullWindowEnabled = ref(false) + const startInFullwindow = props.startInFullwindow let startInFullscreen = props.startInFullscreen let startInPip = props.startInPip @@ -1693,7 +1694,7 @@ export default defineComponent({ */ class FullWindowButtonFactory { create(rootElement, controls) { - return new FullWindowButton(fullWindowEnabled.value, events, rootElement, controls) + return new FullWindowButton(fullWindowEnabled.value, startInFullwindow, events, rootElement, controls) } } diff --git a/src/renderer/components/ft-shaka-video-player/player-components/FullWindowButton.js b/src/renderer/components/ft-shaka-video-player/player-components/FullWindowButton.js index 2f0db723e3faf..13c5de405c92b 100644 --- a/src/renderer/components/ft-shaka-video-player/player-components/FullWindowButton.js +++ b/src/renderer/components/ft-shaka-video-player/player-components/FullWindowButton.js @@ -5,11 +5,12 @@ import i18n from '../../../i18n/index' export class FullWindowButton extends shaka.ui.Element { /** * @param {boolean} fullWindowEnabled + * @param {boolean} startInFullWindow * @param {EventTarget} events * @param {HTMLElement} parent * @param {shaka.ui.Controls} controls */ - constructor(fullWindowEnabled, events, parent, controls) { + constructor(fullWindowEnabled, startInFullWindow, events, parent, controls) { super(parent, controls) /** @private */ @@ -62,6 +63,12 @@ export class FullWindowButton extends shaka.ui.Element { this.updateLocalisedStrings_() }) + if (startInFullWindow) { + events.dispatchEvent(new CustomEvent('setFullWindow', { + detail: true + })) + } + this.updateLocalisedStrings_() }