1

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

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
javatar
  • 115
  • 11

2 Answers2

0

Try this

    mediaPlayer.setDataSource(URLEncoder.encode(yourSongURL,"UTF-8"));
Barış Çırıka
  • 1,570
  • 1
  • 15
  • 24
0

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.

javatar
  • 115
  • 11