Android sdk 2.3.3 E/MediaPlayer(334): error (1, -2147483648) when Turkish chars used in setDataSource

StackOverflow https://stackoverflow.com/questions/13265007

سؤال

In my program, I used url in mediaplayer's datasource. If url does not contain any turkish chars, it works normally. However, if it contains turkish chars, following error occurs:

E/MediaPlayer(334): error (1, -2147483648)

In the Url, turkish chars are used in the parameter part

Same error occurs when I use encoded Url, but same url is working correctly in mozilla

Thanks

هل كانت مفيدة؟

المحلول 2

instead of setting a URL as a datasource, I create a sound file (with HttpUrlConnection, I got the inputstream and wrote it in a file) and set it as datasource.

نصائح أخرى

Try this

    mediaPlayer.setDataSource(URLEncoder.encode(yourSongURL,"UTF-8"));
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top