I want to code a snippet / module in python that opens up a VLC player on a specific display / monitor and plays a specific file.
I use the package python-vlc, and I succesfully managed to play a video file using the package:
import vlc
vlc_options = "--embedded-video --no-audio --fullscreen"
vlc_instance = vlc.Instance(vlc_options)
# vlc.Instance.url = filepath
player = vlc_instance.media_player_new()
player.set_mrl(filepath)
player.set_fullscreen(True)
player.play()
while True:
pass
I searched everywhere in the documentation but I did not find anything useful, on how I could choose a specific display to start the media instance on.
https://www.olivieraubert.net/vlc/python-ctypes/doc/
https://wiki.videolan.org/python_bindings
And neither succeeded using the CLI commands:
https://wiki.videolan.org/VLC_command-line_help/
What I found is the following:
To some extent you might have some luck to control this by going to Tools --> Preference --> Video --> Fullscreen Video Device --> Here you choose the display you want in VLC software. It depends as well on the output mode. You need to try them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With