How to play videos from the web like youtube in kivy(如何在 kivy 中播放来自网络的视频,例如 youtube)
问题描述
我真的很想创建一个 kivy 应用程序,让我可以查看来自某些网络链接的视频.我该怎么做呢,比如有一个视频链接然后在 Kivy 中播放?我已经阅读了文档,但我不明白.请帮忙.
I really want to create a kivy app that lets me view videos from certain web links. How can I go about doing this, Like having a link to a video then play it in Kivy? I already read the documentation and I don't get it. Please help.
推荐答案
视频
和VideoPlayer
小部件都能够播放来自网络的流式视频.下面是一个播放网络视频的简单示例:
The Video
and VideoPlayer
widgets are both capable of playing streaming videos from the web. Here's a simple example of playing a video from the web:
import kivy
kivy.require('1.8.0')
from kivy.app import App
from kivy.lang import Builder
root = Builder.load_string('''
VideoPlayer:
source: 'http://www.debone.com/VivVilConGminorRV578.mpg'
''')
class TestApp(App):
def build(self):
return root
if __name__ == '__main__':
TestApp().run()
这适用于任何受支持的流媒体类型.但请注意,YouTube 不提供流式传输 URL.在此处查看我对专门询问 YouTube 的问题的回答.
This will work for any supported streaming media type. Note, however, that YouTube does not provide streaming URLs. Check my answer here to a question which was specifically asking about YouTube.
这篇关于如何在 kivy 中播放来自网络的视频,例如 youtube的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 kivy 中播放来自网络的视频,例如 youtube


- Android - 拆分 Drawable 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01