TA的每日心情 | 慵懒 2022-3-6 15:37 |
---|
签到天数: 4 天 [LV.2]偶尔看看I
荣誉会员
   
- 积分
- 142835

|
本帖最后由 shadows 于 2021-9-1 19:56 编辑
百分百复现啊
我使用全新下载的mpv.net beta版本(最新的5.4.9.7-portable-beta),新建portable_config空文件夹。启动mpv.net,拖入视频,视频立刻开始播放,关闭。
在mpv.conf末尾添加pause = yes,新建scripts文件夹,放入ontop_playback.lua。
双击mpv.net的exe文件,拖入视频,视频处于暂停状态,右键view-ontop-enable。窗口置顶
期望:此时是暂停状态,窗口不置顶。
portable_config.zip
(4.36 KB, 下载次数: 14)
mpv.conf:
- input-default-bindings = no
- input-ar-delay = 500
- input-ar-rate = 20
- keep-open = yes
- keep-open-pause = no
- osd-duration = 2000
- osd-playing-msg = '${filename}'
- script-opts = osc-scalewindowed=1.5,osc-hidetimeout=2000,console-scale=1
- screenshot-directory = '~~desktop/'
- watch-later-options = start
- pause = yes
复制代码
我猜测是脚本只监视了pause值的变化,没考虑开始时就是暂停的情况
个人修改:
在原脚本后增加以下内容,实现:暂停状态下即使手动置顶也暂不生效,播放时会置顶=》暂停时一定是不置顶状态
- mp.observe_property("ontop", "bool", function(name, value)
- local pause = mp.get_property_bool("pause")
- if value and pause then
- mp.set_property_native("ontop", false)
- was_ontop = true
- end
- end)
复制代码
|
|