how to embed non-tkinter VLC player into grid of tkinter with python?

Ho Yeung Lee jobmattcon at gmail.com
Thu Mar 16 00:40:03 EDT 2017


we have many TV that would like to be monitored,

how to embed non-tkinter VLC player into grid of tkinter with python?

below code can embeded xterm but not for VLC player


import vlc
from Tkinter import *
import os

root = Tk()
for r in range(2):
    for c in range(1):
        termf = Frame(root, height=100, width=200)
        termf.pack(fill=BOTH, expand=YES)
        wid = termf.winfo_id()
        termf.grid(row=r,column=c)
        p=vlc.MediaPlayer('file:///home/martin/Downloads/autoweb.mp4')
        p.get_tk_widget().grid(row=r,column=c)
        p.play()
        #os.system('xterm -into %d -geometry 40x20 -sb &' % wid)
        os.system('vlc --no-fullscreen "file:///home/martin/Downloads/autoweb.mp4" -into %d -geometry 100x200 -sb &' % wid)

root.mainloop()


More information about the Python-list mailing list