vlc.Instance: AttributeError(“模块‘vlc’没有属性‘实例’") [英] vlc.Instance: AttributeError("module 'vlc' has no attribute 'Instance'")
问题描述
我正在努力使 VLC 播放器能够正确导入,以便它可以连续播放一系列 VLC 媒体文件.但是,我似乎无法正确导入 VLC!我已经下载了 vlc.py 并将其添加到我的工作区.看起来像这样;
I'm trying to make it so that the VLC player will import correctly so that it will play a series of VLC media files in succession. However, I cannot seem to get VLC to import properly! I've downloaded the vlc.py and added it to my workspace. It looks like this;
import vlc
class PlayerWindow(Frame):
def __init__(self, parent):
super().__init__()
self.parent = parent
self.parent.attributes('-alpha', 0)
self.parent.attributes("-fullscreen", True)
self.parent.bind_all("<Key>", self.key)
# VLC player controls
self.Instance = vlc.Instance()
self.player = self.Instance.media_player_new()
self.player.toggle_fullscreen()
self.player.video_set_key_input(False)
self.parent.update()
我使用的是 Microsoft VS 2017
Im using Microsoft VS 2017
推荐答案
尝试卸载 vlc ( pip uninstall vlc ) 和重新安装的组合.与 python-vlc 相同.还要检查您的路径变量是否已设置(VS Code 和 VideoLAN\VLC).那么它必须工作.
Try the combinations of uninstalling vlc ( pip uninstall vlc ) and reinstalling it . Same for python-vlc. Also check if your path variables are set( Both VS Code and VideoLAN\VLC ). It must work then.
这篇关于vlc.Instance: AttributeError(“模块‘vlc’没有属性‘实例’")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!