pull/32/head
parent
43530e2246
commit
9035e15c3e
@ -0,0 +1,20 @@ |
||||
package io.legado.app.help |
||||
|
||||
import android.content.Context |
||||
import android.media.MediaPlayer |
||||
import io.legado.app.R |
||||
|
||||
object MediaHelp { |
||||
|
||||
|
||||
fun playSilentSound(mContext: Context) { |
||||
try { |
||||
// Stupid Android 8 "Oreo" hack to make media buttons work |
||||
val mMediaPlayer = MediaPlayer.create(mContext, R.raw.silent_sound) |
||||
mMediaPlayer.setOnCompletionListener { it.release() } |
||||
mMediaPlayer.start() |
||||
} catch (ignored: Exception) { |
||||
} |
||||
|
||||
} |
||||
} |
Binary file not shown.
Loading…
Reference in new issue