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,
|
dataset: video,
|
||||||
// 循环播放
|
// 循环播放
|
||||||
loop: true,
|
loop: true,
|
||||||
// 自动播放
|
|
||||||
autoplay: true,
|
|
||||||
// 静音
|
// 静音
|
||||||
muted: true,
|
muted: true,
|
||||||
// 适应方式
|
// 适应方式
|
||||||
|
@ -9,9 +9,6 @@
|
|||||||
</setting-item-box>
|
</setting-item-box>
|
||||||
|
|
||||||
<setting-item-box name="控制">
|
<setting-item-box name="控制">
|
||||||
<setting-item>
|
|
||||||
<n-checkbox v-model:checked="optionData.autoplay" size="small">自动播放</n-checkbox>
|
|
||||||
</setting-item>
|
|
||||||
<setting-item>
|
<setting-item>
|
||||||
<n-checkbox v-model:checked="optionData.loop" size="small">循环播放</n-checkbox>
|
<n-checkbox v-model:checked="optionData.loop" size="small">循环播放</n-checkbox>
|
||||||
</setting-item>
|
</setting-item>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import image from '@/assets/images/chart/informations/photo.png'
|
import image from '@/assets/images/chart/informations/video.png'
|
||||||
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
|
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
|
||||||
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
|
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
|
||||||
|
|
||||||
export const VideoConfig: ConfigType = {
|
export const VideoConfig: ConfigType = {
|
||||||
@ -10,5 +10,6 @@ export const VideoConfig: ConfigType = {
|
|||||||
category: ChatCategoryEnum.MORE,
|
category: ChatCategoryEnum.MORE,
|
||||||
categoryName: ChatCategoryEnumName.MORE,
|
categoryName: ChatCategoryEnumName.MORE,
|
||||||
package: PackagesCategoryEnum.INFORMATIONS,
|
package: PackagesCategoryEnum.INFORMATIONS,
|
||||||
|
chartFrame: ChartFrameEnum.ECHARTS,
|
||||||
image
|
image
|
||||||
}
|
}
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
preload="auto"
|
preload="auto"
|
||||||
crossOrigin="anonymous"
|
crossOrigin="anonymous"
|
||||||
playsinline
|
playsinline
|
||||||
|
autoplay
|
||||||
:loop="option.loop"
|
:loop="option.loop"
|
||||||
:autoplay="option.autoplay"
|
|
||||||
:muted="option.muted"
|
:muted="option.muted"
|
||||||
:width="w"
|
:width="w"
|
||||||
:height="h"
|
:height="h"
|
||||||
@ -47,12 +47,8 @@ watch(
|
|||||||
if (!vVideoRef.value) return
|
if (!vVideoRef.value) return
|
||||||
const video: any = vVideoRef.value
|
const video: any = vVideoRef.value
|
||||||
video.loop = option.loop
|
video.loop = option.loop
|
||||||
video.autoplay = option.autoplay
|
|
||||||
video.muted = option.muted
|
video.muted = option.muted
|
||||||
|
video.play()
|
||||||
// 控制是否播放还是停止在第一帧
|
|
||||||
!option.autoplay && (video.pause(), (video.currentTime = 0))
|
|
||||||
option.autoplay && video.play()
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user