Changeset 265145 in webkit


Ignore:
Timestamp:
Jul 31, 2020 10:09:04 AM (4 years ago)
Author:
Peng Liu
Message:

PIP on netflix.com shows only a gray window and spinner
https://bugs.webkit.org/show_bug.cgi?id=214899

Reviewed by Jer Noble.

Use an empty "seekableRanges" instead of a special "duration" value (NaN) to indicate
that seeking is not supported. With this change, the "duration" will always have a meaningful
value, so that WebAVPlayerController can work properly in the picture-in-picture mode.
Related change: https://trac.webkit.org/changeset/217858.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::supportsSeeking const):

  • platform/cocoa/PlaybackSessionModelMediaElement.mm:

(WebCore::PlaybackSessionModelMediaElement::duration const):
(WebCore::PlaybackSessionModelMediaElement::seekableRanges const):

  • platform/mac/WebPlaybackControlsManager.mm:

(-[WebPlaybackControlsManager canBeginTouchBarScrubbing]):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r265138 r265145  
     12020-07-31  Peng Liu  <peng.liu6@apple.com>
     2
     3        PIP on netflix.com shows only a gray window and spinner
     4        https://bugs.webkit.org/show_bug.cgi?id=214899
     5
     6        Reviewed by Jer Noble.
     7
     8        Use an empty "seekableRanges" instead of a special "duration" value (NaN) to indicate
     9        that seeking is not supported. With this change, the "duration" will always have a meaningful
     10        value, so that WebAVPlayerController can work properly in the picture-in-picture mode.
     11        Related change: https://trac.webkit.org/changeset/217858.
     12
     13        * html/HTMLMediaElement.cpp:
     14        (WebCore::HTMLMediaElement::supportsSeeking const):
     15        * platform/cocoa/PlaybackSessionModelMediaElement.mm:
     16        (WebCore::PlaybackSessionModelMediaElement::duration const):
     17        (WebCore::PlaybackSessionModelMediaElement::seekableRanges const):
     18        * platform/mac/WebPlaybackControlsManager.mm:
     19        (-[WebPlaybackControlsManager canBeginTouchBarScrubbing]):
     20
    1212020-07-31  Carlos Garcia Campos  <cgarcia@igalia.com>
    222
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r264710 r265145  
    74977497bool HTMLMediaElement::supportsSeeking() const
    74987498{
    7499     return !document().quirks().needsSeekingSupportDisabled() && !isLiveStream();
     7499    return !document().quirks().needsSeekingSupportDisabled();
    75007500}
    75017501
  • trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm

    r262632 r265145  
    427427double PlaybackSessionModelMediaElement::duration() const
    428428{
    429     if (!m_mediaElement)
    430         return 0;
    431     return m_mediaElement->supportsSeeking() ? m_mediaElement->duration() : std::numeric_limits<double>::quiet_NaN();
     429    return m_mediaElement ? m_mediaElement->duration() : 0;
    432430}
    433431
     
    459457Ref<TimeRanges> PlaybackSessionModelMediaElement::seekableRanges() const
    460458{
    461     return m_mediaElement ? m_mediaElement->seekable() : TimeRanges::create();
     459    return m_mediaElement && m_mediaElement->supportsSeeking() ? m_mediaElement->seekable() : TimeRanges::create();
    462460}
    463461
  • trunk/Source/WebCore/platform/mac/WebPlaybackControlsManager.mm

    r260485 r265145  
    120120    // other media. The intent of the API is that we return NO when the media is being scrubbed via the on-screen scrubber.
    121121    // But we can only possibly get the right answer for media that uses the default controls.
    122     return std::isfinite(_contentDuration);;
     122    return std::isfinite(_contentDuration) && [_seekableTimeRanges count];
    123123}
    124124
Note: See TracChangeset for help on using the changeset viewer.