[Webkit-unassigned] [Bug 247602] New: [MSE] Should not seek with no seekable range

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 7 20:09:57 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=247602

            Bug ID: 247602
           Summary: [MSE] Should not seek with no seekable range
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Media
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: Yousuke.Kimoto at sony.com

"Seek" cannot be handled when there is no seekable range, but the current implementation,

https://github.com/WebKit/WebKit/blob/main/Source/WebCore/html/HTMLMediaElement.cpp#L3510
#if ENABLE(MEDIA_SOURCE)
    // Always notify the media engine of a seek if the source is not closed. This ensures that the source is
    // always in a flushed state when the 'seeking' event fires.
    if (m_mediaSource && !m_mediaSource->isClosed())
        noSeekRequired = false;
#endif

"noSeekRequired" is set with "false" even if seekableRanges' length is ZERO.

    bool noSeekRequired = !seekableRanges->length();

According to HTML media seeking spec,

https://html.spec.whatwg.org/multipage/media.html#seeking
8. If the (possibly now changed) new playback position is not in one of the ranges given in the seekable attribute, then let it be the position in one of the ranges given in the seekable attribute that is the nearest to the new playback position. If two positions both satisfy that constraint (i.e. the new playback position is exactly in the middle between two ranges in the seekable attribute) then use the position that is closest to the current playback position. If there are no ranges given in the seekable attribute then set the seeking IDL attribute to false and return.

So the length of seekableRanges should be checked to set "false" to noSeekRequired.

This will fix an issue where HTMLMediaElement.duration is Infinity while playing live streaming videos. Sine HTMLMediaElement.duration == Infinity, there is no seekable range. In this case, seeking should be aboted.

Related links:
- Issue 461733: MSE - cannot seek when video.duration set to Infinity
  https://bugs.chromium.org/p/chromium/issues/detail?id=461733
- Seekable differs from non-MSE behavior #5
  https://github.com/w3c/media-source/issues/5

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20221108/1d9f1f4d/attachment.htm>


More information about the webkit-unassigned mailing list