feat: complete player
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<van-nav-bar :title="item.title" left-text="返回" left-arrow @click-left="onClickLeft" />
|
<van-nav-bar :title="item.title" left-text="返回" left-arrow @click-left="onClickLeft" />
|
||||||
<video id="video" :poster="item.poster"></video>
|
<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">
|
<template v-if="false === item.bought">
|
||||||
<van-notice-bar left-icon="volume-o" text="未购买的视频、音频默认播放时长为1分钟左右。" />
|
<van-notice-bar left-icon="volume-o" text="未购买的视频、音频默认播放时长为1分钟左右。" />
|
||||||
@@ -17,7 +18,7 @@
|
|||||||
<template v-if="playing">
|
<template v-if="playing">
|
||||||
<van-row>
|
<van-row>
|
||||||
<van-col span="24">
|
<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-col>
|
||||||
</van-row>
|
</van-row>
|
||||||
</template>
|
</template>
|
||||||
@@ -66,6 +67,8 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
player.addEventListener('pause', () => {
|
player.addEventListener('pause', () => {
|
||||||
playing.value = false;
|
playing.value = false;
|
||||||
|
player.currentTime = 0;
|
||||||
|
currentTime.value = 0;
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user