Я пишу приложение, которое использует 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: "http://commonsware.com/misc/test2.3gp"
Но не с этим (с YouTube через API): "rtsp: //v4.cache7.c.youtube.com/CjsLENy73wIaMgl4q-dkJkOfrRMYDSANFEIXZ29vZ2xlLW1vdW50YWludmlldy0wLjFIBlIGdml */0/100/0/100/0/100/0/100/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/1/1/0/0/11009 * Журналы ошибок приведены ниже. Обратите внимание: я хочу управлять воспроизведением, поэтому я не ищу решения, которое предполагает использование намерений для запуска автономного проигрывателя 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