我正在尝试做一个播放视频的应用程序。我有两个问题:
1)我有一个 Youtube 的链接:rtsp:// 我做:
"Uri myUri = Uri.parse(link); //link = rtsp://... mMediaPlayer.setDataSource(getApplicationContext(), myUri);"
然后,视频不播放......但是,如果我使用“videoview”作品。我认为问题在于“媒体播放器”不播放 mpeg 编解码器。有任何想法吗?
2)我有几个不同质量的链接,我将它们连接到wifi并没有问题,但有数据连接:
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&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: I/ChromiumHTTPDataSource(31648): 连接到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&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/AwesomePlayer(31648): mConnectingDataSource->connect() 返回 -1004
05-01 15:58:26.226: E/MediaPlayer(31565):错误 (1, -1004)
05-01 15:58:26.242: E/MediaPlayer(31565): 错误 (1,-1004)
05-01 15:58:26.242: E/RS(31565): MediaPlayer 播放错误
05-01 15:58:26.242: V/(31565): 媒体错误,错误未知 -1004
05-01 15:58:26.242: I/RS(31565): MediaPlayer 播放完成
我希望你能帮忙。谢谢!