mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 01:21:20 -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
|
return this.template.$video
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reset() {
|
||||||
|
this.video.removeAttribute('src')
|
||||||
|
this.video.load()
|
||||||
|
}
|
||||||
|
|
||||||
destroy(removeHtml = true) {
|
destroy(removeHtml = true) {
|
||||||
if (Artplayer.REMOVE_SRC_WHEN_DESTROY) {
|
if (Artplayer.REMOVE_SRC_WHEN_DESTROY) {
|
||||||
this.video.removeAttribute('src')
|
this.reset()
|
||||||
this.video.load()
|
|
||||||
}
|
}
|
||||||
this.events.destroy()
|
this.events.destroy()
|
||||||
this.template.destroy(removeHtml)
|
this.template.destroy(removeHtml)
|
||||||
|
|||||||
Reference in new issue
Block a user