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 视频
基础教程推荐
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- 包装空间模型 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 求两个直方图的卷积 2022-01-01
