Browse Source

Stop supporting HLS

DIYgod 9 years ago
parent
commit
4ce9de0bd6
5 changed files with 12 additions and 15 deletions
  1. 0 0
      dist/DPlayer.min.js
  2. 0 0
      dist/DPlayer.min.js.map
  3. 0 3
      package.json
  4. 11 11
      src/DPlayer.js
  5. 1 1
      webpack.config.js

File diff suppressed because it is too large
+ 0 - 0
dist/DPlayer.min.js


File diff suppressed because it is too large
+ 0 - 0
dist/DPlayer.min.js.map


+ 0 - 3
package.json

@@ -37,8 +37,5 @@
     "url-loader": "^0.5.7",
     "url-loader": "^0.5.7",
     "webpack": "^1.13.1",
     "webpack": "^1.13.1",
     "webpack-dev-server": "^1.9.0"
     "webpack-dev-server": "^1.9.0"
-  },
-  "dependencies": {
-    "hls.js": "^0.6.2-2"
   }
   }
 }
 }

+ 11 - 11
src/DPlayer.js

@@ -1,5 +1,5 @@
 require('./DPlayer.scss');
 require('./DPlayer.scss');
-const Hls = require('hls.js');
+// const Hls = require('hls.js');
 
 
 class DPlayer {
 class DPlayer {
     /**
     /**
@@ -279,16 +279,16 @@ class DPlayer {
         this.audio = this.element.getElementsByClassName('dplayer-video')[0];
         this.audio = this.element.getElementsByClassName('dplayer-video')[0];
 
 
         // Support HTTP Live Streaming
         // Support HTTP Live Streaming
-        if (this.option.video.url.match(/(m3u8)$/i) || Hls.isSupported()) {
-            const hls = new Hls();
-            hls.attachMedia(this.audio);
-            hls.on(Hls.Events.MEDIA_ATTACHED, () => {
-                hls.loadSource(this.option.video.url);
-                hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {
-                    console.log("manifest loaded, found " + data.levels.length + " quality level");
-                });
-            });
-        }
+        // if (this.option.video.url.match(/(m3u8)$/i) || Hls.isSupported()) {
+        //     const hls = new Hls();
+        //     hls.attachMedia(this.audio);
+        //     hls.on(Hls.Events.MEDIA_ATTACHED, () => {
+        //         hls.loadSource(this.option.video.url);
+        //         hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {
+        //             console.log("manifest loaded, found " + data.levels.length + " quality level");
+        //         });
+        //     });
+        // }
 
 
         this.bezel = this.element.getElementsByClassName('dplayer-bezel-icon')[0];
         this.bezel = this.element.getElementsByClassName('dplayer-bezel-icon')[0];
         this.bezel.addEventListener('animationend', () => {
         this.bezel.addEventListener('animationend', () => {

+ 1 - 1
webpack.config.js

@@ -23,7 +23,7 @@ module.exports = {
     },
     },
 
 
     module: {
     module: {
-        noParse: /node_modules\/hls.js\/dist\/hls.js/,
+        // noParse: /node_modules\/hls.js\/dist\/hls.js/,
         loaders: [
         loaders: [
             {
             {
                 test: /\.js$/,
                 test: /\.js$/,

Some files were not shown because too many files changed in this diff