|
|
@@ -58,6 +58,23 @@
|
|
|
</v-btn>
|
|
|
</v-form>
|
|
|
</v-dialog>
|
|
|
+ <v-snackbar
|
|
|
+ v-model="showMessage"
|
|
|
+ :top="true"
|
|
|
+ :timeout="1000"
|
|
|
+ >
|
|
|
+ {{ message }}
|
|
|
+ <template v-slot:action="{ attrs }">
|
|
|
+ <v-btn
|
|
|
+ color="pink"
|
|
|
+ text
|
|
|
+ v-bind="attrs"
|
|
|
+ @click="showMessage = false"
|
|
|
+ >
|
|
|
+ 关闭
|
|
|
+ </v-btn>
|
|
|
+ </template>
|
|
|
+ </v-snackbar>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -93,7 +110,9 @@ export default {
|
|
|
getUrl: false,
|
|
|
permissionDialog: false,
|
|
|
authCodeDialog: false,
|
|
|
- authCode: null
|
|
|
+ authCode: null,
|
|
|
+ showMessage: false,
|
|
|
+ message: ''
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -136,11 +155,12 @@ export default {
|
|
|
for (const url of urls) {
|
|
|
url.type = 'normal'
|
|
|
}
|
|
|
- this.initMp4Player(this.userPermission.userId, videoId, this.videoProp.coverUrl, urls, 0)
|
|
|
+ this.initMp4Player(this.userPermission.userId, videoId, this.videoProp.coverUrl, urls, res.data.currentTime)
|
|
|
} else if (urlType === 'flv') {
|
|
|
// this.initFlvPlayer(videoId, coverUrl, urls)
|
|
|
} else {
|
|
|
- alert('url 类型无法识别')
|
|
|
+ this.message = 'url 类型无法识别'
|
|
|
+ this.showMessage = true
|
|
|
}
|
|
|
} else {
|
|
|
console.error(res.msg)
|
|
|
@@ -157,7 +177,7 @@ export default {
|
|
|
container: document.querySelector('#dplayer'),
|
|
|
lang: 'zh-cn',
|
|
|
logo: '/logo.png',
|
|
|
- autoplay: false,
|
|
|
+ autoplay: true,
|
|
|
screenshot: false,
|
|
|
video: {
|
|
|
pic: coverUrl,
|
|
|
@@ -179,13 +199,12 @@ export default {
|
|
|
|
|
|
// 跳转到上次看到的位置
|
|
|
player.seek(pos)
|
|
|
-
|
|
|
player.on('progress', function() {
|
|
|
- SocketInstance.send({ userId: userId, videoId: videoId, currentTime: player.video.currentTime })
|
|
|
+ SocketInstance.send({ videoId: videoId, currentTime: player.video.currentTime })
|
|
|
})
|
|
|
|
|
|
player.on('ended', function() {
|
|
|
- SocketInstance.send({ userId: userId, videoId: videoId, currentTime: player.video.currentTime })
|
|
|
+ SocketInstance.send({ videoId: videoId, currentTime: player.video.currentTime })
|
|
|
// TODO 当前视频播放完成后判断是否继续播放相关推荐中的视频
|
|
|
console.log('视频播放完成')
|
|
|
})
|