Stop supporting HLS
This commit is contained in:
Vendored
+3
-8
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -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
@@ -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
@@ -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$/,
|
||||
|
||||
Reference in New Issue
Block a user