diff --git a/src/components/Play.vue b/src/components/Play.vue
index b09a636..a75aa8d 100644
--- a/src/components/Play.vue
+++ b/src/components/Play.vue
@@ -3,17 +3,6 @@
『第 {{(video.info.index + 1)}} 集』{{name}}
-
-
-
-
-
-
@@ -66,8 +55,14 @@
+
+
+
@@ -89,6 +84,14 @@
+
+
+
上次播放到【{{right.history[0].site}}】{{right.history[0].name}} 第{{right.history[0].index+1}}集
@@ -301,6 +304,9 @@ export default {
methods: {
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE']),
async getUrls () {
+ if (this.video.key === '') {
+ return false
+ }
this.name = ''
if (this.timer !== null) {
clearInterval(this.timer)
@@ -1073,18 +1079,17 @@ export default {
let timerID
ev.forEach(item => {
this.xg.root.addEventListener(item, () => {
- if (!this.xg.fullscreen) {
- return
+ if (this.xg && this.xg.fullscreen) {
+ const videoTitle = document.querySelector('.xg-view-videoTitle')
+ videoTitle.style.display = 'block'
+ clearTimeout(timerID)
+ timerID = setTimeout(() => {
+ // 播放中自动消失
+ if (this.xg && !this.xg.paused) {
+ videoTitle.style.display = 'none'
+ }
+ }, 3000)
}
- const videoTitle = document.querySelector('.xg-view-videoTitle')
- videoTitle.style.display = 'block'
- clearTimeout(timerID)
- timerID = setTimeout(() => {
- // 播放中自动消失
- if (this.xg && !this.xg.paused) {
- videoTitle.style.display = 'none'
- }
- }, 3000)
})
})
@@ -1096,6 +1101,8 @@ export default {
if (this.xg.fullscreen) {
this.xg.exitFullscreen()
}
+ clearInterval(this.timer)
+ this.video.key = ''
this.xg.src = ''
this.config.src = ''
this.xg.destroy(false)
@@ -1103,6 +1110,7 @@ export default {
this.name = ''
this.right.list = []
this.showNext = false
+ this.getAllhistory()
setTimeout(() => {
this.xg = new Hls(this.config)
this.playerInstall()