mirror of
https://gitee.com/dromara/go-view.git
synced 2024-12-02 11:48:36 +08:00
perf: 优化视频组件
This commit is contained in:
parent
a48bdd08ff
commit
b9e3053fe3
Binary file not shown.
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 9.3 KiB |
BIN
src/assets/images/chart/informations/video.png
Normal file
BIN
src/assets/images/chart/informations/video.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.2 KiB |
@ -9,8 +9,6 @@ export const option = {
|
||||
dataset: video,
|
||||
// 循环播放
|
||||
loop: true,
|
||||
// 自动播放
|
||||
autoplay: true,
|
||||
// 静音
|
||||
muted: true,
|
||||
// 适应方式
|
||||
|
@ -9,9 +9,6 @@
|
||||
</setting-item-box>
|
||||
|
||||
<setting-item-box name="控制">
|
||||
<setting-item>
|
||||
<n-checkbox v-model:checked="optionData.autoplay" size="small">自动播放</n-checkbox>
|
||||
</setting-item>
|
||||
<setting-item>
|
||||
<n-checkbox v-model:checked="optionData.loop" size="small">循环播放</n-checkbox>
|
||||
</setting-item>
|
||||
|
@ -1,5 +1,5 @@
|
||||
import image from '@/assets/images/chart/informations/photo.png'
|
||||
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
|
||||
import image from '@/assets/images/chart/informations/video.png'
|
||||
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
|
||||
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
|
||||
|
||||
export const VideoConfig: ConfigType = {
|
||||
@ -10,5 +10,6 @@ export const VideoConfig: ConfigType = {
|
||||
category: ChatCategoryEnum.MORE,
|
||||
categoryName: ChatCategoryEnumName.MORE,
|
||||
package: PackagesCategoryEnum.INFORMATIONS,
|
||||
chartFrame: ChartFrameEnum.ECHARTS,
|
||||
image
|
||||
}
|
||||
|
@ -7,8 +7,8 @@
|
||||
preload="auto"
|
||||
crossOrigin="anonymous"
|
||||
playsinline
|
||||
autoplay
|
||||
:loop="option.loop"
|
||||
:autoplay="option.autoplay"
|
||||
:muted="option.muted"
|
||||
:width="w"
|
||||
:height="h"
|
||||
@ -47,12 +47,8 @@ watch(
|
||||
if (!vVideoRef.value) return
|
||||
const video: any = vVideoRef.value
|
||||
video.loop = option.loop
|
||||
video.autoplay = option.autoplay
|
||||
video.muted = option.muted
|
||||
|
||||
// 控制是否播放还是停止在第一帧
|
||||
!option.autoplay && (video.pause(), (video.currentTime = 0))
|
||||
option.autoplay && video.play()
|
||||
video.play()
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
|
Loading…
Reference in New Issue
Block a user