Reputation: 31
So my code is below
player = vlc.Instance()
player.set_user_agent("https","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0")
media_list = player.media_list_new()
media_player = player.media_list_player_new()
media = player.media_new(source)
media_list.add_media(media)
media_player.set_media_list(media_list)
media_player.play()
time.sleep(5)
I'm making a gui python application and the live stream plays fine, it opens a vlc player window and plays the stream, the issue is when I click the X to try and quit it playing, nothing happens. I have to CTRL-ALT-DEL the window the get it to stop playing. Because it's a live stream I can't get video length to make the player quit when finished playing, plus I would like the ability to close the video even if the stream hasn't finished playing.
Any help would be appreciated as I just don't understand why clicking the X won't stop the player from playing.
TIA
Tried clicking the X but the player won't quit
Upvotes: 0
Views: 124
Reputation: 11295
The interface itself is not really functional, try shutting down your Python script, it will kill the vlc process.
Upvotes: 0