2011-08-09 40 views
1

YouTubeからビデオを再生するためにVideoViewを使用するアプリを作成しています。ここでRTSPストリーミングを使用してVideoViewでYouTube動画を再生できません

は私のコードです:

VideoView videoView = (VideoView)findViewById(R.id.video_view); 
videoView.setVideoURI(Uri.parse(filePath)); 
videoView.setMediaController(new MediaController(this)); 
videoView.requestFocus(); 
videoView.start(); 

コードは次のURLで動作します:YouTubeのを経由してから、この1(との "http://commonsware.com/misc/test2.3gp"

でもありませんAPI): "RTSP://v4.cache7.c.youtube.com/CjsLENy73wIaMgl4q-dkJkOfrRMYDSANFEIXZ29vZ2xlLW1vdW50YWludmlldy0wLjFIBlIGdmlkZW9zDA==/0/0/0/video.3gp"

エラーログは以下の通りです。注:私は再生を制御したいので、私はスタンドアロンのyoutubeプレーヤーを開始するためにインテントを使用することを含む解決策を探していません。私がそれをすると、YouTubeの動画が再生されますが、私がする必要はありません。

本当にありがとうございます。

08-09 08:01:34.923: INFO/AwesomePlayer(34): setDataSource_l('rtsp://v4.cache7.c.youtube.com/CjsLENy73wIaMgl4q-dkJkOfrRMYDSANFEIXZ29vZ2xlLW1vdW50YWludmlldy0wLjFIBlIGdmlkZW9zDA==/0/0/0/video.3gp') 
08-09 08:01:35.003: INFO/MyHandler(34): connection request completed with result 0 (Unknown error: 0) 
08-09 08:01:35.053: INFO/ARTSPConnection(34): status: RTSP/1.0 200 OK 
08-09 08:01:35.083: INFO/MyHandler(34): DESCRIBE completed with result 0 (Unknown error: 0) 
08-09 08:01:35.103: INFO/ASessionDescription(34): v=0 
08-09 08:01:35.103: INFO/ASessionDescription(34): o=GoogleStreamer 1080479110 1215825987 IN IP4 74.125.214.211 
08-09 08:01:35.103: INFO/ASessionDescription(34): s=Video 
08-09 08:01:35.103: INFO/ASessionDescription(34): c=IN IP4 0.0.0.0 
08-09 08:01:35.112: INFO/ASessionDescription(34): b=AS:73 
08-09 08:01:35.112: INFO/ASessionDescription(34): t=0 0 
08-09 08:01:35.112: INFO/ASessionDescription(34): a=control:* 
08-09 08:01:35.112: INFO/ASessionDescription(34): a=range:npt=0-21.333000 
08-09 08:01:35.112: INFO/ASessionDescription(34): m=video 0 RTP/AVP 98 
08-09 08:01:35.112: INFO/ASessionDescription(34): b=AS:61 
08-09 08:01:35.122: INFO/ASessionDescription(34): a=rtpmap:98 H263-2000/90000 
08-09 08:01:35.122: INFO/ASessionDescription(34): a=control:trackID=0 
08-09 08:01:35.122: INFO/ASessionDescription(34): a=cliprect:0,0,144,176 
08-09 08:01:35.122: INFO/ASessionDescription(34): a=framesize:98 176-144 
08-09 08:01:35.122: INFO/ASessionDescription(34): a=fmtp:98 profile=0;level=10 
08-09 08:01:35.122: INFO/ASessionDescription(34): m=audio 0 RTP/AVP 99 
08-09 08:01:35.143: INFO/ASessionDescription(34): b=AS:12 
08-09 08:01:35.143: INFO/ASessionDescription(34): a=rtpmap:99 AMR/8000/1 
08-09 08:01:35.143: INFO/ASessionDescription(34): a=control:trackID=1 
08-09 08:01:35.143: INFO/ASessionDescription(34): a=fmtp:99 octet-align 
08-09 08:01:35.212: INFO/ARTSPConnection(34): status: RTSP/1.0 200 OK 
08-09 08:01:35.232: DEBUG/dalvikvm(567): GC_CONCURRENT freed 443K, 7% free 7156K/7687K, paused 5ms+4ms 
08-09 08:01:35.242: INFO/MyHandler(34): SETUP(1) completed with result 0 (Unknown error: 0) 
08-09 08:01:35.292: INFO/ARTSPConnection(34): status: RTSP/1.0 200 OK 
08-09 08:01:35.312: INFO/MyHandler(34): SETUP(2) completed with result 0 (Unknown error: 0) 
08-09 08:01:35.353: INFO/ARTSPConnection(34): status: RTSP/1.0 200 OK 
08-09 08:01:35.382: INFO/MyHandler(34): PLAY completed with result 0 (Unknown error: 0) 
08-09 08:01:45.383: WARN/MyHandler(34): Never received any data, switching transports. 
08-09 08:01:45.424: INFO/ARTSPConnection(34): status: RTSP/1.0 200 OK 
08-09 08:01:45.433: INFO/MyHandler(34): TEARDOWN completed with result 0 (Unknown error: 0) 
08-09 08:01:45.538: INFO/MyHandler(34): connection request completed with result 0 (Unknown error: 0) 
08-09 08:01:45.582: INFO/ARTSPConnection(34): status: RTSP/1.0 200 OK 
08-09 08:01:45.612: INFO/MyHandler(34): DESCRIBE completed with result 0 (Unknown error: 0) 
08-09 08:01:45.612: INFO/ASessionDescription(34): v=0 
08-09 08:01:45.612: INFO/ASessionDescription(34): o=GoogleStreamer 845535255 1838195113 IN IP4 74.125.214.211 
08-09 08:01:45.612: INFO/ASessionDescription(34): s=Video 
08-09 08:01:45.612: INFO/ASessionDescription(34): c=IN IP4 0.0.0.0 
08-09 08:01:45.612: INFO/ASessionDescription(34): b=AS:73 
08-09 08:01:45.612: INFO/ASessionDescription(34): t=0 0 
08-09 08:01:45.623: INFO/ASessionDescription(34): a=control:* 
08-09 08:01:45.623: INFO/ASessionDescription(34): a=range:npt=0-21.333000 
08-09 08:01:45.623: INFO/ASessionDescription(34): m=video 0 RTP/AVP 98 
08-09 08:01:45.623: INFO/ASessionDescription(34): b=AS:61 
08-09 08:01:45.623: INFO/ASessionDescription(34): a=rtpmap:98 H263-2000/90000 
08-09 08:01:45.623: INFO/ASessionDescription(34): a=control:trackID=0 
08-09 08:01:45.633: INFO/ASessionDescription(34): a=cliprect:0,0,144,176 
08-09 08:01:45.633: INFO/ASessionDescription(34): a=framesize:98 176-144 
08-09 08:01:45.633: INFO/ASessionDescription(34): a=fmtp:98 profile=0;level=10 
08-09 08:01:45.633: INFO/ASessionDescription(34): m=audio 0 RTP/AVP 99 
08-09 08:01:45.633: INFO/ASessionDescription(34): b=AS:12 
08-09 08:01:45.633: INFO/ASessionDescription(34): a=rtpmap:99 AMR/8000/1 
08-09 08:01:45.643: INFO/ASessionDescription(34): a=control:trackID=1 
08-09 08:01:45.643: INFO/ASessionDescription(34): a=fmtp:99 octet-align 
08-09 08:01:45.673: INFO/ARTSPConnection(34): status: RTSP/1.0 461 Unsupported Transport 
08-09 08:01:45.683: INFO/MyHandler(34): SETUP(1) completed with result 0 (Unknown error: 0) 
08-09 08:01:45.713: INFO/ARTSPConnection(34): status: RTSP/1.0 461 Unsupported Transport 
08-09 08:01:45.723: INFO/MyHandler(34): SETUP(2) completed with result 0 (Unknown error: 0) 
08-09 08:01:45.733: INFO/AwesomePlayer(34): ARTSPController::connect returned -2147483648 
08-09 08:01:45.733: ERROR/MediaPlayer(567): error (1, -2147483648) 
08-09 08:01:45.733: ERROR/MediaPlayer(567): Error (1,-2147483648) 
08-09 08:01:45.733: DEBUG/VideoView(567): Error: 1,-2147483648 

答えて

0

ファイアウォールの問題であることが判明しました。 UDPがブロックされているようです。 モバイルデータ接続では動作していても、無線ではないと言った他のポストで他の人を見た。おそらく同じ問題があります - ファイアウォールの設定。

0

これらのURIを試してみてくださいマニフェストファイルに

​​

もがインターネットのアクセス許可を追加します。

rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov 

http://www.wowza.com/_h264/BigBuckBunny_175k.mov 
関連する問題