Explorar el Código

暴露 Hls 实例

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

暴露 Hls 实例 用来绑定事件等操作
lqzhgood hace 6 años
padre
commit
183a987921
Se han modificado 1 ficheros con 3 adiciones y 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();
                         });