Closed jonalmeida closed 5 years ago
What happens internally:
Media: PLAY State: None -> Playing Service Start Requesting audio Focus (1; AUDIOFOCUS_GAIN)
Media: PAUSE State: Playing -> Pause
Media: SEEKING State: Pause-> None Service stopped
Media: PLAY State: None -> Playing Service started Requesting audio focus (1; AUDIOFOCUS_GAIN)
Audio Focus change (-1; AUDIOFOCUS_LOSS) Pausing media Media: PAUSE State: Playing -> Pause
Two observations:
This also makes me realize that we did not implement any abandonAudioFocus() calls. I'll start with that.
Correctly abandoning and then re-requesting audio focus definitely fixes the issue.
The notification briefly disappears while the seek happens. So we could still keep the playing state while seeking.
Correctly abandoning and then re-requesting audio focus definitely fixes the issue.
The notification briefly disappears while the seek happens. So we could still keep the playing state while seeking.
I'll leave it at that for now and close this issue. The issue is fixed with correctly abandoning and re-focusing. Keeping the state is more complicated and may not be necessary for now.
@pocmo on r-b after this change, videos don't seem to play anymore. I'm not sure if it's related to this one though.
@jonalmeida Mh, YouTube and Vimeo still seem to work here. Can you file this separately so that we can look into it?
STR
Expected
At 3, the video should not pause (this is existing behaviour). At 5, the video should play immediately when we press play.
Actual
At 3, the video pauses. At 5, the video does not play after press the play button. You have to always press the play button twice.
┆Issue is synchronized with this Jira Task