Python – How to embed vlc instances in the tkinter framework

How to embed vlc instances in the tkinter framework… here is a solution to the problem.

How to embed vlc instances in the tkinter framework

I want to embed a vlc instance in the tkinter framework.
There is already a similar code here in the tkinter window showing the terminal
But I want to show a VLC.
Here is my VLC code :

import vlc
Instance = vlc.Instance()
player = Instance.media_player_new()
Media = Instance.media_new('http://192.168.1.3:8080')
Media.add_option('network-caching=0')
player.set_media(Media)
player.play()

This is simple tkinter code

try:
    # Python2
     from Tkinter import *
except ImportError:
    # Python3
    from tkinter import *
root = Tk()
root.geometry("380x480")
root.resizable(width=False, height=False)

frame1 = LabelFrame(root, width=459, height=300, bd=5)
frame1.grid(row=1, column=0, padx=10)

I want to show VLC streams in this tkinter framework

Solution

The VLC repository has a complete one example Used for Tkinter.

Related Problems and Solutions