Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"googlevideo": "^4.1.1",
"marked": "^18.0.7",
"process": "^0.11.10",
"shaka-player": "^5.1.12",
"shaka-player": "^5.2.2",
"swiper": "^14.0.6",
"terser": "^5.49.0",
"vue": "^3.5.40",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ export default defineComponent({

watch(displayVideoPlayButton, (newValue) => {
ui.configure({
bigButtons: newValue ? ['play_pause'] : []
bigButtons: newValue ? ['play_pause_buffering'] : [],
showBufferingSpinner: !newValue
})
})

Expand Down Expand Up @@ -316,17 +317,29 @@ export default defineComponent({
return parseInt(store.getters.getMaxVideoPlaybackRate)
})

watch(maxVideoPlaybackRate, (newValue) => {
ui.configure({
playbackRateSliderMax: newValue
})
})

const videoPlaybackRateInterval = computed(() => {
return parseFloat(store.getters.getVideoPlaybackRateInterval)
})

watch(videoPlaybackRateInterval, (newValue) => {
ui.configure({
playbackRateSliderMin: newValue
})
})

const playbackRates = computed(() => {
const interval = videoPlaybackRateInterval.value
const playbackRates = []
let i = interval

while (i <= maxVideoPlaybackRate.value) {
playbackRates.unshift(i)
playbackRates.push(i)
i += interval
i = parseFloat(i.toFixed(2))
}
Expand Down Expand Up @@ -634,7 +647,7 @@ export default defineComponent({
// Electron doesn't like YouTube's vp9 VR video streams and throws:
// "CHUNK_DEMUXER_ERROR_APPEND_FAILED: Projection element is incomplete; ProjectionPoseYaw required."
// So use the AV1 and h264 codecs instead which it doesn't reject
preferredVideoCodecs: typeof props.vrProjection === 'string' ? ['av01', 'avc1'] : []
preferredVideo: typeof props.vrProjection === 'string' ? [{ codec: 'av01' }, { codec: 'avc1' }] : []
}
}

Expand Down Expand Up @@ -794,8 +807,7 @@ export default defineComponent({
'ft_skip_previous',
'play_pause',
'ft_skip_next',
'mute',
'volume',
'mute_volume',
'time_and_duration',
'spacer'
]
Expand Down Expand Up @@ -940,8 +952,11 @@ export default defineComponent({
},

// these have their own watchers
bigButtons: displayVideoPlayButton.value ? ['play_pause'] : [],
bigButtons: displayVideoPlayButton.value ? ['play_pause_buffering'] : [],
showBufferingSpinner: !displayVideoPlayButton.value,
enableFullscreenOnRotation: enterFullscreenOnDisplayRotate.value,
playbackRateSliderMax: maxVideoPlaybackRate.value,
playbackRateSliderMin: videoPlaybackRateInterval.value,
playbackRates: playbackRates.value,
tapSeekDistance: defaultSkipInterval.value,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,16 @@ export class AudioTrackSelection extends shaka.ui.SettingsMenu {
this.updateAudioTracks_()
})

if (this.isSubMenu) {
this.eventManager.listen(this.controls, 'submenuopen', () => {
this.updateAudioTracks_()
})

this.eventManager.listen(this.controls, 'submenuclose', () => {
this.updateAudioTracks_()
})
}

this.updateLocalisedStrings_()

this.updateAudioTracks_()
}

/** @override */
checkAvailability() {
this.updateAudioTracks_()
}

/**
* @private
*/
Expand All @@ -79,6 +74,7 @@ export class AudioTrackSelection extends shaka.ui.SettingsMenu {

for (const track of tracks) {
const button = document.createElement('button')
button.role = 'menuitemradio'
button.addEventListener('click', () => {
this.onAudioTrackSelected_(track)
})
Expand All @@ -92,8 +88,10 @@ export class AudioTrackSelection extends shaka.ui.SettingsMenu {
button.appendChild(this._checkmarkIcon)

span.classList.add('shaka-chosen-item')
button.ariaSelected = 'true'
button.ariaChecked = 'true'
this.currentSelection.textContent = span.textContent
} else {
button.ariaChecked = 'false'
}

menu.appendChild(button)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@ export class AutoplayToggle extends shaka.ui.Element {
this.updateLocalisedStrings_()
})

if (this.isSubMenu) {
this.eventManager.listen(this.controls, 'submenuopen', () => {
this.updateVisibility_()
})

this.eventManager.listen(this.controls, 'submenuclose', () => {
this.updateVisibility_()
})
}

this.updateLocalisedStrings_()
}

Expand All @@ -86,8 +76,8 @@ export class AutoplayToggle extends shaka.ui.Element {
this.button_.ariaLabel = this.autoplayEnabled_ ? i18n.global.t('Video.Player.Autoplay is on') : i18n.global.t('Video.Player.Autoplay is off')
}

/** @private */
updateVisibility_() {
/** @overide */
checkAvailability() {
if (this.isSubMenuOpened) {
this.button_.classList.add('shaka-hidden')
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@ export class FullWindowButton extends shaka.ui.Element {
this.updateLocalisedStrings_()
})

if (this.isSubMenu) {
this.eventManager.listen(this.controls, 'submenuopen', () => {
this.updateVisibility_()
})

this.eventManager.listen(this.controls, 'submenuclose', () => {
this.updateVisibility_()
})
}

this.updateLocalisedStrings_()
}

Expand All @@ -88,8 +78,8 @@ export class FullWindowButton extends shaka.ui.Element {
this.nameSpan_.textContent = this.button_.ariaLabel = newLabel
}

/** @private */
updateVisibility_() {
/** @override */
checkAvailability() {
if (this.isSubMenuOpened) {
this.button_.classList.add('shaka-hidden')
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export class LegacyQualitySelection extends shaka.ui.SettingsMenu {

for (const format of sortedLegacyFormats) {
const button = document.createElement('button')
button.role = 'menuitemradio'
button.ariaChecked = 'false'
button.classList.add('legacy-resolution')

this.eventManager.listen(button, 'click', () => {
Expand All @@ -63,17 +65,16 @@ export class LegacyQualitySelection extends shaka.ui.SettingsMenu {
this.updateResolutionSelection_()
})

if (this.isSubMenu) {
this.eventManager.listen(this.controls, 'submenuopen', () => {
this.button.classList.add('shaka-hidden')
})
this.updateResolutionSelection_()
}

this.eventManager.listen(this.controls, 'submenuclose', () => {
this.button.classList.remove('shaka-hidden')
})
/** @overide */
checkAvailability() {
if (this.isSubMenuOpened) {
this.button.classList.add('shaka-hidden')
} else {
this.button.classList.remove('shaka-hidden')
}

this.updateResolutionSelection_()
}

/** @private */
Expand All @@ -89,7 +90,7 @@ export class LegacyQualitySelection extends shaka.ui.SettingsMenu {
previousSpan.classList.remove('shaka-chosen-item')

const button = previousSpan.parentElement
button.ariaSelected = 'false'
button.ariaChecked = 'false'
this._checkmarkIcon.remove()
}

Expand All @@ -100,7 +101,7 @@ export class LegacyQualitySelection extends shaka.ui.SettingsMenu {
const button = this.menu.querySelectorAll('.legacy-resolution')[index]
const span = button.querySelector('span')

button.ariaSelected = 'true'
button.ariaChecked = 'true'

span.classList.add('shaka-chosen-item')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@ export class ScreenshotButton extends shaka.ui.Element {
this.updateLocalisedStrings_()
})

if (this.isSubMenu) {
this.eventManager.listen(this.controls, 'submenuopen', () => {
this.updateVisibility_()
})

this.eventManager.listen(this.controls, 'submenuclose', () => {
this.updateVisibility_()
})
}

this.updateLocalisedStrings_()
}

Expand All @@ -67,8 +57,8 @@ export class ScreenshotButton extends shaka.ui.Element {
this.nameSpan_.textContent = this.button_.ariaLabel = label
}

/** @private */
updateVisibility_() {
/** @override */
checkAvailability() {
if (this.isSubMenuOpened) {
this.button_.classList.add('shaka-hidden')
} else {
Expand Down