|
|
|
@ -9,6 +9,7 @@ import android.graphics.BitmapFactory |
|
|
|
|
import android.media.AudioFocusRequest |
|
|
|
|
import android.media.AudioManager |
|
|
|
|
import android.media.MediaPlayer |
|
|
|
|
import android.net.Uri |
|
|
|
|
import android.os.Build |
|
|
|
|
import android.os.Handler |
|
|
|
|
import android.support.v4.media.session.MediaSessionCompat |
|
|
|
@ -121,7 +122,8 @@ class AudioPlayService : BaseService(), |
|
|
|
|
AudioPlay.status = Status.PLAY |
|
|
|
|
postEvent(Bus.AUDIO_STATE, Status.PLAY) |
|
|
|
|
mediaPlayer.reset() |
|
|
|
|
mediaPlayer.setDataSource(url) |
|
|
|
|
val uri = Uri.parse(url) |
|
|
|
|
mediaPlayer.setDataSource(this, uri, AudioPlay.headers()) |
|
|
|
|
mediaPlayer.prepareAsync() |
|
|
|
|
} catch (e: Exception) { |
|
|
|
|
launch { |
|
|
|
|