Explorar o código

new API: switchVideo(video, danmaku)

DIYgod %!s(int64=8) %!d(string=hai) anos
pai
achega
467feb7d82
Modificáronse 3 ficheiros con 28 adicións e 0 borrados
  1. 0 0
      DPlayer.min.js
  2. 0 0
      DPlayer.min.js.map
  3. 28 0
      index.html

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
DPlayer.min.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
DPlayer.min.js.map


+ 28 - 0
index.html

@@ -52,6 +52,8 @@
     <p>Made by <a href="https://www.anotherhome.net/" target="_blank">DIYgod</a>. Available on <a href="https://github.com/DIYgod/DPlayer" target="_blank">GitHub</a>. Licensed SATA.</p>
     <hr>
     <div class="dplayer"></div>
+    <br>
+    <button onclick="switchDPlayer()">Switch Video</button>
 </div>
 <script src="https://rawgit.com/mrdoob/stats.js/master/build/stats.min.js"></script>
 <script src="DPlayer.min.js"></script>
@@ -95,6 +97,32 @@
     dp.on('error', function () {
         console.log('error');
     });
+    function switchDPlayer() {
+        if (dp.option.danmaku.id !== '5rGf5Y2X55qu6Z2p') {
+            dp.switchVideo({
+                        url: 'http://devtest.qiniudn.com/微小微-江南皮革厂倒闭了.mp4',
+                        pic: 'http://devtest.qiniudn.com/微小微-江南皮革厂倒闭了.jpg'
+                    },
+                    {
+                        id: '5rGf5Y2X55qu6Z2p',
+                        api: 'https://dplayer.daoapp.io/',
+                        token: 'tokendemo',
+                        maximum: 3000
+                    });
+        }
+        else {
+            dp.switchVideo({
+                        url: 'http://devtest.qiniudn.com/若能绽放光芒.mp4',
+                        pic: 'http://devtest.qiniudn.com/若能绽放光芒.png'
+                    },
+                    {
+                        id: '9E2E3368B56CDBB4',
+                        api: 'https://dplayer.daoapp.io/',
+                        token: 'tokendemo',
+                        maximum: 3000
+                    });
+        }
+    }
 
     // stats.js: JavaScript Performance Monitor
     var stats = new Stats();

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio