Explorar o código

暴露 Hls 实例

https://github.com/MoePlayer/DPlayer/issues/446

暴露 Hls 实例 用来绑定事件等操作
lqzhgood %!s(int64=6) %!d(string=hai) anos
pai
achega
183a987921
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/js/player.js

+ 3 - 1
src/js/player.js

@@ -344,8 +344,10 @@ class DPlayer {
                 if (Hls) {
                     if (Hls.isSupported()) {
                         const hls = new Hls();
+                        this.hls = hls;
                         hls.loadSource(video.src);
-                        hls.attachMedia(video);
+                        
+                        .attachMedia(video);
                         this.events.on('destroy', () => {
                             hls.destroy();
                         });