Skip to content

Commit

Permalink
fix: remove duplicate handleError in Video
Browse files Browse the repository at this point in the history
  • Loading branch information
ambar committed Sep 8, 2021
1 parent 2d51fea commit a6aaa4c
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions packages/griffith/src/components/Video.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,20 +221,6 @@ class Video extends Component {
}
}

handleError = () => {
const {onError} = this.props
if (this.isSwitchDefinition) {
this.isSwitchDefinition = false
this.props.onEvent(
EVENTS.PLAYER.CHANGE_QUALITY_FAIL,
this.props.currentQuality
)
}
if (onError) {
onError(this.root.error)
}
}

handleDurationChange = () => {
const {onDurationChange} = this.props
if (onDurationChange) {
Expand Down Expand Up @@ -313,6 +299,14 @@ class Video extends Component {
if (!dontReportPlayFailed) {
this.props.onEvent(EVENTS.PLAYER.PLAY_FAILED, {currentTime})
}

if (this.isSwitchDefinition) {
this.isSwitchDefinition = false
this.props.onEvent(
EVENTS.PLAYER.CHANGE_QUALITY_FAIL,
this.props.currentQuality
)
}
this.props.onError(error)
}

Expand Down

0 comments on commit a6aaa4c

Please sign in to comment.