【发布时间】:2022-12-05 21:51:21
【问题描述】:
我正在使用 libvlc 来控制来自 python 的 vlc isntance,它运行良好。 我找不到的选项是“总是在最前面”。我可以通过迷你实例的菜单来设置它。但我想从代码中设置它。任何想法? 谢谢
导入时间,vlc
播放视频的方法
def video2(来源): # 创建 vlc 媒体播放器对象 media_player = vlc.MediaPlayer()
# media object
media = vlc.Media(source)
# setting media to the media player
media_player.set_media(media)
# setting video scale
media_player.video_set_scale(0.6)
media_player.audio_set_mute(True)
# setting play rate
# doubles the speed of the video
media_player.set_rate(1.5)
# start playing video
media_player.play()
# wait so the video can be played for 5 seconds
# irrespective for length of video
time.sleep(5)
return media_player
【问题讨论】:
-
这是一个 UI/OS 问题,而不是真正的 libvlc 函数
-
你确定吗?因为你可以通过 media_player.video_set_scale(0.6) 定义窗口播放器的大小我假设它是一样的。