Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- import pyglet as pyg
- from tkvideo import *
- # Create Tkinter instance
- window = Tk()
- def birthday():
- vidPath = 'D:\path\to\video' # ini path video nya ditaro dimana
- window = pyg.window.Window()
- player = pyg.media.Player()
- source = pyg.media.StreamingSource()
- MediaLoad = pyg.media.load( vidPath )
- player.queue( MediaLoad )
- player.play()
- @window.event
- def on_draw():
- if player.source and player.source.video_format:
- player.get_texture().blit( 50, 50 )
- pyg.app.run()
- window.title( "Happy Birthday My Love" )
- window.geometry( '500x550' )
- label = Label( window, font = ('Helvatical bold', 20), text = "Happy 19th Birthday <nama>", bd = 1, relief = "sunken" )
- # bagian variable textnya diubah teserah mau jadi apapun
- label.pack( pady = 20 )
- button = Button( window, font = (20), text = "Click Me!", bg = "cyan", fg = "black", padx = 20, pady = 20, command = birthday )
- button.pack()
- window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement