Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed youtube video in Kivy

I want to embed videos in a widget in Kivy using youtube URLs. Is that possible ? The documentation gives example for VideoPlayer - http://kivy.org/docs/api-kivy.uix.videoplayer.html but its only for playing local files.

like image 708
Lyman Zerga Avatar asked Dec 06 '25 03:12

Lyman Zerga


1 Answers

Kivy can stream videos from the internet and play them in VideoPlayer. However, YouTube does not provide a streaming URL. Remember that YouTube only gets paid when they show ads, which means they want you on their site and need you to use their video player.

I can think of two options:

  1. Use a YouTube downloader app to retrieve the video (or, alternatively, try to hack on one of the downloaders and see if you can figure out what they're doing and how to duplicate it in Kivy).
  2. Use the Chromium Embedded Framework to display an actual web page. I have no idea whether this will work with Flash or not, but in theory it would work for any HTML5 videos (but not all videos can be watched in HTML5). There is a CEFPython Garden widget available, as well as a non-Garden CEFKivy component which has more recent development.
like image 134
kitti Avatar answered Dec 07 '25 16:12

kitti



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!