Bug 189478 - Expose a few WebPlaybackControlsManager-driven PIP APIs to clients
Summary: Expose a few WebPlaybackControlsManager-driven PIP APIs to clients
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Matt Rajca
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-09-10 12:22 PDT by Matt Rajca
Modified: 2018-09-12 12:10 PDT (History)
1 user (show)

See Also:


Attachments
Patch (12.22 KB, patch)
2018-09-10 16:08 PDT, Matt Rajca
no flags Details | Formatted Diff | Diff
Patch (12.41 KB, patch)
2018-09-10 17:29 PDT, Matt Rajca
no flags Details | Formatted Diff | Diff
Patch (13.86 KB, patch)
2018-09-11 09:50 PDT, Matt Rajca
eric.carlson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Rajca 2018-09-10 12:22:55 PDT
Expose a few WebPlaybackControlsManager-driven PIP APIs to clients.
Comment 1 Matt Rajca 2018-09-10 12:23:11 PDT
<rdar://problem/44312650>
Comment 2 Matt Rajca 2018-09-10 16:08:08 PDT
Created attachment 349349 [details]
Patch
Comment 3 Matt Rajca 2018-09-10 17:29:05 PDT
Created attachment 349361 [details]
Patch
Comment 4 Matt Rajca 2018-09-11 09:50:47 PDT
Created attachment 349402 [details]
Patch
Comment 5 Eric Carlson 2018-09-11 15:32:04 PDT
Comment on attachment 349402 [details]
Patch

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

> Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:1226
> +bool WebViewImpl::isPictureInPictureActive()
> +{
> +    if (!m_playbackControlsManager)
> +        return false;
> +
> +    return [m_playbackControlsManager isPictureInPictureActive];
> +}
> +
> +void WebViewImpl::togglePictureInPicture()
> +{
> +    [m_playbackControlsManager togglePictureInPicture];
> +}

Nit: do you need to NULL-test m_playbackControlsManager in one method but not the other?
Comment 6 Matt Rajca 2018-09-12 12:01:26 PDT
(In reply to Eric Carlson from comment #5)
> Comment on attachment 349402 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=349402&action=review
> 
> > Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:1226
> > +bool WebViewImpl::isPictureInPictureActive()
> > +{
> > +    if (!m_playbackControlsManager)
> > +        return false;
> > +
> > +    return [m_playbackControlsManager isPictureInPictureActive];
> > +}
> > +
> > +void WebViewImpl::togglePictureInPicture()
> > +{
> > +    [m_playbackControlsManager togglePictureInPicture];
> > +}
> 
> Nit: do you need to NULL-test m_playbackControlsManager in one method but
> not the other?

Nope, simplified ::isPictureInPictureActive to avoid the nil check since messaging a nil Obj-C object will result in `NO`.
Comment 7 Matt Rajca 2018-09-12 12:10:11 PDT
Committed r235944: <https://trac.webkit.org/changeset/235944>