Show error when media format is unsupported (#409)
* fix error about pop * location-history: add optional callbacks * set handler on first tick discovered by @dcposch * Show error when media format is unsupported Before this change, the player would just get stuck on the loading screen forever without notifying the user.
This commit is contained in:
@@ -285,6 +285,11 @@ function dispatch (action, ...args) {
|
||||
if (action === 'mediaStalled') {
|
||||
state.playing.isStalled = true
|
||||
}
|
||||
if (action === 'mediaError') {
|
||||
state.location.back(function () {
|
||||
onError(new Error('Unsupported file format'))
|
||||
})
|
||||
}
|
||||
if (action === 'mediaTimeUpdate') {
|
||||
state.playing.lastTimeUpdate = new Date().getTime()
|
||||
state.playing.isStalled = false
|
||||
|
||||
Reference in New Issue
Block a user