Embed youtube video in Kivy(在 Kivy 中嵌入 youtube 视频)
问题描述
我想使用 youtube URL 在 Kivy 的小部件中嵌入视频.那可能吗 ?该文档提供了 VideoPlayer 的示例 - http://kivy.org/docs/api-kivy.uix.videoplayer.html 但它只用于播放本地文件.
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.
推荐答案
Kivy 可以从互联网上串流视频并在 VideoPlayer
中播放.但是,YouTube 不提供流式传输 URL.请记住,YouTube 只有在展示广告时才会获得报酬,这意味着他们希望您访问他们的网站并需要您使用他们的视频播放器.
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.
我能想到两个选择:
- 使用 YouTube 下载器应用来检索视频(或者,尝试破解其中一个下载器,看看您是否能弄清楚他们在做什么以及如何在 Kivy 中复制它).
- 使用 Chromium Embedded Framework 显示实际网页.我不知道这是否适用于 Flash,但理论上它适用于任何 HTML5 视频(但并非所有视频都可以在 HTML5 中观看).有一个 CEFPython Garden 小部件 可用,以及一个非花园 CEFKivy 组件 有更新的发展.
- 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).
- 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.
这篇关于在 Kivy 中嵌入 youtube 视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Kivy 中嵌入 youtube 视频


基础教程推荐
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 筛选NumPy数组 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01