Browse Source

暴露 Hls 实例

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

暴露 Hls 实例 用来绑定事件等操作
lqzhgood 6 năm trước cách đây
mục cha
commit
183a987921
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  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();
                         });