mirror of
https://github.com/FreeTubeApp/FreeTube
synced 2025-01-24 18:50:30 +01:00
! Fix unnecessary error message display in toast when paused before video started playing on load (#3835)
Caused by https://github.com/FreeTubeApp/FreeTube/pull/3775
This commit is contained in:
parent
97593e3681
commit
ccefdb34a1
@ -25,6 +25,13 @@ import {
|
||||
import { getProxyUrl } from '../../helpers/api/invidious'
|
||||
import store from '../../store'
|
||||
|
||||
const EXPECTED_PLAY_RELATED_ERROR_MESSAGES = [
|
||||
// This is thrown when `play()` called but user already viewing another page
|
||||
'The play() request was interrupted by a new load request.',
|
||||
// This is thrown when `pause()` called before video started playing on load
|
||||
'The play() request was interrupted by a call to pause()',
|
||||
]
|
||||
|
||||
// YouTube now throttles if you use the `Range` header for the DASH formats, instead of the range query parameter
|
||||
// videojs-http-streaming calls this hook everytime it makes a request,
|
||||
// so we can use it to convert the Range header into the range query parameter for the streaming URLs
|
||||
@ -1979,9 +1986,8 @@ export default defineComponent({
|
||||
}
|
||||
promise
|
||||
.catch(err => {
|
||||
if (err.message.includes('The play() request was interrupted by a new load request.')) {
|
||||
if (EXPECTED_PLAY_RELATED_ERROR_MESSAGES.some(msg => err.message.includes(msg))) {
|
||||
// Ignoring expected exception
|
||||
// This is thrown when `play()` called but user already viewing another page
|
||||
// console.debug('Ignoring expected error')
|
||||
// console.debug(err)
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user