Android MediaPlayer error: MediaPlayer error(1, -2147483648) on Stream from internet

前端 未结 3 1129
孤独总比滥情好
孤独总比滥情好 2020-12-18 09:45

I\'m trying to stream audio from a URL. The code works fine with other URLs, but in one of those it fails in the OnPrepared method, returning this error code: (

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-18 10:09

    I was also getting the same error on Froyo & Gingerbread. In higher Androids the same video played well. Finally after a lot of research, tried changing the Https Url to Http Url & Bingo. It resolved my issue. I was using amazon S3 server so that simply replacing the "https" in url with "http" was sufficient.

      videoUrl= videoUrl.replaceFirst("https", "http"); 
    

    PS: For supporting older versions if you are using H.264 make sure videos are Baseline encoded.

提交回复
热议问题