feat: 为xgplayer增加一个类似于bilibili的锁定的插件

This commit is contained in:
539943419 committed 2024-09-26 17:02:28 +08:00
1 parent 3a18bb3cbd
commit 54c48c0f8f
5 files changed
+174 -8

No files matched your search

@@ -15,6 +15,7 @@ import XGPlayer from 'xgplayer'
import '@/style/xgplayer.scss'
import TextTrack from 'xgplayer/es/plugins/track'
import 'xgplayer/es/plugins/track/index.css'
import lockScreen from './playerPlugin/lockScreen'
import axios from 'axios'
import { uniq } from 'lodash'
// import config from '@/config'
@@ -93,7 +94,7 @@ const { setVideo } = (() => {
}
_player && _player.destroy()
_player = new XGPlayer({
plugins: [TextTrack],
plugins: [TextTrack, lockScreen],
el: xgPlayer.value,
url: videoVFile.url,
width: '100%',
@@ -105,7 +106,7 @@ const { setVideo } = (() => {
download: true,
screenShot: {
saveImg: true,
quality: 0.92,
quality: 1,
type: 'image/png',
format: '.png'
},
@@ -285,7 +286,7 @@ function ssaToVtt(ssaContent: string): string {
const findVideo = (vFiles: VirtualFile[]) =>
vFiles.filter((v) => {
for (let s of ['mp4', 'm3u8', 'hls']) {
for (let s of ['mp4', 'mp3']) {
if (v.name.endsWith(s)) {
return true
}