Stop supporting HLS

This commit is contained in:
DIYgod
2016-07-14 18:01:23 +08:00
parent a3f5c6b9e2
commit 4ce9de0bd6
5 changed files with 16 additions and 24 deletions
+3 -8
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
-3
View File
@@ -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"
}
}
+11 -11
View File
@@ -1,5 +1,5 @@
require('./DPlayer.scss');
const Hls = require('hls.js');
// const Hls = require('hls.js');
class DPlayer {
/**
@@ -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', () => {
+1 -1
View File
@@ -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$/,