0

I am trying to integrate the Video Frame for playing Video Files into the Tk Main window for my project at: github.com. Currently it is launching native VLC Player using subprocess However I want to have an integrated window for the same.

When I execute below code:

import vlc
root = Tk()

instance = vlc.Instance()
player = instance.media_player_new()
media = instance.media_new("big.mp4")
player.set_media(media)
player.play()

canvas = Canvas(player).pack()
root.mainloop()

I get this error: AttributeError: 'MediaPlayer' object has no attribute 'tk'

I tried to get inputs form this GitHub project: github.com. However I was unsuccessful to get it working.

The video currently launches in another window when I remove the Canvas related code. Please advice what is wrong with the code.

0 Answers0