使用MediaPlayer进行Android流式传输:错误(1,-1004)和3GPP视频 [英] Android Streaming with MediaPlayer: Error(1, -1004) and 3GPP video

查看:1145
本文介绍了使用MediaPlayer进行Android流式传输:错误(1,-1004)和3GPP视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作一个用于播放视频的应用程序.我有2个问题:

I'm trying to do an app for play video. I've 2 problems:

1)我有一个YouTube链接:rtsp://,而我这样做:

1) I've a Youtube's link: rtsp:// and i do:

"Uri myUri = Uri.parse(link);//link = rtsp://... mMediaPlayer.setDataSource(getApplicationContext(),myUri);"

"Uri myUri = Uri.parse(link); //link = rtsp://... mMediaPlayer.setDataSource(getApplicationContext(), myUri);"

然后,该视频无法播放...但是,如果我使用"videoview",该视频就可以播放.我认为问题在于"mediaplayer"无法播放mpeg编解码器.有什么想法吗?

Then, the video doesn't play... however, if i use a "videoview" works. I think the problem is that "mediaplayer" doesn't play the mpeg codec. Any ideas?

2)我有几个指向不同质量的链接,我将它们连接到wifi并没有问题,但与数据连接没有问题

2) I've several links to a different quality, and i play them connected to wifi and no problem but with data connection:

05-01 15:58:25.453:E/Link:(31565):http%3A%2F%2Fo-o.preferred.mad01s04.v16.lscache3.c.youtube.com%2Fvideoplayback%3Fupn%3D35Zn4tL7Ibc% 26sparams%3Dcp%252Cid%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26fexp%3D900147%26itag%3D18%26ip%3D85.0.0.0%26signature%3DAACE528D596873408192BCDDF4ECFC7DDFD68EBB.575689C34D97BA9D750C7B40CC63B427E40E7838%26sver%3D3%26ratebypass%3Dyes% 26source%3Dyoutube%26expire%3D1335903378%26key%3Dyt1%26ipbits%3D8%26cp%3DU0hSSllLUV9MUkNOMl9RRVVEOnduVjJoRkFBMDBn%26id%3D8fb5ca7aa1a31f5e

05-01 15:58:25.453: E/Link:(31565): http%3A%2F%2Fo-o.preferred.mad01s04.v16.lscache3.c.youtube.com%2Fvideoplayback%3Fupn%3D35Zn4tL7Ibc%26sparams%3Dcp%252Cid%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26fexp%3D900147%26itag%3D18%26ip%3D85.0.0.0%26signature%3DAACE528D596873408192BCDDF4ECFC7DDFD68EBB.575689C34D97BA9D750C7B40CC63B427E40E7838%26sver%3D3%26ratebypass%3Dyes%26source%3Dyoutube%26expire%3D1335903378%26key%3Dyt1%26ipbits%3D8%26cp%3DU0hSSllLUV9MUkNOMl9RRVVEOnduVjJoRkFBMDBn%26id%3D8fb5ca7aa1a31f5e

05-01 15:58:25.464:I/AwesomePlayer(31648):setDataSource_l('http://oo.preferred.mad01s04.v16.lscache3.c.youtube.com/videoplayback?upn=35Zn4tL7Ibc&sparams= CP%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&安培; FEXP = 900147&安培; ITAG = 18&安培; IP = 85.0.0.0&安培;签名= AACE528D596873408192BCDDF4ECFC7DDFD68EBB.575689C34D97BA9D750C7B40CC63B427E40E7838&安培; sver = 3及ratebypass = YES&安培;源= YouTube和安培; expire = 1335903378& key = yt1& ipbits = 8& cp = U0hSSllLUV9MUkNOMl9RRVVEOnduVjJoRkFBMDBn& id = 8fb5ca7aa1a31f5e')

