我正在尝试从Android设备收听流。 听这个流适用于我测试的所有设备(galaxy s I,索尼等)但由于某些原因不适用于Galaxy SIII android 4.1.2
我有一个包装类来控制媒体播放器,但代码转换为这个标准代码:
mediaPlayer = new MediaPlayer();
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mediaPlayer.setDataSource("http://46.105.122.141:3634/");
mediaPlayer.setOnPreparedListener(new OnPreparedListener() {
public void onPrepared(MediaPlayer mp) {
mp.start();
}
});
mediaPlayer.prepareAsnyc();
所以,这在我测试过的所有其他设备上运行良好,但在prepareAsync
中约30秒后在Galaxy SIII上运行得到媒体错误(-1,1004)准备失败错误。
如果我使用本地电台更改流网址
mediaPlayer.setDataSource("http://stream2.srr.ro:8000/");
流媒体在galaxy sIII中也能正常工作。
我在两个流之间看到的唯一差异
http://46.105.122.141:3634/
http://stream2.srr.ro:8000/
是一个提供IP而另一个提供域名。
端口不同(3024vs 8000)
我无法弄清楚为什么这对星系SIII不起作用。
你能帮忙吗?
谢谢!
丹
编辑:
以下是日志: 我看到“这不是DRM内容”,我不知道这意味着什么。
“缓存已达到EOS,准备已完成”。信息。
任何想法可能是什么原因?
06-19 21:57:32.180: V/AwesomePlayer(1919): setDataSource_l: Audio(1), Video(0)
06-19 21:57:32.180: I/AwesomePlayer(1919): AwesomePlayer::setDataSource_l():: This is not a DRM content
06-19 21:57:32.180: I/OMXCodec(1919): Create() mime = audio/mpeg, isAlpAudio = 1
06-19 21:57:32.185: D/dalvikvm(2278): GC_FOR_ALLOC freed 2K, 24% free 45614K/59911K, paused 108ms, total 109ms
06-19 21:57:32.185: W/SignalStrength(2643): getGsmLevel=4
06-19 21:57:32.190: W/SignalStrength(2643): getLevel=4 (SignalStrength: 11 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 gsm|lte 4)
06-19 21:57:32.190: W/SignalStrength(2643): getGsmLevel=4
06-19 21:57:32.190: W/SignalStrength(2643): getLevel=4 (SignalStrength: 11 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 gsm|lte 4)
06-19 21:57:32.190: I/OMXCodec(1919): Successfully allocated and configured OMX node 'OMX.SEC.MP3.Decoder , mIsALPrunning =0'
06-19 21:57:32.190: D/STATUSBAR-NetworkController(2643): onSignalStrengthsChanged signalStrength=SignalStrength: 11 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 gsm|lte 4 level=4
06-19 21:57:32.190: D/STATUSBAR-NetworkController(2643): refreshSignalCluster: data=0 bt=false
06-19 21:57:32.190: D/STATUSBAR-SignalClusterView(2643): mSeparateMobileGroup=8
06-19 21:57:32.190: D/STATUSBAR-SignalClusterView(2643): mSeparateMobileGroup=8
06-19 21:57:32.190: D/STATUSBAR-SignalClusterView(2643): mSeparateMobileGroup=8
06-19 21:57:32.200: W/SignalStrength(2278): getGsmLevel=4
06-19 21:57:32.210: W/SignalStrength(2278): getLevel=4 (SignalStrength: 11 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 gsm|lte 4)
06-19 21:57:32.210: I/ActivityManager(2278): Process com.google.android.apps.maps (pid 18691) (adj 8) has died.
06-19 21:57:32.215: I/ActivityManager(2278): Process com.facebook.katana (pid 16373) (adj 8) has died.
06-19 21:57:32.240: W/SignalStrength(2278): getGsmDbm=-91
06-19 21:57:32.240: W/SignalStrength(2278): getDbm=-91
06-19 21:57:32.240: W/SignalStrength(2278): getGsmAsuLevel=11
06-19 21:57:32.240: W/SignalStrength(2278): getAsuLevel=11
06-19 21:57:32.295: D/AwesomePlayer(1919): cache has reached EOS, prepare is done.
06-19 21:57:32.295: W/AwesomePlayer(1919): abortPrepare() mIsAsyncPrepare (1), err (-2147483648)
06-19 21:57:32.295: V/AwesomePlayer(1919): notifyListner_l() msg (100-MEDIA_ERROR), ext1 (1), ext2 (-2147483648)
06-19 21:57:32.295: E/AwesomePlayer(1919): return http streaming network error
06-19 21:57:32.295: V/MediaPlayerService(1919): [238] notify (0x41f61fa8, 100, 1, -1004)
06-19 21:57:32.410: V/MediaPlayer(19075): message received msg=100, ext1=1, ext2=-1004
06-19 21:57:32.410: E/MediaPlayer(19075): error (1, -1004)
06-19 21:57:32.410: V/MediaPlayer(19075): signal application thread
06-19 21:57:32.410: V/MediaPlayer(19075): prepare complete - status=1
答案 0 :(得分:0)
06-19 21:57:32.295:V / MediaPlayerService(1919):[238]通知(0x41f61fa8,100,1,-1004)
我今天遇到了这个确切的情况,我的问题是我在防火墙后面,它不允许其中一个流端口上有一个流量。