Wednesday, April 10, 2013

[android-developers] Can't play audio using localhost url in MediaPlayer

Hello there,
I'm developing an application in native code that creates a socket in the device to stream an AAC audio content.
I tested in some devices like Galaxy Note 10.1, Galaxy Note II, Galaxy S3, Galaxy Tab 7.1 and all of these devices works perfectly. But when I tried to play the same content in Galaxy S2, I got the following message from Log Cat

04-10 15:51:40.998: E/MediaPlayer(15735): setDataSource JAVA path 
04-10 15:51:40.998: E/MediaPlayer-JNI(15735): setDataSource: outside path in JNI is �x @
04-10 15:51:40.998: D/MediaPlayerService(2587): getPlayerType. Ln=908
04-10 15:51:40.998: D/MediaPlayerService(2587): createPlayer. type=4
04-10 15:51:40.998: D/MediaPlayerService(2587):  create StagefrightPlayer
04-10 15:51:40.998: V/AwesomePlayer(2587): constructor
04-10 15:51:41.003: V/AwesomePlayer(2587): reset
04-10 15:51:41.003: V/AwesomePlayer(2587): cancelPlayerEvents (keepBufferingGoing=0)
04-10 15:51:41.003: V/AwesomePlayer(2587): setAudioSink
04-10 15:51:41.003: I/StagefrightPlayer(2587): setDataSource('http://127.0.0.1:7777/UMG_audclp_00008811034528_01_001_67_256k_full_drm.ism/manifest')
04-10 15:51:41.003: V/AwesomePlayer(2587): setDataSource (http://127.0.0.1:7777/UMG_audclp_00008811034528_01_001_67_256k_full_drm.ism/manifest)
04-10 15:51:41.003: V/AwesomePlayer(2587): cancelPlayerEvents (keepBufferingGoing=0)
04-10 15:51:41.003: E/MediaPlayer(15735): In prepareAsync
04-10 15:51:41.008: V/AwesomePlayer(2587): prepareAsync
04-10 15:51:41.013: W/IInputConnectionWrapper(15735): getExtractedText on inactive InputConnection
04-10 15:51:41.023: V/AwesomePlayer(2587): finishSetDataSource_l
04-10 15:51:41.023: I/NuHTTPDataSource(2587): HTTP url
04-10 15:51:41.023: I/NuHTTPDataSource(2587): 1'th connecting...
04-10 15:51:41.023: I/NuHTTPDataSource(2587): connect_l to 127.0.0.1:7777/UMG_audclp_00008811034528_01_001_67_256k_full_drm.ism/manifest @0
04-10 15:51:41.023: I/HTTPStream(2587): disconnect
04-10 15:51:41.023: E/HTTPStream(2587): Connect to 127.0.0.1:7777 
04-10 15:51:41.023: I/HTTPStream(2587): GetAddrInfo new address. (Cache) : 127.0.0.1
04-10 15:51:41.023: E/HTTPStream(2587): Fail to get network interface for socket 20

Then the mediaplayer returns error code -1004.

I tried to play using localhost, 127.0.0.1 and the device ip too, but all of them didn't work in Galaxy S2.

Someone have an idea about it ?

Thanks a lot.

--
--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment