EspoirX / StarrySky

🔥A Powerful and Streamline MusicLibrary(一个丰富的音乐播放封装库,支持多种音频格式,完美解决你的问题。)
https://github.com/EspoirX/StarrySky
MIT License
1.39k stars 209 forks source link

Bug Play m4a File auto pause not play #201

Open tolgatasci opened 2 years ago

tolgatasci commented 2 years ago

LOG

2021-12-07 23:17:35.373 12950-12950/ I/StarrySky: title = xx 音频是否有改变 = false 是否立即播放 = true url = /storage/emulated/0/Music/test.m4a 2021-12-07 23:17:35.374 12950-12950/ I/StarrySky: isPlayWhenReady = true 2021-12-07 23:17:35.374 12950-12950/ I/StarrySky: ---------------------------------------
Tested Device emulator 25 Google Api

    val info = SongInfo()
    info.songName = "xx"
    info.songId = "5"
    info.songUrl = "/storage/emulated/0/Music/test.m4a"
   //StarrySky.newPlayer(0)?.play(info, true) // Working
   //StarrySky.with().playMusicByInfo(info) // not work

My Application

        StarrySky.init(this)
        .setNotificationSwitch(true)

        .setNotificationType(INotification.SYSTEM_NOTIFICATION)
        .setNotificationConfig(notificationConfig)
        .apply()
tolgatasci commented 2 years ago

I think problem audiofocus audioManager.requestAudioFocus(onAudioFocusListener, STREAM_MUSIC, AUDIOFOCUS_GAIN) == AUDIOFOCUS_REQUEST_GRANTED test device false

EspoirX commented 2 years ago

Let me try the audio for you,Give me the address of your audio file

tolgatasci commented 2 years ago

https://ufile.io/6cvghtek

if you downloaded. can you told to me for delete file