Anyone to help me?
I'd just like the new media to always be opened in the same VLC window.
Because right now, sometimes, it closes the old one and opens a new one, which
makes my other software lose the focus on the VLC window.
Please? It can't be hard.
Edit: A bit more of the code.
Code: Select all
import vlc, time
i = vlc.Instance()
player = i.media_player_new()
player.set_media(i.media_new("path/to/media")
player.play()
time.sleep(5)
player.set_media(i.media_new("path/to/other/media") # The media has different resolution and encoding
player.play() # If I don't put this, the old media will just freeze and nothing happens
time.sleep(5)
And this is at the second play() call that the VLC window will sometimes close, and re-open for the new media, which causes my other program to lose the focus on it.
I don't really know what are the reasons behind this. I don't think it has something to do with the video's resolution. It might be the encoding, because I don't think the container has something to do with it either.