mpv danmaku plugin powered by dandanplay API. The plugin sends the name and hash value of the currently playing file to the dandanplay server to get matching danmaku comments.
- build by yourself
cargo build --release
- download prebuilt package from release
Copy the .dll
/.so
file to the scripts
subdirectory of your mpv configuration directory.
Example to bind the d
key to toggle the danmaku visibility in your input.conf
(default invisible):
d script-message toggle-danmaku
If you use uosc, you can add an icon by adding <video>command:clear_all:script-message toggle-danmaku?Danmaku Switch
to uosc.conf controls
.
It may take some time to load the danmaku after first enabling it.
Set the following options in script-opts/danmaku.conf
to configure the plugin:
font_size=40
: danmaku font size.transparency=48
: 0 (opaque) to 255 (fully transparent).reserved_space=0
: the proportion of reserved space at the bottom of the screen, 0.0 to 1.0 (excluded).speed=1.0
: factor for the speed.no_overlap=yes
: hide the overlapping danmaku,yes
orno
.proxy=http://127.0.0.1:8080
: add proxy for requests, default blankuser_agent=libmpv
: add user-agent for network requests, defaultlibmpv
log=false
:true/on/enable
will enable logging to file, defaultfalse
, log_file~~/files/danmu.log
filter=keyword1,keyword2
: comma separated keywords, danmaku that contains any of them will be blocked.filter_source=bilibili,gamer
: comma separated case-insensitive sources (bilibili
,gamer
,acfun
,qq
,iqiyi
,d
ordandan
), danmaku from any of them will be blocked, runtime updatable viascript-opts
option/property.filter_bilibili=~~/files/bilibili.json
: filter file exported from bilibili, regex/user based blocking is not supported, double-tilde placeholders are expanded.
Available script messages:
toggle-danmaku
: toggles the danmaku visibility.danmaku-delay <seconds>
: delays danmaku by <seconds> seconds, can be negative.