diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js
index cf477bfd9d..f1a0f427d6 100644
--- a/src/plugins/htmlVideoPlayer/plugin.js
+++ b/src/plugins/htmlVideoPlayer/plugin.js
@@ -675,14 +675,14 @@ function tryRemoveElement(elem) {
}
onEndedInternal(this, elem, this.onError);
-
- if (destroyPlayer) {
- this.destroy();
- }
}
this.destroyCustomTrack(elem);
+ if (destroyPlayer) {
+ this.destroy();
+ }
+
return Promise.resolve();
}