05-01 15:58:25.464: I/AwesomePlayer(31648): setDataSource_l('http://o-o.preferred.mad01s04.v16.lscache3.c.youtube.com/videoplayback?upn=35Zn4tL7Ibc&sparams=cp%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&fexp=900147&itag=18&ip=85.0.0.0&signature=AACE528D596873408192BCDDF4ECFC7DDFD68EBB.575689C34D97BA9D750C7B40CC63B427E40E7838&sver=3&ratebypass=yes&source=youtube&expire=1335903378&key=yt1&ipbits=8&cp=U0hSSllLUV9MUkNOMl9RRVVEOnduVjJoRkFBMDBn&id=8fb5ca7aa1a31f5e')

05-01 15:58:25.484:V/ChromiumHTTPDataSource(31648):代表uid 10101连接

05-01 15:58:25.484: V/ChromiumHTTPDataSource(31648): connect on behalf of uid 10101

05-01 15:58:25.484:I/ChromiumHTTPDataSource(31648):连接到 http://oo.p.c.v.c.v.c.v.c.v.sv.com.asp.v.v.sv.com.asp.v.c.https://oo.p.v.sv.com中的参考资料.http://oo.p.c.v.sv.com.请参考第16页.http://oo.p.v.sv.com.16. /videoplayback?upn=35Zn4tL7Ibc&sparams=cp%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&fexp=900147&itag=18&ip=85.0.0.0&signature=AACE528D596873408192BCDDF4ECFC7DDFD68EBB.575689C34D97BA9D750C7B40CC63B427E40E7838&sver= 3& ratebypass =是& source = youtube& expire = 1335903378& key = yt1& ipbits = 8& cp = U0hSSllLUV9MUkNOMl9RRVVEOnd uVjJoRkFBMDBn& id = 8fb5ca7aa1a31f5e @ 0

05-01 15:58:25.484: I/ChromiumHTTPDataSource(31648): connect to http://o-o.preferred.mad01s04.v16.lscache3.c.youtube.com/videoplayback?upn=35Zn4tL7Ibc&sparams=cp%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&fexp=900147&itag=18&ip=85.0.0.0&signature=AACE528D596873408192BCDDF4ECFC7DDFD68EBB.575689C34D97BA9D750C7B40CC63B427E40E7838&sver=3&ratebypass=yes&source=youtube&expire=1335903378&key=yt1&ipbits=8&cp=U0hSSllLUV9MUkNOMl9RRVVEOnduVjJoRkFBMDBn&id=8fb5ca7aa1a31f5e @0

05-01 15:58:26.226:I/ChromiumHTTPDataSourceSupport(31648):服务器以http状态403响应

05-01 15:58:26.226: I/ChromiumHTTPDataSourceSupport(31648): Server responded with http status 403

05-01 15:58:26.226:I/AwesomePlayer(31648):mConnectingDataSource-> connect()返回-1004

05-01 15:58:26.226: I/AwesomePlayer(31648): mConnectingDataSource->connect() returned -1004

05-01 15:58:26.226:E/MediaPlayer(31565):错误(1,-1004)

05-01 15:58:26.226: E/MediaPlayer(31565): error (1, -1004)

05-01 15:58:26.242:E/MediaPlayer(31565):错误(1,-1004)

05-01 15:58:26.242: E/MediaPlayer(31565): Error (1,-1004)

05-01 15:58:26.242:E/RS(31565):MediaPlayer播放错误

05-01 15:58:26.242: E/RS(31565): MediaPlayer Playback ERROR

05-01 15:58:26.242:V/(31565):媒体错误,错误未知-1004

05-01 15:58:26.242: V/(31565): Media Error, Error Unknown -1004

05-01 15:58:26.242:I/RS(31565):MediaPlayer播放已完成

05-01 15:58:26.242: I/RS(31565): MediaPlayer Playback COMPLETED

希望您能提供帮助. 谢谢!

I hope you can help. Thanks!

推荐答案

实际上,由于存在此问题,因此存在流URL错误的错误.否则,在videoview中效果很好.

Actually there is an error is streaming url error due to which this problem exists.. otherwise it works well in videoview.

您必须在网址后添加youtube签名.

you have to add youtube signature after the url.

我已经做到了,并且效果很好.

I worked on that and it works perfectly.

这篇关于使用MediaPlayer进行Android流式传输:错误(1,-1004)和3GPP视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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