how to play video from url? #17
-
how to play video from url? |
Beta Was this translation helpful? Give feedback.
Answered by
PaulleDemon
Aug 28, 2022
Replies: 1 comment
-
Hello @zoreu , if you are looking to play youtube videos, then install import pafy
import tkinter as tk
from tkVideoPlayer import TkinterVideo
url = "" #youtube link
video = pafy.new(url)
best = video.getbest(preftype="mp4")
root = tk.Tk()
videoplayer = TkinterVideo(master=root, scaled=True)
videoplayer.load(best.url)
videoplayer.pack(expand=True, fill="both")
videoplayer.play() # play the video
root.mainloop() If you have any further questions let me know, otherwise mark this as answer. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
PaulleDemon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @zoreu , if you are looking to play youtube videos, then install
pip install pafy
andpip install youtube-dl==2020.12.2
<- install this specific version. Now check out the following code:If you have any further questions let me know, otherwise mark this as answer.