feat: complete player
This commit is contained in:
@@ -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;
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user