
import vlc
import tkinter as tk


master = tk.Tk()
master.attributes('-type','dialog')     #label as dialog so it floats in a tiling window manager

master.title("Testing embedded VLC player")

#set up tk stuff
qButton = tk.Button(master, text="Quit", command=master.destroy)
qButton.pack()
frame = tk.Frame(master, width=600, height=400)
frame.pack()

#set up vlc video
instance = vlc.Instance()
player = instance.media_player_new()
media = instance.media_new("../inbox/test.webm")
player.set_xwindow(frame.winfo_id())              #Connect vlc player to tkinter frame
player.set_media(media)

#make Play button (the video autoplays and wont play again, but it doesnt appear at all if this button is removed...)
qPlay = tk.Button(master,text="Play", command=player.play())
qPlay.pack()


master.mainloop()
