0

I am using MediaPlayer to play my video from a URL that I have parsed from a Youtube json-c feed. The feed I retrieved is:

"player":
{"default":"https://www.youtube.com/watch?v=4uwtqRBE4Kk&feature=youtube_gdata_player",

"mobile":"https://m.youtube.com/details?v=4uwtqRBE4Kk"},

"content":
{"5":"https://www.youtube.com/v/4uwtqRBE4Kk?version=3&f=videos&app=youtube_gdata",

"1":"rtsp://v3.cache1.c.youtube.com/CiILENy73wIaGQmp4EQQqS3s4hMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp",

"6":"rtsp://v3.cache2.c.youtube.com/CiILENy73wIaGQmp4EQQqS3s4hMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp"},"

I am using

//URL I retrieved from a json-c feed from the player array described above
private String URL = "https://m.youtube.com/watch?v=4uwtqRBE4Kk";
mediaplayer.setDataSource(URL);

It gives a MediaPlayerError error(1, -2147483648). Whereas when I use the URL from a dropbox like

private String URL = "http://dl.dropbox.com/u/145894/t/rabbits.3gp"; 

It runs and the video is played. Please explain the error or give me a remedy.

dda
  • 6,030
  • 2
  • 25
  • 34
Pranav Sharma
  • 692
  • 2
  • 9
  • 22

1 Answers1

3

If you are testing on devices earlier than Android 3.1 you might not be able to play AACP.

In order to find out what streams you can play on your targeted device check official docs: http://developer.android.com/reference/android/media/AudioManager.html

If you are looking how to handle aacp checkout following: https://stackoverflow.com/a/8833346/200272

Community
  • 1
  • 1
Amitay
  • 468
  • 5
  • 20