Skip to content

Commit

Permalink
Stop supporting HLS
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jul 14, 2016
1 parent a3f5c6b commit 4ce9de0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 24 deletions.
11 changes: 3 additions & 8 deletions dist/DPlayer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/DPlayer.min.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,5 @@
"url-loader": "^0.5.7",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.9.0"
},
"dependencies": {
"hls.js": "^0.6.2-2"
}
}
22 changes: 11 additions & 11 deletions src/DPlayer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require('./DPlayer.scss');
const Hls = require('hls.js');
// const Hls = require('hls.js');

class DPlayer {
/**
Expand Down Expand Up @@ -279,16 +279,16 @@ class DPlayer {
this.audio = this.element.getElementsByClassName('dplayer-video')[0];

// 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.addEventListener('animationend', () => {
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
},

module: {
noParse: /node_modules\/hls.js\/dist\/hls.js/,
// noParse: /node_modules\/hls.js\/dist\/hls.js/,
loaders: [
{
test: /\.js$/,
Expand Down

0 comments on commit 4ce9de0

Please sign in to comment.