Python tkinter中的嵌入式VLC播放器无法播放在线视频
基本上是标题,这是我的代码,它适用于本地文件,但当我键入URL时会弹出一个错误:Python tkinter中的嵌入式VLC播放器无法播放在线视频,python,python-3.x,tkinter,https,vlc,Python,Python 3.x,Tkinter,Https,Vlc,基本上是标题,这是我的代码,它适用于本地文件,但当我键入URL时会弹出一个错误: import vlc import tkinter as tk import tkinter.ttk as ttk class Screen(tk.Frame): ''' Screen widget: Embedded video player from local or youtube ''' def __init__(self, parent, *args, **kwar
import vlc
import tkinter as tk
import tkinter.ttk as ttk
class Screen(tk.Frame):
'''
Screen widget: Embedded video player from local or youtube
'''
def __init__(self, parent, *args, **kwargs):
tk.Frame.__init__(self, parent, bg='black')
self.parent = parent
# Creating VLC player
self.instance = vlc.Instance()
self.player = self.instance.media_player_new()
def GetHandle(self):
# Getting frame ID
return self.winfo_id()
def play(self, _source):
# Function to start player from given source
Media = self.instance.media_new(_source)
Media.get_mrl()
self.player.set_media(Media)
self.player.set_hwnd(self.winfo_id())
self.player.play()
root = tk.Tk()
player = Screen(root)
player.place(x=0, y=0, width=500, height=300)
player.play('https://youtu.be/dQw4w9WgXcQ')
root.mainloop()
我的错误消息:[0000020be7103c00]http流错误:本地流1错误:取消(0x8)