-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add components: play in mpv #2605
Conversation
添加了自定义组件,可以把当前视频发送到本地播放器MPV进行播放,借此可以实现调用补帧、超分、滤镜等更多操作。
export const toastOutput: PlayMpvOutput = { | ||
name: 'consoleLogDemo', | ||
displayName: 'Toast', | ||
description: '弹一条消息显示出播放按钮,点击即可使用MPV进行播放', | ||
runAction: async action => { | ||
const fragments = action.infos.flatMap(it => it.titledFragments) | ||
const urls = fragments.map(f => f.url).join('\n') | ||
const mpv = 'mpv://--http-header-fields=\"referer:https://www.bilibili.com/\" \"' + fragments[0].url + '\" --audio-file=\"' + fragments[1].url + '\"'; | ||
console.log(mpv); | ||
Toast.show( | ||
`<a class="link" href="${encodeURI(mpv)}" >播放</a>`, | ||
'MPV播放', | ||
) | ||
console.log(urls) | ||
console.log(action) | ||
}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不对劲吧, 是不是这里才是 mpv 播放的关键, 其他都是复制 download-video 组件的?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的 基本上就是改了下下载组件 然后调用Application URL来唤起本地程序。 之前老版本的时候只有自己在用,现在改成通配之后唤起的exe好像还有些问题 还在调整。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那应该做个插件就行了, 不用复制这么多代码的, 我明天写个例子给你试试看能不能用
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的 谢谢~
已确认 没有问题,非常感谢。 |
好的, 那这个会作为一个插件推出, 描述里会放你的仓库链接 Bilibili-Playin-Mpv, 这个 PR 我就关掉了 |
添加了自定义组件,可以把当前视频发送到本地播放器MPV进行播放,借此可以实现调用补帧、超分、滤镜等更多操作。
使用需要配置本地环境,可以参考Bilibili-Playin-Mpv进行设置