Skip to content

Commit

Permalink
fix player destroy control plugins memeory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
李璐 authored and jiuyuetianjiuyuetian committed Oct 10, 2024
1 parent bfbfcab commit 8ef44a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/xgplayer/src/mediaProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ class MediaProxy extends EventEmitter {
let _e = this.media.error || error
const type = _e.code ? ERROR_TYPE_MAP[_e.code] : 'other'
let message = _e.message
if (!this.media.currentSrc) {
if (!(this.media.currentSrc || this.media.srcObject)) {
message = 'empty_src'
_e = {
code: 6,
Expand Down
4 changes: 4 additions & 0 deletions packages/xgplayer/src/plugins/controls/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ class Controls extends Plugin {
this.unbind('mouseenter', this.onMouseEnter)
this.unbind('mouseleave', this.onMouseLeave)
}
this.left = null
this.center = null
this.right = null
this.innerRoot = null
}

render () {
Expand Down

0 comments on commit 8ef44a4

Please sign in to comment.