Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya committed Apr 16, 2024
1 parent afbaba1 commit 4e766bb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oplayer/core",
"version": "1.2.34-beta.1",
"version": "1.2.34-beta.2",
"description": "Oh! Another HTML5 video player.",
"type": "module",
"main": "./dist/index.es.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,10 @@ export class Player<Context extends Record<string, any> = Record<string, any>> {

let finalSource: Source

const errorHandler = (e: any) => {
const errorHandler = (err: any) => {
if (!this.$root) return
this.off(canplay, canplayHandler)
this.emit(options.brokenEvent, finalSource || sourceLike)
this.emit(options.brokenEvent, { source: finalSource || sourceLike, error: err })
if (options.event == 'videosourcechanged') {
this.isSourceChanging = false
} else {
Expand All @@ -441,7 +441,7 @@ export class Player<Context extends Record<string, any> = Record<string, any>> {
this.isSourceChanging = false
})
}
reject(e)
reject(err)
}

const rollback = () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/docs/public/oplayer.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@
<body>
<div id="oplayer"></div>

<script src="https://cdn.jsdelivr.net/npm/@oplayer/[email protected].1/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@oplayer/[email protected].3/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@oplayer/[email protected].2/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@oplayer/[email protected].4/dist/index.min.js"></script>

<script src="https://cdn.jsdelivr.net/npm/@oplayer/[email protected]/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@oplayer/[email protected]/dist/index.min.js"></script>
Expand Down Expand Up @@ -302,7 +302,7 @@
builder({
...e,
message:
(e.message ? `${e.message}\n\n` : `ErrorCode: ${e.code}\n\n`) +
(e.message ? `${e.message}\n\n` : `${e.code ? `ErrorCode:${e.code} \n\n` : ''}`) +
'Open an issues https://github.com/shiyiya/oplayer/issues/new/choose'
})
},
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oplayer/ui",
"version": "1.3.0-beta.3",
"version": "1.3.0-beta.4",
"description": "ui plugin for oplayer",
"type": "module",
"main": "./dist/index.es.js",
Expand Down
10 changes: 6 additions & 4 deletions packages/ui/src/components/ControllerBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ const render = (it: UIInterface, el: HTMLDivElement) => {
player.on('videosourcechange', ({ payload }) => {
if (!payload.then) {
$controlBarTitle.innerText = payload.title || ''
} else {
player.once('sourcechangeerror', () => {
$controlBarTitle.innerText = 'ERROR'
})
}
})

player.on('sourcechangeerror', ({ payload }) => {
if (!payload.source?.title) {
$controlBarTitle.innerText = (payload.e as Error)?.message || 'ERROR'
}
})

Expand Down

0 comments on commit 4e766bb

Please sign in to comment.