Bug 170545 - Add hasVideo property to WebAVPlayerController.
Summary: Add hasVideo property to WebAVPlayerController.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Per Arne Vollan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-04-06 06:41 PDT by Per Arne Vollan
Modified: 2017-04-07 06:43 PDT (History)
6 users (show)

See Also:


Attachments
Patch (3.76 KB, patch)
2017-04-06 07:08 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (3.76 KB, patch)
2017-04-06 08:13 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (2.70 KB, patch)
2017-04-07 05:23 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Per Arne Vollan 2017-04-06 06:41:27 PDT
The existing “hasEnabledVideo” property may briefly toggle to NO at video item boundaries if the audio track is a tiny bit longer than the video track. We would like to add a new "hasVideo" property which does not have this behavior, but can be used to discover if any video content is present in the playback item, whether video content is currently enabled or not.
Comment 1 Per Arne Vollan 2017-04-06 06:42:29 PDT
rdar://problem/31325182
Comment 2 Per Arne Vollan 2017-04-06 07:08:55 PDT
Created attachment 306379 [details]
Patch
Comment 3 Per Arne Vollan 2017-04-06 08:13:05 PDT
Created attachment 306389 [details]
Patch
Comment 4 Eric Carlson 2017-04-06 09:32:26 PDT
Comment on attachment 306389 [details]
Patch

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

> Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:541
> +    if (hasVideo)
> +        [playerController() setHasVideo:hasVideo];

Won't this do the wrong thing if a media stream switches from video+audio to audio-only (eg. an HLS stream when available bandwidth is too low)?
Comment 5 Per Arne Vollan 2017-04-07 05:23:49 PDT
Created attachment 306489 [details]
Patch
Comment 6 Per Arne Vollan 2017-04-07 05:36:43 PDT
(In reply to Eric Carlson from comment #4)
> Comment on attachment 306389 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=306389&action=review
> 
> > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:541
> > +    if (hasVideo)
> > +        [playerController() setHasVideo:hasVideo];
> 
> Won't this do the wrong thing if a media stream switches from video+audio to
> audio-only (eg. an HLS stream when available bandwidth is too low)?

I removed the if statement, which appears to be unnecessary since WebVideoFullscreenInterfaceAVKit::hasVideoChanged is only called when we enter/leave fullscreen/PiP, as far as I can see. This means the value of the  "hasVideo" property equals 'true' in this implementation, also when the audio track is a bit longer than the video track.

Thanks for reviewing!
Comment 7 WebKit Commit Bot 2017-04-07 06:43:41 PDT
Comment on attachment 306489 [details]
Patch

Clearing flags on attachment: 306489

Committed r215092: <http://trac.webkit.org/changeset/215092>
Comment 8 WebKit Commit Bot 2017-04-07 06:43:43 PDT
All reviewed patches have been landed.  Closing bug.