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

support custom player mode, support play mp3 with a custom player server #121

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jadepeng
Copy link
Contributor

支持设置播放器模式
支持通过播放服务器播放MP3,设置为服务器播放后,无需每次激活。

@@ -27,7 +27,7 @@ For more information, please read the [documentation](https://saekiraku.github.i
2. Press `Ctrl + Shift + P`(MacOS `Command + Shift + P`)to bring up `Command Panel`.
3. Type `> Enable Rainbow Fart` into `Command Panel`.
4. A notification should be popped up at the corner. Click `Open` on that notification.
5. Click `Authorization` on the opened page.
5. Set player type, defaul mode is `web` (play with web browser), you can click `Authorization` on the opened page to active player. you can aso set player type to `server`, this mode send play request to a websocket mp3 server, you can get a server app from [jadepeng/mp3player](https://github.com/jadepeng/mp3player/releases)
Copy link
Owner

Choose a reason for hiding this comment

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

我觉得默认情况下,保持 Web 播放音频即可。Keep it simple and stupid,上手步骤越少越好。可以在文档增加一个 外部播放器 章节进行详细说明。

@@ -53,6 +53,7 @@
"jszip": "^3.4.0",
"lodash": "^4.17.15",
"multer": "^1.4.2",
"nodejs-websocket": "^1.7.2",
Copy link
Owner

Choose a reason for hiding this comment

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

我认为 WebSocket 其实是没有必要的,因为正常写代码不会达到如此高频次的关键词触发,即便有高频的情况,我们也需要等待音频播放完成后再播放下一个音频,否则什么都听不见了。所以,WebSocket 的及时通信的能力,在此处并没有发挥很大的作用,而引入它还增加了项目的复杂度。

@SaekiRaku
Copy link
Owner

感谢您的贡献!Golang Player 确实对于 Issue #34 做出了很大的推进,但是仍有一些细节问题需要我们进一步修改。

首先是 WebSocket 的使用增加了项目的复杂度、还要额外制定通信内容的结构,且特定的结构设计降低了该功能的通用性。以及 WebSocket 的即时通信的能力在当前使用场景上,并没有体现出很大的优势。

其次,由于一些系统本身自带了可播放音频的命令,比如 MacOS 的 play。此时 MacOS 的用户如果想使用外部音频播放,其实是只需要更少的步骤的(不需要额外下载依赖库)。因此,外部播放器功能的通用性或许可以让用户使用的更方便一些。

下面是我目前构想的设计图,用户只需要配置命令格式即可,例如:ffplay -nodisp -autoexit -loglevel quiet ${sound} 外部播放器功能会替换命令中的 ${} 变量,然后执行播放。

您可以在 https://saekiraku.github.io/vscode-rainbow-fart-design/preview/ 上查看详细的设计标注(尺寸、距离等等)

QQ20200716-111702@2x

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