|
@@ -370,11 +370,13 @@ class DPlayer {
|
|
|
case 'flv':
|
|
|
if (window.flvjs) {
|
|
|
if (window.flvjs.isSupported()) {
|
|
|
- const options = Object.assign(this.options.pluginOptions.flvjs, {
|
|
|
- type: 'flv',
|
|
|
- url: video.src,
|
|
|
- });
|
|
|
- const flvPlayer = window.flvjs.createPlayer(options);
|
|
|
+ const flvPlayer = window.flvjs.createPlayer(
|
|
|
+ Object.assign(this.options.pluginOptions.flv.mediaDataSource || {}, {
|
|
|
+ type: 'flv',
|
|
|
+ url: video.src,
|
|
|
+ }),
|
|
|
+ this.options.pluginOptions.flv.config
|
|
|
+ );
|
|
|
this.plugins.flvjs = flvPlayer;
|
|
|
flvPlayer.attachMediaElement(video);
|
|
|
flvPlayer.load();
|
|
@@ -395,10 +397,7 @@ class DPlayer {
|
|
|
// https://github.com/Dash-Industry-Forum/dash.js
|
|
|
case 'dash':
|
|
|
if (window.dashjs) {
|
|
|
- const dashjsPlayer = window.dashjs
|
|
|
- .MediaPlayer()
|
|
|
- .create()
|
|
|
- .initialize(video, video.src, false);
|
|
|
+ const dashjsPlayer = window.dashjs.MediaPlayer().create().initialize(video, video.src, false);
|
|
|
const options = this.options.pluginOptions.dash;
|
|
|
dashjsPlayer.updateSettings(options);
|
|
|
this.plugins.dash = dashjsPlayer;
|
|
@@ -427,7 +426,7 @@ class DPlayer {
|
|
|
const file = torrent.files.find((file) => file.name.endsWith('.mp4'));
|
|
|
file.renderTo(this.video, {
|
|
|
autoplay: this.options.autoplay,
|
|
|
- controls: false
|
|
|
+ controls: false,
|
|
|
});
|
|
|
});
|
|
|
this.events.on('destroy', () => {
|