Bug 236993

Summary: [iOS] WebKit app is sometimes not "Now Playing" during initial playback
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: MediaAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, calvaris, cdumez, changseok, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, philipj, sergio, supersonicandtails
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
eric.carlson: review+
Patch for landing
none
Patch for landing
ews-feeder: commit-queue-
Patch for landing
none
Patch for landing
none
Patch for landing
none
Patch for landing
none
Patch for landing
none
Patch for landing
none
Patch for landing none

Description Jer Noble 2022-02-21 13:19:03 PST
[iOS] WebKit app is sometimes not "Now Playing" during initial playback
Comment 1 Jer Noble 2022-02-21 13:20:02 PST
<rdar://88827167>
Comment 2 Jer Noble 2022-02-21 13:30:35 PST
Created attachment 452764 [details]
Patch
Comment 3 Eric Carlson 2022-02-21 13:37:05 PST
Comment on attachment 452764 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=452764&action=review

> Source/WebCore/html/HTMLMediaElement.cpp:5715
> +#if USE(AUDIO_SESSION)
> +    m_categoryAtMostRecentPlayback = AudioSession::sharedSession().category();
> +#endif

Don't we also want to do this before calling `m_player->playAtHostTime`?
Comment 4 Jer Noble 2022-02-21 13:38:26 PST
(In reply to Eric Carlson from comment #3)
> Comment on attachment 452764 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=452764&action=review
> 
> > Source/WebCore/html/HTMLMediaElement.cpp:5715
> > +#if USE(AUDIO_SESSION)
> > +    m_categoryAtMostRecentPlayback = AudioSession::sharedSession().category();
> > +#endif
> 
> Don't we also want to do this before calling `m_player->playAtHostTime`?

Good point! I'll move the setter up inside this function.
Comment 5 Jer Noble 2022-02-21 13:39:40 PST
Created attachment 452767 [details]
Patch for landing
Comment 6 Jer Noble 2022-02-21 13:53:53 PST
Created attachment 452772 [details]
Patch for landing
Comment 7 Jer Noble 2022-02-21 14:56:32 PST
Created attachment 452779 [details]
Patch for landing
Comment 8 Jer Noble 2022-02-22 17:15:29 PST
Created attachment 452921 [details]
Patch for landing
Comment 9 Aakash Jain 2022-02-23 15:22:24 PST
I cancelled https://ews-build.webkit.org/#/builders/73/builds/933 to speed-up mac-wk1 queue. It finished layout-test run and indicated a test failure: media/audio-session-category-at-most-recent-playback.html
Comment 10 Jer Noble 2022-02-23 16:12:35 PST
Created attachment 453045 [details]
Patch for landing
Comment 11 Aakash Jain 2022-02-24 06:59:57 PST
I cancelled https://ews-build.webkit.org/#/builders/73/builds/1061 to speed up mac-wk1 queue. It already run layout-tests and indicated this failure: media/audio-session-category-at-most-recent-playback.html
Comment 12 Jer Noble 2022-02-28 08:52:45 PST
Created attachment 453393 [details]
Patch for landing
Comment 13 Jer Noble 2022-03-16 15:56:10 PDT
Test is failing WK1 bots because `DeprecatedGlobalSettings::shouldManageAudioSessionCategory()` is false there. Will update TestExpectations and re-upload.
Comment 14 Jer Noble 2022-03-16 16:01:45 PDT
Created attachment 454905 [details]
Patch for landing
Comment 15 Jer Noble 2022-03-20 22:42:08 PDT
Created attachment 455214 [details]
Patch for landing
Comment 16 Jer Noble 2022-03-20 22:44:51 PDT
Created attachment 455216 [details]
Patch for landing
Comment 17 Jer Noble 2022-03-21 09:42:18 PDT
Comment on attachment 455214 [details]
Patch for landing

iOS-wk2 bot failure is unrelated; cq+ing.
Comment 18 EWS 2022-03-23 12:22:46 PDT
Committed r291759 (248790@main): <https://commits.webkit.org/248790@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 455214 [details].