feat: complete player

This commit is contained in:
Rogee
2024-12-12 10:44:37 +08:00
parent 25a878e35d
commit acd827c346

View File

@@ -1,6 +1,7 @@
<template>
<van-nav-bar :title="item.title" left-text="返回" left-arrow @click-left="onClickLeft" />
<video id="video" :poster="item.poster"></video>
<van-progress v-if="playing" :percentage="100 * currentTime / item.duration" stroke-width="8" :show-pivot="false" />
<template v-if="false === item.bought">
<van-notice-bar left-icon="volume-o" text="未购买的视频、音频默认播放时长为1分钟左右。" />
@@ -17,7 +18,7 @@
<template v-if="playing">
<van-row>
<van-col span="24">
<van-button round type="danger" @click="stop()" size="large" block>结束播放</van-button>
<van-button type="danger" @click="stop()" size="large" block>结束播放</van-button>
</van-col>
</van-row>
</template>
@@ -66,6 +67,8 @@ onMounted(() => {
});
player.addEventListener('pause', () => {
playing.value = false;
player.currentTime = 0;
currentTime.value = 0;
});
})