Android MediaPlayer网址与Cookie [英] Android MediaPlayer URL's with Cookie

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

问题描述

我有一个Android应用程序播放音乐从一个网站,但是要认证到流,你需要发送一个cookie首先IE:

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的url,你会得到一个Server 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.

对于我的生活,我不知道如何使媒体播放器

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都是在本地代码中完成的,包括打开任何连接,所以没有办法访问它使用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网址与Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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