pluginsOption -> pluginOptions

This commit is contained in:
lqzh 2019-07-29 12:44:02 +08:00
parent f95c7dce3e
commit 8dc853de4e
2 changed files with 5 additions and 5 deletions

View File

@ -19,7 +19,7 @@ export default (options) => {
video: {},
contextmenu: [],
mutex: true,
pluginsOption:{hls:{},flvjs:{},dash:{},webtorrent:{}}
pluginOptions:{hls:{},flvjs:{},dash:{},webtorrent:{}}
};
for (const defaultKey in defaultOption) {
if (defaultOption.hasOwnProperty(defaultKey) && !options.hasOwnProperty(defaultKey)) {

View File

@ -344,7 +344,7 @@ class DPlayer {
case 'hls':
if (Hls) {
if (Hls.isSupported()) {
const options = this.options.pluginsOption.hls;
const options = this.options.pluginOptions.hls;
const hls = new Hls(options);
this.plugins.hls = hls;
hls.loadSource(video.src);
@ -367,7 +367,7 @@ class DPlayer {
case 'flv':
if (flvjs) {
if (flvjs.isSupported()) {
const options = Object.assign(this.options.pluginsOption.flvjs,{
const options = Object.assign(this.options.pluginOptions.flvjs,{
type: 'flv',
url: video.src
});
@ -395,7 +395,7 @@ class DPlayer {
case 'dash':
if (dashjs) {
const dashjsPlayer = dashjs.MediaPlayer().create().initialize(video, video.src, false);
const options = this.options.pluginsOption.dash;
const options = this.options.pluginOptions.dash;
dashjsPlayer.updateSettings(options);
this.plugins.dash = dashjsPlayer;
this.events.on('destroy', () => {
@ -413,7 +413,7 @@ class DPlayer {
if (WebTorrent) {
if (WebTorrent.WEBRTC_SUPPORT) {
this.container.classList.add('dplayer-loading');
const options = this.options.pluginsOption.webtorrent;
const options = this.options.pluginOptions.webtorrent;
const client = new WebTorrent(options);
this.plugins.webtorrent = client;
const torrentId = video.src;