Ich entwickle eine Android-Anwendung, die einen Youtube-Video-Player erfordert. Ich habe erfolgreich die RTSP-Video-URL von der API erhalten, aber während ich versuche, diese rtsp-URL in meine Android-Videoansicht zu laden, heißt es "Can't play this video.
". Zuvor entwickelte ich eine ähnliche Anwendung in dieser Methode, und es funktionierte zu dieser Zeit gut, aber es wird jetzt auch nicht geladen.Wie kann ich Youtube-Videos in der Android-Videoansicht wiedergeben?
Ich bin mir sicher, dass ich die richtige RTSP-URL von der API bekomme. rtsp://v6.cache6.c.youtube.com/CiULENy73wIaHAlV9VII3c64lRMYESARFEgGUglwbGF5bGlzdHMM/0/0/0/video.3gp
Hier ist mein Aktivitätscode:
mVideoURL = getIntent().getStringExtra("EXT_URL");
Log.i("VIDEO URL", " " + mVideoURL);
MediaController mc = new MediaController(this);
mVideoStreamView = (VideoView) findViewById(R.id.vidPlayer);
mVideoStreamView.setVideoURI(Uri.parse(mVideoURL));
mVideoStreamView.setMediaController(mc);
mVideoStreamView.requestFocus();
mVideoStreamView.start();
EDIT einige zusätzliche Informationen aus dem logcat Gefunden:
ARTSPConnection(6607): status: RTSP/1.0 200 OK
ASessionDescription(6607): v=0
ASessionDescription(6607): o=GoogleStreamer 378992432 328144046 IN IP4 74.125.213.182
ASessionDescription(6607): s=Video
ASessionDescription(6607): c=IN IP4 0.0.0.0
ASessionDescription(6607): b=AS:29
ASessionDescription(6607): t=0 0
ASessionDescription(6607): a=control:*
ASessionDescription(6607): a=range:npt=0-1703.000000
ASessionDescription(6607): m=video 0 RTP/AVP 98
ASessionDescription(6607): b=AS:17
ASessionDescription(6607): a=rtpmap:98 H263-2000/90000
ASessionDescription(6607): a=control:trackID=0
ASessionDescription(6607): a=cliprect:0,0,144,176
ASessionDescription(6607): a=framesize:98 176-144
ASessionDescription(6607): a=fmtp:98 profile=0;level=10
ASessionDescription(6607): m=audio 0 RTP/AVP 99
ASessionDescription(6607): b=AS:12
ASessionDescription(6607): a=rtpmap:99 AMR/8000/1
ASessionDescription(6607): a=control:trackID=1
ASessionDescription(6607): a=fmtp:99 octet-align
ARTSPConnection(6607): status: RTSP/1.0 200 OK
ARTSPConnection(6607): status: RTSP/1.0 200 OK
ARTSPConnection(6607): status: RTSP/1.0 200 OK
ARTSPConnection(6607): status: RTSP/1.0 200 OK
ARTSPConnection(6607): status: RTSP/1.0 200 OK
ASessionDescription(6607): v=0
ASessionDescription(6607): o=GoogleStreamer 1299458498 503248054 IN IP4 74.125.213.182
ASessionDescription(6607): s=Video
ASessionDescription(6607): c=IN IP4 0.0.0.0
ASessionDescription(6607): b=AS:29
ASessionDescription(6607): t=0 0
ASessionDescription(6607): a=control:*
ASessionDescription(6607): a=range:npt=0-1703.000000
ASessionDescription(6607): m=video 0 RTP/AVP 98
ASessionDescription(6607): b=AS:17
ASessionDescription(6607): a=rtpmap:98 H263-2000/90000
ASessionDescription(6607): a=control:trackID=0
ASessionDescription(6607): a=cliprect:0,0,144,176
ASessionDescription(6607): a=framesize:98 176-144
ASessionDescription(6607): a=fmtp:98 profile=0;level=10
ASessionDescription(6607): m=audio 0 RTP/AVP 99
ASessionDescription(6607): b=AS:12
ASessionDescription(6607): a=rtpmap:99 AMR/8000/1
ASessionDescription(6607): a=control:trackID=1
ASessionDescription(6607): a=fmtp:99 octet-align
ARTSPConnection(6607): status: RTSP/1.0 461 Unsupported Transport
ARTSPConnection(6607): status: RTSP/1.0 461 Unsupported Transport
Bitte mir einen Weg vorschlagen, YouTube-Videos in android video zu laden .
Vielen Dank im Voraus ...
EDIT gerade in einem anderen Gerät überprüft, HTC Desire (2.2). Der Code hat gut funktioniert. Ich frage mich zu denken, was wird das Problem mit Nexus (4.1) sein?
überprüfen Sie dies: http://StackOverflow.com/Questions/5162088/Video-view-Not-Playing-Youtube-Video –
sollten Sie youtube verwenden API für Android, es ist sehr einfach – vuhung3990
Hier ist der Link wird es helfen .. http://www.truiton.com/2013/08/android-videoview-example-with-youtube-playback/ –