Skip to content

Fixes iOS paused event thrown even when playWhenReady is set to true#37

Merged
Sithira merged 1 commit into
Sithira:masterfrom
JanStorm:issue-35
Nov 7, 2021
Merged

Fixes iOS paused event thrown even when playWhenReady is set to true#37
Sithira merged 1 commit into
Sithira:masterfrom
JanStorm:issue-35

Conversation

@JanStorm

Copy link
Copy Markdown

Fixes #35
The FLUTTER_RADIO_PAUSED event was dispatched after the play() method when having playWhenReady set to true.
So the playing event is quickly overwritten by the paused event.
Code change should be logically the same as this:

if (!isPlaying()) {
    pushEvent(eventName: Constants.FLUTTER_RADIO_PAUSED) // Moved this call up so its called before the play function
    if (self.playWhenReady) {
        play()
    }
} else {
    pushEvent(eventName: Constants.FLUTTER_RADIO_PLAYING)
}

@nmeri17 nmeri17 mentioned this pull request Apr 2, 2021
@yusriltakeuchi

Copy link
Copy Markdown
Contributor

@JanStorm when try in ios, some station not working, but in android works.
It's return
flutter: object data: flutter_radio_paused
flutter: object data: flutter_radio_error

is this PR solve this issue?

if yes, can i use your repo in my pubspec.yaml?

@Sithira Sithira merged commit 6c63a2f into Sithira:master Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On iOS reports flutter_radio_paused when it is actually playing

3 participants