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

4

2 回答 2

0

Try this

    mediaPlayer.setDataSource(URLEncoder.encode(yourSongURL,"UTF-8"));
于 2012-11-07T09:05:25.747 回答
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.

于 2012-11-20T07:19:32.267 回答