Bug 213658

Summary: Video spills over PiP screen a little when using Picture in Picture
Product: WebKit Reporter: Peng Liu <peng.liu6>
Component: MediaAssignee: Peng Liu <peng.liu6>
Status: RESOLVED FIXED    
Severity: Normal CC: eric.carlson, ews-watchlist, glenn, jer.noble, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
eric.carlson: review+
patch for landing none

Description Peng Liu 2020-06-26 13:32:26 PDT
Video spills over PiP screen a little when using Picture in Picture
Comment 1 Peng Liu 2020-06-26 13:32:58 PDT
<rdar://problem/64747869>
Comment 2 Peng Liu 2020-06-26 17:02:27 PDT
Created attachment 402932 [details]
Patch
Comment 3 Eric Carlson 2020-06-28 17:37:47 PDT
Comment on attachment 402932 [details]
Patch

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

> Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm:986
> +    FloatSize videoDimensions = FloatSize(videoElement.videoWidth(), videoElement.videoHeight());
> +
> +    dispatch_async(dispatch_get_main_queue(), [protectedThis = makeRefPtr(this), this, videoElementClientRect, videoDimensions, viewRef, mode, allowsPictureInPicture] {

Can you use something like this instead - FloatSize videoDimensions = { videoElement.videoWidth(), videoElement.videoHeight() }
Comment 4 Peng Liu 2020-06-29 10:41:59 PDT
Comment on attachment 402932 [details]
Patch

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

>> Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm:986
>> +    dispatch_async(dispatch_get_main_queue(), [protectedThis = makeRefPtr(this), this, videoElementClientRect, videoDimensions, viewRef, mode, allowsPictureInPicture] {
> 
> Can you use something like this instead - FloatSize videoDimensions = { videoElement.videoWidth(), videoElement.videoHeight() }

Good idea! I change it to:
FloatSize videoDimensions = { (float)videoElement.videoWidth(), (float)videoElement.videoHeight() };
Comment 5 Peng Liu 2020-06-29 10:47:51 PDT
Created attachment 403081 [details]
patch for landing
Comment 6 EWS 2020-06-29 16:32:46 PDT
Committed r263707: <https://trac.webkit.org/changeset/263707>

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