Bug 198345 - Video playback in Safari should continue when CarPlay is plugged in
Summary: Video playback in Safari should continue when CarPlay is plugged in
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-05-29 12:15 PDT by Jer Noble
Modified: 2019-05-30 21:46 PDT (History)
5 users (show)

See Also:


Attachments
Patch (20.14 KB, patch)
2019-05-29 12:18 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (19.69 KB, patch)
2019-05-30 08:49 PDT, Jer Noble
jer.noble: commit-queue+
Details | Formatted Diff | Diff
Patch for landing (20.52 KB, patch)
2019-05-30 08:50 PDT, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2019-05-29 12:15:44 PDT
Video playback in Safari should continue when CarPlay is plugged in
Comment 1 Jer Noble 2019-05-29 12:17:03 PDT
<rdar://problem/45505750>
Comment 2 Jer Noble 2019-05-29 12:18:14 PDT
Created attachment 370875 [details]
Patch
Comment 3 Eric Carlson 2019-05-29 15:15:05 PDT
Comment on attachment 370875 [details]
Patch

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

> Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm:213
> +    setIsPlayingToAutomotiveHeadUnit(carPlayIsConnected.value());

Shouldn't this be: setIsPlayingToAutomotiveHeadUnit(carPlayIsConnected && carPlayIsConnected.value())

> Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm:312
> +    callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self)]() mutable {

:-/

> Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm:450
> +        protectedSelf->_callback->carPlayServerDied();

_callback should be NULL-checked, it may have been clear by the time this runs

> Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm:467
> +        protectedSelf->_callback->updateCarPlayIsConnected(WTFMove(carPlayIsConnected));

Ditto.

> LayoutTests/media/video-isplayingtoautomotiveheadunit.html:11
> +		findMediaElement();
> +
> +		run('video.src = findMediaFile("video", "content/test")');

:-O TABS!
Comment 4 Jer Noble 2019-05-29 16:38:26 PDT
Comment on attachment 370875 [details]
Patch

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

>> Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm:213
>> +    setIsPlayingToAutomotiveHeadUnit(carPlayIsConnected.value());
> 
> Shouldn't this be: setIsPlayingToAutomotiveHeadUnit(carPlayIsConnected && carPlayIsConnected.value())

Yeah, it probably should be (in the case that we can't load the CarPlayIsConnectedAttribute).

>> Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm:450
>> +        protectedSelf->_callback->carPlayServerDied();
> 
> _callback should be NULL-checked, it may have been clear by the time this runs

Will do.
Comment 5 Jer Noble 2019-05-30 08:49:53 PDT
Created attachment 370944 [details]
Patch for landing
Comment 6 Jer Noble 2019-05-30 08:50:41 PDT
Created attachment 370945 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2019-05-30 09:29:44 PDT
Comment on attachment 370945 [details]
Patch for landing

Clearing flags on attachment: 370945

Committed r245887: <https://trac.webkit.org/changeset/245887>
Comment 8 WebKit Commit Bot 2019-05-30 09:29:46 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Truitt Savell 2019-05-30 09:56:41 PDT
Fixed iOS build in https://trac.webkit.org/changeset/245890/webkit
Comment 10 Jer Noble 2019-05-30 12:04:46 PDT
(In reply to Truitt Savell from comment #9)
> Fixed iOS build in https://trac.webkit.org/changeset/245890/webkit

Thanks Truitt!
Comment 11 Ryan Haddad 2019-05-30 20:18:23 PDT
This change broke internal builds, details in email and radar. 

Reverted in https://trac.webkit.org/r245944
Comment 12 Jer Noble 2019-05-30 21:46:50 PDT
Committed r245947: <https://trac.webkit.org/changeset/245947>