Android的MediaPlayer的URL与饼干 [英] Android MediaPlayer URL's with Cookie

查看:156
本文介绍了Android的MediaPlayer的URL与饼干的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从网站播放音乐的Andr​​oid应用程序,然而,到流进行身份验证,您需要发送一个cookie第一即:

I have an android application that plays music from a site, however to authenticate to the stream, you need to send a cookie first I.E:

http://example.com/site/content?id=SOMEID = MP3格式的流

http://example.com/site/content?id=SOMEID = mp3 formatted stream

如果你没有一个cookie访问的网址,你会得到一个服务器的500错误。
如果你有一个cookie,那么你会得到的数据流。

If you access the url without a cookie, you'll get a Server 500 error. If you have a cookie, then you'll get the stream.

有关我的生活,我无法弄清楚如何使媒体播放器播放的URL,而发送的cookie。

For the life of me, I can't figure out how to make the mediaplayer play a URL while sending a cookie.

我可以玩,不需要一个cookie的网址,但是。

I can play any url that doesn't require a cookie, however.

推荐答案

据我可以告诉你不能。几乎所有的MediaPlayer并在本地code完成,包括打开任何连接,所以没有办法来访问它使用AFAICT流。

As far as I can tell you can't. Almost everything MediaPlayer does is done in native code, including opening any connections, so there is no way to access the stream it is using AFAICT.

这篇关于Android的MediaPlayer的URL与饼干的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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