mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 10:56:15 -08:00
fix: refactor video source handling in destroy method to use reset function
This commit is contained in:
1 parent
b6d0c07f8c
commit
3f47356d2c
1 file changed
+6
-2
@@ -202,10 +202,14 @@ export default class Artplayer extends Emitter {
|
||||
return this.template.$video
|
||||
}
|
||||
|
||||
reset() {
|
||||
this.video.removeAttribute('src')
|
||||
this.video.load()
|
||||
}
|
||||
|
||||
destroy(removeHtml = true) {
|
||||
if (Artplayer.REMOVE_SRC_WHEN_DESTROY) {
|
||||
this.video.removeAttribute('src')
|
||||
this.video.load()
|
||||
this.reset()
|
||||
}
|
||||
this.events.destroy()
|
||||
this.template.destroy(removeHtml)
|
||||
|
||||
Reference in new issue
Block a user