Skip to content

Commit

Permalink
[bugs] xgplayer error
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiram committed Jun 4, 2024
1 parent b47f5d8 commit e00ffe2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/renderer/src/utils/common/player/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@
* - 修复dplayer弹幕控制不生效-弹幕开关控制逻辑误删
* - 2024.6.3:
* - 支持mp3|m4a音频-使用MPEG-TS库
* - 2024.6.4:
* - 修复西瓜播放器加载视频错误
* - 修复多次创建播放器扩展插件会重复添加-默认参数使用深拷贝
*
* ---
*/

import cloneDeep from 'lodash/cloneDeep';
import { checkMediaType, checkLiveM3U8 } from '@/utils/tool';

let playerModulesCache: { [key: string]: any } = {};
Expand Down Expand Up @@ -156,7 +160,7 @@ const playerCreate = async (
const isLive = type === 'iptv' ? await checkLiveM3U8(url) : false;
videoType = videoType || (await checkMediaType(url)) || '';

let config = options;
let config = cloneDeep(options);
if (playerMode === 'xgplayer') {
config.id = container;
config.url = url;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import Mp4Plugin from 'xgplayer-mp4';
import ShakaPlugin from 'xgplayer-shaka';
// import DashPlugin from 'xgplayer-dash';


import { publicColor, publicIcons } from './components';

const publicListener = {
Expand Down Expand Up @@ -122,7 +121,7 @@ const create = (options: any): XgPlayer => {
SimplePlayer.defaultPreset = LivePreset;
return new SimplePlayer({ ...options });
} else {
options.plugins = [...plugins, Danmu];
options.plugins = [...options.plugins, Danmu];
return new XgPlayer({ ...options });
}
};
Expand Down

0 comments on commit e00ffe2

Please sign in to comment.