signalapp / Signal-iOS

A private messenger for iOS.
https://signal.org
GNU Affero General Public License v3.0
10.78k stars 3.02k forks source link

Video Stories don't pause music #5725

Closed lukasvrenner closed 5 months ago

lukasvrenner commented 9 months ago

Bug description

Describe here the issue that you are experiencing.

When watching a story video with sound, it ought to pause any playing music. This behavior is found for every other thing that plays sound, even watching normal videos on Signal.

Steps to reproduce

Actual result: Describe here what happens after you run the steps above (i.e. the buggy behaviour)

Audio of video plays overtop of music

Expected result: Describe here what should happen after you run the steps above (i.e. what would be the correct behaviour)

Video ought to automatically pause music, which is generally the expected behavior

Screenshots

Device info

Device: iPhone 11

iOS version: 17.1.2

Signal version: 6.54

Link to debug log

https://debuglogs.org/ios/6.54.0/f961dc891ccf1f4a4398508344c737498ee315674e01ecaf02ba0409b21bf737.zip

lukasvrenner commented 9 months ago

I'm not positive, and I haven't tested it, but the issue appears to be on line 43 of Signal/src/ViewControllers/HomeView/Stories/Context/View, where it says behavior: .playbackMixWithOthers, rather than behavior: .playback

image

blackjackfruit commented 9 months ago

The following commit included the change from .playback to .playbackMixWithOthers on purpose: Screenshot 2024-01-02 at 5 30 35 PM

Not only as a user but as a developer the behavior I would think best is to pause another apps audio to play the story and then let iOS resume the other app's audio once the story has stopped playing. An experience similar to youtube playing a podcast and then going to instagram to view a full screen story should pause youtube until the story is complete or the user dismisses the story.

The fix should be to use .notifyOthersOnDeactivation when setActive is set to false try AVAudioSession.sharedInstance().setActive(false, options: .notifyOthersOnDeactivation) Also it would be necessary to change from .playbackMixWithOthers back to .playback.

@lukasvrenner what is the expected experience, is mixWithOthers or resume another app's audio after stopping a story?

lukasvrenner commented 9 months ago

@lukasvrenner what is the expected experience, is mixWithOthers or resume another app's audio after stopping a story?

@blackjackfruit I agree, that makes a lot of sense to have it pause audio, and then resume once the story is over. Mixing with others doesn't make any sense in my opinion, because suddenly you can't hear what you're listening to, and you can't hear the sound in the story either.

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 5 months ago

This issue has been closed due to inactivity.