Android Studio-VideoView仅播放带有https而非http的视频 [英] Android Studio - VideoView only plays videos witth https and not http

查看:738
本文介绍了Android Studio-VideoView仅播放带有https而非http的视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用Android应用进行实时流式传输,并且我使用videoview作为播放器,但是如果链接以http开头,则它仅通过https流式传输视频并抛出一条消息无法播放此视频"发生在我的真实设备上而不是模拟器上,如何打开对HTTP的访问?或实际上我该如何解决这个问题.

I have been working on an android app for live streaming and I used videoview as a player , but it only streams videos with https and throws a message "Can't play this video" if the link starts with http , that only happens on my real device not the emulator , how can I open access for http ? or how can I solve that problem actually.

推荐答案

这实际上是解决方案

我已将此代码添加到清单中,并且一切正常!

I have added this code to my Manifest and it worked all well !

android:usesCleartextTraffic="true"

解决方案取自 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