diff --git a/src/components/IPTV.vue b/src/components/IPTV.vue
index 4f6372a..a0528b1 100644
--- a/src/components/IPTV.vue
+++ b/src/components/IPTV.vue
@@ -225,7 +225,7 @@ export default {
this.updateDatabase()
},
playEvent (e) {
- this.video = { iptv: { name: e.name, url: e.url } }
+ this.video = { iptv: { name: e.name, url: e.url, id: e.id } }
this.view = 'Play'
},
containsearchTxt (i) {
diff --git a/src/components/Play.vue b/src/components/Play.vue
index 5fd7e98..0070e25 100644
--- a/src/components/Play.vue
+++ b/src/components/Play.vue
@@ -101,6 +101,14 @@
上次播放到【{{right.history[0].site}}】{{right.history[0].name}} 第{{right.history[0].index+1}}集
+
+
+
@@ -218,6 +231,7 @@ export default {
history: [],
shortcut: [],
other: [],
+ otherChannels: [],
currentTime: 0
},
config: {
@@ -819,10 +833,15 @@ export default {
})
},
otherEvent (m) {
- this.right.type = 'other'
- this.getOtherSites()
+ if (!this.video.iptv) {
+ this.right.type = 'other'
+ this.getOtherSites()
+ this.right.currentTime = this.xg.currentTime
+ } else {
+ this.right.type = 'otherChannels'
+ this.getIptvList()
+ }
this.right.show = true
- this.right.currentTime = this.xg.currentTime
},
async otherItemEvent (e) {
// 打开当前播放的剧集index, 定位到当前的时间
@@ -1083,6 +1102,20 @@ export default {
getIptvList () {
iptv.all().then(res => {
this.iptvList = res.filter(e => e.isActive)
+ this.right.otherChannels = []
+ const iptvList = JSON.parse(JSON.stringify(this.iptvList))
+ const index = this.video.iptv.id - 1
+ var currentChannelName = this.video.iptv.name.trim().replace(/[- ]?(1080p|蓝光|超清|高清|标清|hd|cq|4k)(\d{1,2})?/i, '')
+ if (currentChannelName.match(/cctv/i)) currentChannelName = currentChannelName.replace('-', '')
+ const matchRule = new RegExp(`${currentChannelName}(1080p|4k|(?!\\d))`, 'i')
+ for (var i = 0; i < iptvList.length; i++) {
+ if (iptvList[i].name.match(/cctv/i)) {
+ iptvList[i].name = iptvList[i].name.replace('-', '')
+ }
+ if (matchRule.test(iptvList[i].name) && i !== index) {
+ this.right.otherChannels.push(this.iptvList[i])
+ }
+ }
})
},
bindEvent () {