Skip to content

Commit 83337db

Browse files
committed
✨ 支持调用各种本地播放器
1 parent 27ad3ec commit 83337db

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

src/components/VideoPlayer.vue

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,50 @@
2222
},
2323
subtitle: null,
2424
autoplay: false,
25+
contextmenu: [
26+
{
27+
text: '下载',
28+
click: (player) => {
29+
window.open(player.video.src)
30+
},
31+
},
32+
{
33+
text: '使用 PotPlayer 打开',
34+
click: (player) => {
35+
window.location = 'potplayer://' +player.video.src
36+
},
37+
},
38+
{
39+
text: '使用 IINA 打开',
40+
click: (player) => {
41+
window.location = 'iina://weblink?url=' +player.video.src
42+
},
43+
},
44+
{
45+
text: '使用 VLC 打开',
46+
click: (player) => {
47+
window.location = 'vlc://' +player.video.src
48+
},
49+
},
50+
{
51+
text: '使用 nPlayer 打开',
52+
click: (player) => {
53+
window.location = 'nplayer-' +player.video.src
54+
},
55+
},
56+
{
57+
text: '使用 MXPlayer(Free) 打开',
58+
click: (player) => {
59+
window.location = 'intent:' +player.video.src + '#Intent;package=com.mxtech.videoplayer.ad;S.title=video;end'
60+
},
61+
},
62+
{
63+
text: '使用 MXPlayer(Pro) 打开',
64+
click: (player) => {
65+
window.location = 'intent:' +player.video.src + '#Intent;package=com.mxtech.videoplayer.pro;S.title=video;end'
66+
},
67+
},
68+
]
2569
},
2670
player: null,
2771
}
@@ -89,4 +133,8 @@
89133
height: 35vh;
90134
}
91135
}
136+
137+
.dplayer-menu.dplayer-menu-show {
138+
width: 180px;
139+
}
92140
</style>

0 commit comments

Comments
 (0)