From 23e5c569b1a722038656c2e7a5073fff8f892d59 Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Tue, 10 Nov 2020 22:04:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4Play=E7=9B=B4=E6=92=AD?= =?UTF-8?q?=E6=97=B6=E6=92=AD=E6=94=BE=E5=99=A8=E4=B8=8B=E6=96=B9=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=EF=BC=8C=E6=94=AF=E6=8C=81=E4=BD=BF=E7=94=A8=E7=AC=AC?= =?UTF-8?q?=E4=B8=89=E6=96=B9=E6=92=AD=E6=94=BE=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Play.vue | 52 ++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/src/components/Play.vue b/src/components/Play.vue index f7b236f..5fd7e98 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -7,7 +7,7 @@
-
+
换源 @@ -100,13 +100,28 @@ 上次播放到【{{right.history[0].site}}】{{right.history[0].name}} 第{{right.history[0].index+1}}集
+
+ + + 使用第三方播放器 + + + + + + + 快捷键指南 + + + +
播放列表 历史记录 - 快捷键指南 + 快捷键指南{{ this.video.iptv ? '(直播时部分功能不可用)' : '' }} 同组其他源的视频 @@ -336,8 +351,7 @@ export default { if (this.video.iptv) { // 是直播源,直接播放 - this.playUrl(this.video.iptv.url) - this.name = this.video.iptv.name + this.playChannel(this.video.iptv) this.getIptvList() } else { const index = this.video.info.index | 0 @@ -354,8 +368,10 @@ export default { this.playVideo(index, time) } }, - playUrl (url) { - this.xg.src = url + playChannel (channel) { + this.video.iptv = channel + this.name = channel.name + this.xg.src = channel.url this.xg.play() }, playVideo (index = 0, time = 0) { @@ -486,7 +502,7 @@ export default { if (index >= 1) { var channel = this.iptvList[index - 1] this.video.iptv = channel - this.playUrl(channel.url) + this.playChannel(channel) } else { this.$message.warning('这已经是第一个频道了。') } @@ -505,7 +521,7 @@ export default { if (index < (this.iptvList.length - 1)) { var channel = this.iptvList[index + 1] this.video.iptv = channel - this.playUrl(channel.url) + this.playChannel(channel) } else { this.$message.warning('这已经是最后一个频道了。') } @@ -630,8 +646,23 @@ export default { this.$message.success('视频信息复制成功') }, playWithExternalPalyerEvent () { + const fs = require('fs') + if (this.video.iptv) { + var externalPlayer = this.setting.externalPlayer + if (!externalPlayer) { + this.$message.error('请设置第三方播放器路径') + return + } + if (fs.existsSync(externalPlayer)) { + var execFile = require('child_process').execFile + execFile(externalPlayer, [this.video.iptv.url]) + } else { + var exec = require('child_process').exec + exec(externalPlayer, [this.video.iptv.url]) + } + return + } this.fetchM3u8List().then(m3u8Arr => { - const fs = require('fs') var externalPlayer = this.setting.externalPlayer if (!externalPlayer) { this.$message.error('请设置第三方播放器路径') @@ -729,9 +760,8 @@ export default { if (this.video.iptv) { var channel = this.iptvList[n] this.video.iptv = channel - this.name = this.video.iptv.name // 是直播源,直接播放 - this.playUrl(channel.url) + this.playChannel(channel) } else { this.video.info.time = 0 this.video.info.index = n