Skip to content

Commit

Permalink
update hls error info
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya committed May 9, 2024
1 parent d024d6e commit 7826747
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/hls/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oplayer/hls",
"version": "1.2.26-beta.4",
"version": "1.2.26-beta.5",
"description": "Hls plugin for oplayer",
"type": "module",
"main": "./dist/index.es.js",
Expand Down
6 changes: 1 addition & 5 deletions packages/hls/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,6 @@ class HlsPlugin implements PlayerPlugin {
instance.recoverMediaError()
break
case 'networkError':
if (!(data.networkDetails?.status === 404)) {
instance.startLoad()
}
break
default:
if (errorHandler) {
errorHandler(player, data)
Expand All @@ -145,7 +141,7 @@ class HlsPlugin implements PlayerPlugin {
player.emit('error', {
...data,
pluginName: PLUGIN_NAME,
message: data.type + ': ' + data.details
message: data.type + ': ' + data.reason || data.details
})
}
break
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/src/playlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export default class PlaylistPlugin implements PlayerPlugin {
}
})
.catch((error) => {
this.player.emit('playlistsourceerror', { error, idx })
this.player.emit('playlistsourceerror', { error: error?.payload || error, idx })
})
.finally(() => {
this.currentIndex = idx
Expand Down

0 comments on commit 7826747

Please sign in to comment.