Skip to content

Commit

Permalink
Update to trigger setFullWindow event when starting in fullwindow
Browse files Browse the repository at this point in the history
  • Loading branch information
kommunarr committed Oct 23, 2024
1 parent 5ca47a6 commit d57111a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -62,6 +63,12 @@ export class FullWindowButton extends shaka.ui.Element {
this.updateLocalisedStrings_()
})

if (startInFullWindow) {
events.dispatchEvent(new CustomEvent('setFullWindow', {
detail: true
}))
}

this.updateLocalisedStrings_()
}

Expand Down

0 comments on commit d57111a

Please sign in to comment.