Kaynağa Gözat

fix autoplay mse video

DIYgod 7 yıl önce
ebeveyn
işleme
ec160d1587
6 değiştirilmiş dosya ile 17 ekleme ve 16 silme
  1. 9 8
      demo/demo.js
  2. 0 0
      dist/DPlayer.min.js
  3. 0 0
      dist/DPlayer.min.js.map
  4. 1 1
      package.json
  5. 1 1
      src/js/controller.js
  6. 6 6
      src/js/player.js

+ 9 - 8
demo/demo.js

@@ -121,14 +121,15 @@ function initPlayers () {
     // });
 
     // // dp4
-    // window.dp4 = new DPlayer({
-    //     container: document.getElementById('dplayer4'),
-    //     preload: 'none',
-    //     video: {
-    //         url: 'https://moeplayer.b0.upaiyun.com/dplayer/hls/hikarunara.m3u8',
-    //         type: 'hls'
-    //     }
-    // });
+    window.dp4 = new DPlayer({
+        container: document.getElementById('dplayer4'),
+        preload: 'none',
+        autoplay: true,
+        video: {
+            url: 'https://moeplayer.b0.upaiyun.com/dplayer/hls/hikarunara.m3u8',
+            type: 'hls'
+        }
+    });
 
     // // dp5
     // window.dp5 = new DPlayer({

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/DPlayer.min.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/DPlayer.min.js.map


+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "dplayer",
-  "version": "1.18.0",
+  "version": "1.18.1",
   "description": "Wow, such a lovely HTML5 danmaku video player",
   "main": "dist/DPlayer.min.js",
   "style": "dist/DPlayer.min.css",

+ 1 - 1
src/js/controller.js

@@ -230,7 +230,7 @@ class Controller {
     hide () {
         this.player.container.classList.add('dplayer-hide-controller');
         this.player.setting.hide();
-        this.player.comment.hide();
+        this.player.comment && this.player.comment.hide();
     }
 
     isShow () {

+ 6 - 6
src/js/player.js

@@ -126,6 +126,12 @@ class DPlayer {
 
         this.time = new Time(this);
 
+        this.hotkey = new HotKey(this);
+
+        this.contextmenu = new ContextMenu(this);
+
+        this.initVideo(this.video, this.quality && this.quality.type || this.options.video.type);
+
         if (!this.danmaku) {
             // autoplay
             if (this.options.autoplay && !utils.isMobile) {
@@ -136,12 +142,6 @@ class DPlayer {
             }
         }
 
-        this.hotkey = new HotKey(this);
-
-        this.contextmenu = new ContextMenu(this);
-
-        this.initVideo(this.video, this.quality && this.quality.type || this.options.video.type);
-
         index++;
         instances.push(this);
     }

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor