Yes. I have internet permission set in manifest.

I tried setDataSource.

 mediaPlayer.setDataSource( this, Uri.parse( myURL ));

I don't know what has gone wrong here. When I am calling set data source, 
it's throwing error. In logcat, I can see messages like,

I/MediaPlayer﹕ path is null

D/MediaPlayer﹕ setDataSource IOException happend

D/MediaPlayer﹕ Couldn't open file on client side, trying server side

Probably, it is looking for the file locally. How can I make the api look 
for my file on internet, at the given URL ???


On Monday, March 16, 2015 at 9:32:42 AM UTC, Oleksii Bieliaiev wrote:
>
> Hi.
>
> Did you set android.permission.INTERNET permission?
>
> Regards,
> Alex
>
>
> On Monday, March 16, 2015 at 1:53:13 AM UTC+1, NewToAndroid wrote:
>>
>> I tried that and now it is giving different error
>>
>> 03-16 00:25:53.020  29074-29074/com.example.android.playlivesound E/﹕ 
>> mali: REVISION=Linux-r3p2-01rel3 BUILD_DATE=Wed Oct  9 21:05:57 KST 2013
>> 03-16 00:25:53.105  29074-29074/com.example.android.playlivesound 
>> D/OpenGLRenderer﹕ Enabling debug mode 0
>> 03-16 00:25:53.870  29074-29074/com.example.android.playlivesound 
>> I/Choreographer﹕ Skipped 44 frames!  The application may be doing too much 
>> work on its main thread.
>> 03-16 00:26:08.910  29074-29074/com.example.android.playlivesound 
>> E/MediaPlayer﹕ Unable to to create media player
>> 03-16 00:26:08.915  29074-29074/com.example.android.playlivesound 
>> W/System.err﹕ java.io.IOException: setDataSource failed.: status=0x80000000
>> 03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
>> W/System.err﹕ at android.media.MediaPlayer._setDataSource(Native Method)
>> 03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
>> W/System.err﹕ at 
>> android.media.MediaPlayer.setDataSource(MediaPlayer.java:1185)
>> 03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
>> W/System.err﹕ at 
>> android.media.MediaPlayer.setDataSource(MediaPlayer.java:1102)
>> 03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
>> W/System.err﹕ at 
>> com.example.android.playlivesound.MainActivity$1.onClick(MainActivity.java:46)
>> 03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
>> W/System.err﹕ at android.view.View.performClick(View.java:4475)
>> 03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
>> W/System.err﹕ at android.view.View$PerformClick.run(View.java:18786)
>> 03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
>> W/System.err﹕ at android.os.Handler.handleCallback(Handler.java:730)
>> 03-16 00:26:08.940  29074-29074/com.example.android.playlivesound 
>> W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:92)
>> 03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
>> W/System.err﹕ at android.os.Looper.loop(Looper.java:176)
>> 03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
>> W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5419)
>> 03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
>> W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)
>> 03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
>> W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:525)
>> 03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
>> W/System.err﹕ at 
>> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
>> 03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
>> W/System.err﹕ at 
>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
>> 03-16 00:26:08.945  29074-29074/com.example.android.playlivesound 
>> W/System.err﹕ at dalvik.system.NativeStart.main(Native Method)
>> 03-16 00:27:23.000  29074-29074/com.example.android.playlivesound 
>> D/dalvikvm﹕ GC_EXPLICIT freed 275K, 13% free 10262K/11728K, paused 4ms+3ms, 
>> total 48ms
>> 03-16 00:28:33.670  29074-29074/com.example.android.playlivesound 
>> E/MediaPlayer﹕ Unable to to create media player
>>
>> What can be the reason? Is it only because I have not put the prepare 
>> method in a service ? and have included it in main thread?
>>
>>
>>
>> On Sunday, March 15, 2015 at 8:57:22 PM UTC, Jonathan S wrote:
>>>
>>> it is looking for files in the assets directory over 
>>> ContentResolver.openAssetFileDescriptor.
>>>
>>> You should have to use 
>>> http://developer.android.com/reference/android/media/MediaPlayer.html#setDataSource%28java.lang.String%29
>>>
>>> you would need prepareAsync too
>>>
>>> On Sunday, March 15, 2015 at 8:35:57 AM UTC-4, NewToAndroid wrote:
>>>>
>>>> Hi,
>>>>
>>>> Few other developers have asked this question before, I checked those 
>>>> posts. But looks like I have a different issue here.
>>>> I am using Android Developer Studio 1.0.1 sitting on JRE 1,7 (on a 
>>>> windows laptop).
>>>>
>>>> I am developing an App around a live streaming audio, using MediaPlayer 
>>>> class.
>>>> If I place the URL in browser, which looks like, 
>>>> http://something.org.uk:8000/blah.mp3, the URL woks/plays perfectly 
>>>> fine from the browser.
>>>>
>>>> But my code
>>>>         mediaPlayer = MediaPlayer.create(MainActivity.this, Uri.parse("
>>>> http://something.org.uk:8000/blah.mp3";));
>>>>         mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
>>>>         mediaPlayer.start();
>>>>
>>>> gives exception
>>>>
>>>>     java.io.FileNotFoundException: No content provider: 
>>>> http://something.org.uk:8000/blah.mp3
>>>>             at 
>>>> android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:761)
>>>>             at 
>>>> android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:665)
>>>>             at 
>>>> android.media.MediaPlayer.setDataSource(MediaPlayer.java:960)
>>>>             at 
>>>> android.media.MediaPlayer.setDataSource(MediaPlayer.java:914)
>>>>             at android.media.MediaPlayer.create(MediaPlayer.java:837)
>>>>             at android.media.MediaPlayer.create(MediaPlayer.java:818)
>>>>             at 
>>>> com.example.android.playlivenusound.MainActivity$1.onClick(MainActivity.java:52)
>>>>             at android.view.View.performClick(View.java:4475)
>>>>             at android.view.View$PerformClick.run(View.java:18786)
>>>>             at android.os.Handler.handleCallback(Handler.java:730)
>>>>             at android.os.Handler.dispatchMessage(Handler.java:92)
>>>>             at android.os.Looper.loop(Looper.java:176)
>>>>             at android.app.ActivityThread.main(ActivityThread.java:5419)
>>>>             at java.lang.reflect.Method.invokeNative(Native Method)
>>>>             at java.lang.reflect.Method.invoke(Method.java:525)
>>>>             at 
>>>> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
>>>>             at 
>>>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
>>>>             at dalvik.system.NativeStart.main(Native Method)
>>>>
>>>> If I use a local MP3 file (added to the raw folder), it works fine.
>>>> What am I missing here ??
>>>>
>>>> Please help.
>>>>
>>>> Thanks in advance.
>>>>
>>>>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to