Skip to content

Commit a6aaa4c

Browse files
committed
fix: remove duplicate handleError in Video
1 parent 2d51fea commit a6aaa4c

File tree

1 file changed

+8
-14
lines changed
  • packages/griffith/src/components

1 file changed

+8
-14
lines changed

packages/griffith/src/components/Video.js

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -221,20 +221,6 @@ class Video extends Component {
221221
}
222222
}
223223

224-
handleError = () => {
225-
const {onError} = this.props
226-
if (this.isSwitchDefinition) {
227-
this.isSwitchDefinition = false
228-
this.props.onEvent(
229-
EVENTS.PLAYER.CHANGE_QUALITY_FAIL,
230-
this.props.currentQuality
231-
)
232-
}
233-
if (onError) {
234-
onError(this.root.error)
235-
}
236-
}
237-
238224
handleDurationChange = () => {
239225
const {onDurationChange} = this.props
240226
if (onDurationChange) {
@@ -313,6 +299,14 @@ class Video extends Component {
313299
if (!dontReportPlayFailed) {
314300
this.props.onEvent(EVENTS.PLAYER.PLAY_FAILED, {currentTime})
315301
}
302+
303+
if (this.isSwitchDefinition) {
304+
this.isSwitchDefinition = false
305+
this.props.onEvent(
306+
EVENTS.PLAYER.CHANGE_QUALITY_FAIL,
307+
this.props.currentQuality
308+
)
309+
}
316310
this.props.onError(error)
317311
}
318312

0 commit comments

Comments
 (0)