Browse Source

docs: update

DIYgod 5 years ago
parent
commit
50ea31b4e9
5 changed files with 53 additions and 87 deletions
  1. 3 9
      README.md
  2. 18 25
      docs/guide.md
  3. 7 13
      docs/support.md
  4. 18 27
      docs/zh/guide.md
  5. 7 13
      docs/zh/support.md

+ 3 - 9
README.md

@@ -49,20 +49,14 @@ Using DPlayer on your project? [Let me know!](https://github.com/DIYgod/DPlayer/
 ### Special Sponsors
 
 <div>
-<a href="https://www.polyv.net/?f=git_DPlayer-20190518-02" target="_blank">
-    <img width="600px" src="https://i.loli.net/2019/06/03/5cf4028f7b8f716387.gif">
-</a>
-</div>
-
-<div>
-<a href="https://www.9ccms.net" target="_blank">
-    <img width="280px" src="https://i.imgur.com/YBV6kfb.png">
+<a href="https://www.cdnbye.com" target="_blank">
+    <img height="60px" src="https://i.imgur.com/K1UsCZT.jpg">
 </a>
 </div>
 
 <div>
 <a href="https://www.dogecloud.com/?ref=dplayer" target="_blank">
-    <img width="280px" src="https://i.imgur.com/C2NgugY.png">
+    <img height="60px" src="https://i.imgur.com/C2NgugY.png">
 </a>
 </div>
 

+ 18 - 25
docs/guide.md

@@ -25,21 +25,17 @@ sidebar: auto
 
 &nbsp;
 
-<a href="https://www.polyv.net/?f=git_DPlayer-20190518-02" target="_blank">
-    <img width="600px" src="https://i.loli.net/2019/06/03/5cf4028f7b8f716387.gif">
+<div>
+<a href="https://www.cdnbye.com" target="_blank">
+    <img height="60px" src="https://i.imgur.com/K1UsCZT.jpg">
 </a>
+</div>
 
-&nbsp;
-
-<a href="https://www.9ccms.net" target="_blank">
-    <img width="280px" src="https://i.imgur.com/YBV6kfb.png">
-</a>
-
-&nbsp;
-
+<div>
 <a href="https://www.dogecloud.com/?ref=dplayer" target="_blank">
-    <img width="280px" src="https://i.imgur.com/C2NgugY.png">
+    <img height="60px" src="https://i.imgur.com/C2NgugY.png">
 </a>
+</div>
 
 ### Sponsors
 
@@ -282,7 +278,7 @@ const dp = new DPlayer({
             color: '#b7daff',
             type: 'right', // should be `top` `bottom` or `right`
         },
-        function() {
+        function () {
             console.log('success');
         }
     );
@@ -329,7 +325,7 @@ const dp = new DPlayer({
 `dp.on(event, handler)`
 
 ```js
-dp.on('ended', function() {
+dp.on('ended', function () {
     console.log('player ended');
 });
 ```
@@ -506,7 +502,7 @@ const dp = new DPlayer({
         url: 'demo.m3u8',
         type: 'customHls',
         customType: {
-            customHls: function(video, player) {
+            customHls: function (video, player) {
                 const hls = new Hls();
                 hls.loadSource(video.src);
                 hls.attachMedia(video);
@@ -551,11 +547,8 @@ const dp = new DPlayer({
         url: 'demo.mpd',
         type: 'customDash',
         customType: {
-            customDash: function(video, player) {
-                dashjs
-                    .MediaPlayer()
-                    .create()
-                    .initialize(video, video.src, false);
+            customDash: function (video, player) {
+                dashjs.MediaPlayer().create().initialize(video, video.src, false);
             },
         },
     },
@@ -581,7 +574,7 @@ const dp = new DPlayer({
         url: 'demo.mpd',
         type: 'shakaDash',
         customType: {
-            shakaDash: function(video, player) {
+            shakaDash: function (video, player) {
                 var src = video.src;
                 var playerShaka = new shaka.Player(video); // 将会修改 video.src
                 playerShaka.load(src);
@@ -633,7 +626,7 @@ const dp = new DPlayer({
         url: 'demo.flv',
         type: 'customFlv',
         customType: {
-            customFlv: function(video, player) {
+            customFlv: function (video, player) {
                 const flvPlayer = flvjs.createPlayer({
                     type: 'flv',
                     url: video.src,
@@ -688,7 +681,7 @@ const dp = new DPlayer({
         url: 'magnet:demo',
         type: 'customWebTorrent',
         customType: {
-            customWebTorrent: function(video, player) {
+            customWebTorrent: function (video, player) {
                 player.container.classList.add('dplayer-loading');
                 const client = new WebTorrent();
                 const torrentId = video.src;
@@ -728,7 +721,7 @@ const dp = new DPlayer({
         url: 'https://qq.webrtc.win/tv/Pear-Demo-Yosemite_National_Park.mp4',
         type: 'pearplayer',
         customType: {
-            pearplayer: function(video, player) {
+            pearplayer: function (video, player) {
                 new PearPlayer(video, {
                     src: video.src,
                     autoplay: player.options.autoplay,
@@ -759,11 +752,11 @@ const dp = new DPlayer({
     live: true,
     danmaku: true,
     apiBackend: {
-        read: function(options) {
+        read: function (options) {
             console.log('Pretend to connect WebSocket');
             callback();
         },
-        send: function(options) {
+        send: function (options) {
             console.log('Pretend to send danamku via WebSocket', options.data);
             callback();
         },

+ 7 - 13
docs/support.md

@@ -31,23 +31,17 @@ Recurring pledges come with exclusive perks, e.g. having your name or your compa
 
 ### Special Sponsors
 
-&nbsp;
-
-<a href="https://www.polyv.net/?f=git_DPlayer-20190518-02" target="_blank">
-    <img width="600px" src="https://i.loli.net/2019/06/03/5cf4028f7b8f716387.gif">
+<div>
+<a href="https://www.cdnbye.com" target="_blank">
+    <img height="60px" src="https://i.imgur.com/K1UsCZT.jpg">
 </a>
+</div>
 
-&nbsp;
-
-<a href="https://www.9ccms.net" target="_blank">
-    <img width="280px" src="https://i.imgur.com/YBV6kfb.png">
-</a>
-
-&nbsp;
-
+<div>
 <a href="https://www.dogecloud.com/?ref=dplayer" target="_blank">
-    <img width="280px" src="https://i.imgur.com/C2NgugY.png">
+    <img height="60px" src="https://i.imgur.com/C2NgugY.png">
 </a>
+</div>
 
 ### Sponsors
 

+ 18 - 27
docs/zh/guide.md

@@ -23,23 +23,17 @@ sidebar: auto
 
 ### Special Sponsors
 
-&nbsp;
-
-<a href="https://www.polyv.net/?f=git_DPlayer-20190518-02" target="_blank">
-    <img width="600px" src="https://i.loli.net/2019/06/03/5cf4028f7b8f716387.gif">
-</a>
-
-&nbsp;
-
-<a href="https://www.9ccms.net" target="_blank">
-    <img width="280px" src="https://i.imgur.com/YBV6kfb.png">
+<div>
+<a href="https://www.cdnbye.com" target="_blank">
+    <img height="60px" src="https://i.imgur.com/K1UsCZT.jpg">
 </a>
+</div>
 
-&nbsp;
-
+<div>
 <a href="https://www.dogecloud.com/?ref=dplayer" target="_blank">
-    <img width="280px" src="https://i.imgur.com/C2NgugY.png">
+    <img height="60px" src="https://i.imgur.com/C2NgugY.png">
 </a>
+</div>
 
 ### Sponsors
 
@@ -270,7 +264,7 @@ const dp = new DPlayer({
             color: '#b7daff',
             type: 'right', // should be `top` `bottom` or `right`
         },
-        function() {
+        function () {
             console.log('success');
         }
     );
@@ -317,7 +311,7 @@ const dp = new DPlayer({
 `dp.on(event, handler)`
 
 ```js
-dp.on('ended', function() {
+dp.on('ended', function () {
     console.log('player ended');
 });
 ```
@@ -492,7 +486,7 @@ const dp = new DPlayer({
         url: 'demo.m3u8',
         type: 'customHls',
         customType: {
-            customHls: function(video, player) {
+            customHls: function (video, player) {
                 const hls = new Hls();
                 hls.loadSource(video.src);
                 hls.attachMedia(video);
@@ -537,11 +531,8 @@ const dp = new DPlayer({
         url: 'demo.mpd',
         type: 'customDash',
         customType: {
-            customDash: function(video, player) {
-                dashjs
-                    .MediaPlayer()
-                    .create()
-                    .initialize(video, video.src, false);
+            customDash: function (video, player) {
+                dashjs.MediaPlayer().create().initialize(video, video.src, false);
             },
         },
     },
@@ -567,7 +558,7 @@ const dp = new DPlayer({
         url: 'demo.mpd',
         type: 'shakaDash',
         customType: {
-            shakaDash: function(video, player) {
+            shakaDash: function (video, player) {
                 var src = video.src;
                 var playerShaka = new shaka.Player(video); // 将会修改 video.src
                 playerShaka.load(src);
@@ -619,7 +610,7 @@ const dp = new DPlayer({
         url: 'demo.flv',
         type: 'customFlv',
         customType: {
-            customFlv: function(video, player) {
+            customFlv: function (video, player) {
                 const flvPlayer = flvjs.createPlayer({
                     type: 'flv',
                     url: video.src,
@@ -674,7 +665,7 @@ const dp = new DPlayer({
         url: 'magnet:demo',
         type: 'customWebTorrent',
         customType: {
-            customWebTorrent: function(video, player) {
+            customWebTorrent: function (video, player) {
                 player.container.classList.add('dplayer-loading');
                 const client = new WebTorrent();
                 const torrentId = video.src;
@@ -714,7 +705,7 @@ const dp = new DPlayer({
         url: 'https://qq.webrtc.win/tv/Pear-Demo-Yosemite_National_Park.mp4',
         type: 'pearplayer',
         customType: {
-            pearplayer: function(video, player) {
+            pearplayer: function (video, player) {
                 new PearPlayer(video, {
                     src: video.src,
                     autoplay: player.options.autoplay,
@@ -745,11 +736,11 @@ const dp = new DPlayer({
     live: true,
     danmaku: true,
     apiBackend: {
-        read: function(endpoint, callback) {
+        read: function (endpoint, callback) {
             console.log('Pretend to connect WebSocket');
             callback();
         },
-        send: function(endpoint, danmakuData, callback) {
+        send: function (endpoint, danmakuData, callback) {
             console.log('Pretend to send danamku via WebSocket', danmakuData);
             callback();
         },

+ 7 - 13
docs/zh/support.md

@@ -31,23 +31,17 @@ DPlayer 是采用 MIT 许可的开源项目,使用完全免费。 但是随着
 
 ### Special Sponsors
 
-&nbsp;
-
-<a href="https://www.polyv.net/?f=git_DPlayer-20190518-02" target="_blank">
-    <img width="600px" src="https://i.loli.net/2019/06/03/5cf4028f7b8f716387.gif">
+<div>
+<a href="https://www.cdnbye.com" target="_blank">
+    <img height="60px" src="https://i.imgur.com/K1UsCZT.jpg">
 </a>
+</div>
 
-&nbsp;
-
-<a href="https://www.9ccms.net" target="_blank">
-    <img width="280px" src="https://i.imgur.com/YBV6kfb.png">
-</a>
-
-&nbsp;
-
+<div>
 <a href="https://www.dogecloud.com/?ref=dplayer" target="_blank">
-    <img width="280px" src="https://i.imgur.com/C2NgugY.png">
+    <img height="60px" src="https://i.imgur.com/C2NgugY.png">
 </a>
+</div>
 
 ### Sponsors