Can't receive RTSP live stream from an IP cam

时光毁灭记忆、已成空白 提交于 2019-12-04 14:47:27

If the authentication mechanism is HTTP basic authentication then there might be way to set the required HTTP header: the MediaPlayer class has a method setDataSource taking a Map parameter for headers:

public void setDataSource (Context context, Uri uri, Map<String, String> headers)

You must set the Authorization header:

Authorization: Basic _credentials_

_credentials_ is the RFC2045-MIME Base64 encoding of the username:password string.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!