From 1ebdfee7bc78175e5957fd97b195b63a3c18ee65 Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Sat, 3 Oct 2020 23:17:19 +0200 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=92=AD=E6=94=BE=E5=99=A8?= =?UTF-8?q?=E5=86=85=E6=92=AD=E6=94=BE=E7=9B=B4=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/IPTV.vue | 23 ++++++------- src/components/Play.vue | 28 ++++++++++------ src/lib/dexie/initData.js | 68 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 23 deletions(-) diff --git a/src/components/IPTV.vue b/src/components/IPTV.vue index 07c8c40..9c7d285 100644 --- a/src/components/IPTV.vue +++ b/src/components/IPTV.vue @@ -96,6 +96,14 @@ export default { }, setting () { return this.$store.getters.getSetting + }, + video: { + get () { + return this.$store.getters.getVideo + }, + set (val) { + this.SET_VIDEO(val) + } } }, watch: { @@ -106,19 +114,8 @@ export default { methods: { ...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE']), playEvent (e) { - var m3u8Link = e.url - const fs = require('fs') - var externalPlayer = this.setting.externalPlayer - if (!fs.existsSync(externalPlayer)) { - this.$message.error('请设置第三方播放器路径') - // 在线播放该视频 - var link = 'https://www.m3u8play.com/?play=' + m3u8Link - const open = require('open') - open(link) - } else { - var exec = require('child_process').execFile - exec(externalPlayer, [m3u8Link]) - } + this.video = { info: { url: e.url } } + this.view = 'Play' }, removeEvent (e) { iptv.remove(e.id).then(res => { diff --git a/src/components/Play.vue b/src/components/Play.vue index ea3e955..aee19f0 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -297,17 +297,25 @@ export default { } } - const index = this.video.info.index | 0 - let time = 0 - - history.find({ site: this.video.key, ids: this.video.info.id }).then(res => { - if (res) { - if (res.index === index) { - time = res.time + if (this.video.info.url) { + this.playUrl(this.video.info.url) + } else { + const index = this.video.info.index | 0 + let time = 0 + history.find({ site: this.video.key, ids: this.video.info.id }).then(res => { + if (res) { + if (res.index === index) { + time = res.time + } } - } - this.playVideo(index, time) - }) + this.playVideo(index, time) + }) + } + }, + playUrl (url) { + this.$message.success(url) + this.xg.src = url + this.xg.play() }, playVideo (index = 0, time = 0) { this.fetchM3u8List().then(m3u8Arr => { diff --git a/src/lib/dexie/initData.js b/src/lib/dexie/initData.js index 1f9fc10..86585ad 100644 --- a/src/lib/dexie/initData.js +++ b/src/lib/dexie/initData.js @@ -281,6 +281,74 @@ const getSite = (key) => { } const iptv = [ + { + name: 'CCTV-1', + url: 'http://112.50.243.8/PLTV/88888888/224/3221225922/1.m3u8' + }, + { + name: 'CCTV-2', + url: 'http://112.50.243.8/PLTV/88888888/224/3221225923/1.m3u8' + }, + { + name: 'CCTV-3', + url: 'http://117.169.124.36:6610/ysten-businessmobile/live/cctv-3/1.m3u8' + }, + { + name: 'CCTV-4', + url: 'http://111.13.111.242/otttv.bj.chinamobile.com/PLTV/88888888/224/3221226314/1.m3u8' + }, + { + name: 'CCTV-5', + url: 'http://112.17.40.145/PLTV/88888888/224/3221226687/index.m3u8' + }, + { + name: 'CCTV-6', + url: 'http://117.169.124.36:6610/ysten-businessmobile/live/cctv-6/1.m3u8' + }, + { + name: 'CCTV-7', + url: 'http://111.13.111.242/otttv.bj.chinamobile.com/PLTV/88888888/224/3221226234/1.m3u8' + }, + { + name: 'CCTV-8', + url: 'http://117.169.124.36:6610/ysten-businessmobile/live/cctv-8/1.m3u8' + }, + { + name: 'CCTV-9', + url: 'http://112.50.243.8/PLTV/88888888/224/3221225820/1.m3u8' + }, + { + name: 'CCTV-10', + url: 'http://ott.fj.chinamobile.com/PLTV/88888888/224/3221225814/1.m3u8' + }, + { + name: 'CCTV-11', + url: 'http://ott.fj.chinamobile.com/PLTV/88888888/224/3221225815/1.m3u8' + }, + { + name: 'CCTV-12', + url: 'http://112.50.243.8/PLTV/88888888/224/3221225816/1.m3u8' + }, + { + name: 'CCTV-13', + url: 'http://223.110.241.130:6610/gitv/live1/G_CCTV-13-HQ/.m3u8' + }, + { + name: 'CCTV-4K', + url: 'http://117.148.187.83/PLTV/88888888/224/3221226758/index.m3u8' + }, + { + name: '山东卫视', + url: 'http://ivi.bupt.edu.cn/hls/sdhd.m3u8' + }, + { + name: '湖北卫视', + url: 'http://ivi.bupt.edu.cn/hls/hbhd.m3u8' + }, + { + name: '安徽卫视', + url: 'http://ivi.bupt.edu.cn/hls/ahhd.m3u8' + }, { name: '東森新聞', url: 'http://lss.line-scdn.net/cc_tw/p/live/hPFcU2yqYDmgJQRB4NlQTX2UtVl4kHRpsax1DCy8sUQ0jTx07Zh9CB38rVlgmGU05YEpIWnosVF82HRo3Z0JBDH0yUVhsH0o9fU5GEHIuWllyHUE-/720/chunklist.m3u8'