Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

diannaojiang
Copy link

添加了自定义组件,可以把当前视频发送到本地播放器MPV进行播放,借此可以实现调用补帧、超分、滤镜等更多操作。
使用需要配置本地环境,可以参考Bilibili-Playin-Mpv进行设置

添加了自定义组件,可以把当前视频发送到本地播放器MPV进行播放,借此可以实现调用补帧、超分、滤镜等更多操作。
Comment on lines +4 to +20
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)
},
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不对劲吧, 是不是这里才是 mpv 播放的关键, 其他都是复制 download-video 组件的?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的 基本上就是改了下下载组件 然后调用Application URL来唤起本地程序。 之前老版本的时候只有自己在用,现在改成通配之后唤起的exe好像还有些问题 还在调整。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那应该做个插件就行了, 不用复制这么多代码的, 我明天写个例子给你试试看能不能用

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的 谢谢~

@the1812
Copy link
Owner

the1812 commented Dec 8, 2021

你直接在插件里用这个链接安装试试

https://github.com/the1812/Bilibili-Evolved/files/7673537/mpv-output.zip

image

@diannaojiang
Copy link
Author

已确认 没有问题,非常感谢。

@the1812
Copy link
Owner

the1812 commented Dec 8, 2021

好的, 那这个会作为一个插件推出, 描述里会放你的仓库链接 Bilibili-Playin-Mpv, 这个 PR 我就关掉了

@the1812 the1812 closed this Dec 8, 2021
the1812 added a commit that referenced this pull request Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants