mihai8804858 / swift-chunked-audio-player

Simple audio player for sync / async chunked audio streams
MIT License
25 stars 5 forks source link

player state change observation doesn't seem to work in Release builds #11

Open mikeg0184 opened 1 month ago

mikeg0184 commented 1 month ago

I'm observing an an audioplayer's state like so:

      player.$currentState.sink { state in
        print(state)
        if state == .playing {
            // Do something
        }

        if state == .completed {
          // Do something else
        }
      }.store(in: &bag)

This work perfectly fine in Debug builds, however in a Release build it immediately stops receiving events after initial.

mihai8804858 commented 1 month ago

Hi, I just tried running the example project in Release on device and currentState is being updated property. Can you try again from latest version? If it's still reproducible, can you try if you can replicate in the example project?