简体   繁体   中英

Quit VLC if already running

I am having a weird problem with VLC in Python. Using the following things.

import vlc

self.Instance = vlc.Instance()
self.List = self.Instance.media_list_new()
self.Player_d = self.Instance.media_list_player_new()

I am using self.List.add_media(address of video) to populate the media list.

Then self.Player_d.set_media_list(self.List) and self.Player_d.play()

The problem is that VLC starts in a weird (YUV something) window, without any controls. Then freezes after playing the list. I have to use Task Manager to shut it down.

Can anybody point out the problem? I want to play the VLC with all controls.

Secondly, is there anyway of checking if VLC is already running, if running, then to quit and start a new instance of VLC.

Any help would be appreciated.

I don't see anything about wxPython in your question, but if you're using it with the vlc module, then that could be your problem. I'm guessing they don't play nicely together. You probably need to run all the vlc stuff in a separate thread rather than in wx's main loop.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM