fix: refactor video source handling in destroy method to use reset function

This commit is contained in:
Harvey Zhao committed 2025-10-16 15:40:23 +08:00
1 parent b6d0c07f8c
commit 3f47356d2c
1 file changed
+6 -2
+6 -2
View File
@@ -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)