Changeset 206146 in webkit


Ignore:
Timestamp:
Sep 20, 2016 8:26:19 AM (8 years ago)
Author:
jer.noble@apple.com
Message:

[media-source] Support MediaSource.setLiveSeekableRanges()
https://bugs.webkit.org/show_bug.cgi?id=162252

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

  • web-platform-tests/media-source/interfaces-expected.txt:

Source/WebCore:

Fixes tests: imported/w3c/web-platform-tests/media-source/interfaces.html

imported/w3c/web-platform-tests/media-source/mediasource-liveseekable.html

Add support for a new part of the Media Source specification, the ability for clients to
specify the seekable ranges for a MediaSource-backed HTMLMediaElement.

Adding the live-seekable methods to MediaSource fixes a large number of the interfaces.html
tests, and the rest are fixed by adding on<event> handlers to MediaSource, SourceBuffer,
and SourceBufferList.

  • Modules/mediasource/MediaSource.cpp:

(WebCore::MediaSource::seekable):
(WebCore::MediaSource::setLiveSeekableRange):
(WebCore::MediaSource::clearLiveSeekableRange):

  • Modules/mediasource/MediaSource.h:
  • Modules/mediasource/MediaSource.idl:
  • Modules/mediasource/SourceBuffer.idl:
  • Modules/mediasource/SourceBufferList.idl:
  • Modules/mediasource/VideoPlaybackQuality.idl:
  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::seekable):

LayoutTests:

  • platform/mac/TestExpectations:
  • platform/mac/imported/w3c/web-platform-tests/media-source/interfaces-expected.txt:
  • platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac/js/dom/global-constructors-attributes-expected.txt:
Location:
trunk
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r206133 r206146  
     12016-09-20  Jer Noble  <jer.noble@apple.com>
     2
     3        [media-source] Support MediaSource.setLiveSeekableRanges()
     4        https://bugs.webkit.org/show_bug.cgi?id=162252
     5
     6        Reviewed by Sam Weinig.
     7
     8        * platform/mac/TestExpectations:
     9        * platform/mac/imported/w3c/web-platform-tests/media-source/interfaces-expected.txt:
     10        * platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
     11        * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
     12        * platform/mac/js/dom/global-constructors-attributes-expected.txt:
     13
    1142016-09-19  Devin Rousso  <dcrousso+webkit@gmail.com>
    215
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r206140 r206146  
     12016-09-20  Jer Noble  <jer.noble@apple.com>
     2
     3        [media-source] Support MediaSource.setLiveSeekableRanges()
     4        https://bugs.webkit.org/show_bug.cgi?id=162252
     5
     6        Reviewed by Sam Weinig.
     7
     8        * web-platform-tests/media-source/interfaces-expected.txt:
     9
    1102016-09-19  Chris Dumez  <cdumez@apple.com>
    211
  • trunk/LayoutTests/imported/w3c/web-platform-tests/media-source/interfaces-expected.txt

    r205777 r206146  
    11
    22PASS URL interface: operation createObjectURL(MediaSource)
    3 PASS HTMLVideoElement interface: operation getVideoPlaybackQuality()
    43PASS AudioTrack interface: attribute sourceBuffer
    54PASS VideoTrack interface: attribute sourceBuffer
     
    6867PASS SourceBuffer interface: attribute onerror
    6968PASS SourceBuffer interface: attribute onabort
    70 PASS SourceBuffer interface: operation appendBuffer(ArrayBuffer)
    71 PASS SourceBuffer interface: operation appendBuffer(ArrayBufferView)
    72 PASS SourceBuffer interface: operation appendStream(ReadableStream,unsigned long long)
     69PASS SourceBuffer interface: operation appendBuffer(BufferSource)
    7370PASS SourceBuffer interface: operation abort()
    7471PASS SourceBuffer interface: operation remove(double,unrestricted double)
    75 PASS SourceBuffer interface: attribute trackDefaults
    7672PASS SourceBuffer must be primary interface of sourceBuffer
    7773PASS Stringification of sourceBuffer
     
    9187PASS SourceBuffer interface: sourceBuffer must inherit property "onabort" with the proper type (13)
    9288PASS SourceBuffer interface: sourceBuffer must inherit property "appendBuffer" with the proper type (14)
    93 PASS SourceBuffer interface: calling appendBuffer(ArrayBuffer) on sourceBuffer with too few arguments must throw TypeError
    94 PASS SourceBuffer interface: sourceBuffer must inherit property "appendBuffer" with the proper type (15)
    95 PASS SourceBuffer interface: calling appendBuffer(ArrayBufferView) on sourceBuffer with too few arguments must throw TypeError
    96 PASS SourceBuffer interface: sourceBuffer must inherit property "appendStream" with the proper type (16)
    97 PASS SourceBuffer interface: calling appendStream(ReadableStream,unsigned long long) on sourceBuffer with too few arguments must throw TypeError
    98 PASS SourceBuffer interface: sourceBuffer must inherit property "abort" with the proper type (17)
    99 PASS SourceBuffer interface: sourceBuffer must inherit property "remove" with the proper type (18)
     89PASS SourceBuffer interface: calling appendBuffer(BufferSource) on sourceBuffer with too few arguments must throw TypeError
     90PASS SourceBuffer interface: sourceBuffer must inherit property "abort" with the proper type (15)
     91PASS SourceBuffer interface: sourceBuffer must inherit property "remove" with the proper type (16)
    10092PASS SourceBuffer interface: calling remove(double,unrestricted double) on sourceBuffer with too few arguments must throw TypeError
    101 PASS SourceBuffer interface: sourceBuffer must inherit property "trackDefaults" with the proper type (19)
    10293PASS EventTarget interface: sourceBuffer must inherit property "addEventListener" with the proper type (0)
    10394PASS EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on sourceBuffer with too few arguments must throw TypeError
     
    125116PASS EventTarget interface: mediaSource.sourceBuffers must inherit property "dispatchEvent" with the proper type (2)
    126117PASS EventTarget interface: calling dispatchEvent(Event) on mediaSource.sourceBuffers with too few arguments must throw TypeError
    127 PASS VideoPlaybackQuality interface: existence and properties of interface object
    128 PASS VideoPlaybackQuality interface object length
    129 PASS VideoPlaybackQuality interface object name
    130 PASS VideoPlaybackQuality interface: existence and properties of interface prototype object
    131 PASS VideoPlaybackQuality interface: existence and properties of interface prototype object's "constructor" property
    132 PASS VideoPlaybackQuality interface: attribute creationTime
    133 PASS VideoPlaybackQuality interface: attribute totalVideoFrames
    134 PASS VideoPlaybackQuality interface: attribute droppedVideoFrames
    135 PASS VideoPlaybackQuality interface: attribute corruptedVideoFrames
    136 PASS VideoPlaybackQuality interface: attribute totalFrameDelay
    137 PASS VideoPlaybackQuality must be primary interface of video.getVideoPlaybackQuality()
    138 PASS Stringification of video.getVideoPlaybackQuality()
    139 PASS VideoPlaybackQuality interface: video.getVideoPlaybackQuality() must inherit property "creationTime" with the proper type (0)
    140 PASS VideoPlaybackQuality interface: video.getVideoPlaybackQuality() must inherit property "totalVideoFrames" with the proper type (1)
    141 PASS VideoPlaybackQuality interface: video.getVideoPlaybackQuality() must inherit property "droppedVideoFrames" with the proper type (2)
    142 PASS VideoPlaybackQuality interface: video.getVideoPlaybackQuality() must inherit property "corruptedVideoFrames" with the proper type (3)
    143 PASS VideoPlaybackQuality interface: video.getVideoPlaybackQuality() must inherit property "totalFrameDelay" with the proper type (4)
    144 PASS TrackDefault interface: existence and properties of interface object
    145 PASS TrackDefault interface object length
    146 PASS TrackDefault interface object name
    147 PASS TrackDefault interface: existence and properties of interface prototype object
    148 PASS TrackDefault interface: existence and properties of interface prototype object's "constructor" property
    149 PASS TrackDefault interface: attribute type
    150 PASS TrackDefault interface: attribute byteStreamTrackID
    151 PASS TrackDefault interface: attribute language
    152 PASS TrackDefault interface: attribute label
    153 PASS TrackDefault interface: operation getKinds()
    154 PASS TrackDefaultList interface: existence and properties of interface object
    155 PASS TrackDefaultList interface object length
    156 PASS TrackDefaultList interface object name
    157 PASS TrackDefaultList interface: existence and properties of interface prototype object
    158 PASS TrackDefaultList interface: existence and properties of interface prototype object's "constructor" property
    159 PASS TrackDefaultList interface: attribute length
    160 PASS TrackDefaultList must be primary interface of sourceBuffer.trackDefaults
    161 PASS Stringification of sourceBuffer.trackDefaults
    162 PASS TrackDefaultList interface: sourceBuffer.trackDefaults must inherit property "length" with the proper type (0)
    163118
  • trunk/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt

    r205893 r206146  
    19841984PASS Object.getOwnPropertyDescriptor(global, 'ShadowRoot').enumerable is false
    19851985PASS Object.getOwnPropertyDescriptor(global, 'ShadowRoot').configurable is true
     1986PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').value is SourceBuffer
     1987PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('get') is false
     1988PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('set') is false
     1989PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').enumerable is false
     1990PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').configurable is true
     1991PASS Object.getOwnPropertyDescriptor(global, 'SourceBufferList').value is SourceBufferList
     1992PASS Object.getOwnPropertyDescriptor(global, 'SourceBufferList').hasOwnProperty('get') is false
     1993PASS Object.getOwnPropertyDescriptor(global, 'SourceBufferList').hasOwnProperty('set') is false
     1994PASS Object.getOwnPropertyDescriptor(global, 'SourceBufferList').enumerable is false
     1995PASS Object.getOwnPropertyDescriptor(global, 'SourceBufferList').configurable is true
    19861996PASS Object.getOwnPropertyDescriptor(global, 'SpeechSynthesisEvent').value is SpeechSynthesisEvent
    19871997PASS Object.getOwnPropertyDescriptor(global, 'SpeechSynthesisEvent').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt

    r205896 r206146  
    19991999PASS Object.getOwnPropertyDescriptor(global, 'ShadowRoot').enumerable is false
    20002000PASS Object.getOwnPropertyDescriptor(global, 'ShadowRoot').configurable is true
     2001PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').value is SourceBuffer
     2002PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('get') is false
     2003PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('set') is false
     2004PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').enumerable is false
     2005PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').configurable is true
     2006PASS Object.getOwnPropertyDescriptor(global, 'SourceBufferList').value is SourceBufferList
     2007PASS Object.getOwnPropertyDescriptor(global, 'SourceBufferList').hasOwnProperty('get') is false
     2008PASS Object.getOwnPropertyDescriptor(global, 'SourceBufferList').hasOwnProperty('set') is false
     2009PASS Object.getOwnPropertyDescriptor(global, 'SourceBufferList').enumerable is false
     2010PASS Object.getOwnPropertyDescriptor(global, 'SourceBufferList').configurable is true
    20012011PASS Object.getOwnPropertyDescriptor(global, 'SpeechSynthesisEvent').value is SpeechSynthesisEvent
    20022012PASS Object.getOwnPropertyDescriptor(global, 'SpeechSynthesisEvent').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/mac/TestExpectations

    r206127 r206146  
    10591059[ Yosemite+ ] imported/w3c/web-platform-tests/media-source/mediasource-endofstream-invaliderror.html [ Pass ]
    10601060[ Yosemite+ ] imported/w3c/web-platform-tests/media-source/mediasource-getvideoplaybackquality.html [ Pass ]
     1061[ Yosemite+ ] imported/w3c/web-platform-tests/media-source/mediasource-liveseekable.html [ Pass ]
    10611062[ Yosemite+ ] imported/w3c/web-platform-tests/media-source/mediasource-multiple-attach.html [ Pass ]
    10621063[ Yosemite+ ] imported/w3c/web-platform-tests/media-source/mediasource-play-then-seek-back.html [ Pass ]
     
    10661067[ Yosemite+ ] imported/w3c/web-platform-tests/media-source/mediasource-sourcebufferlist.html [ Pass ]
    10671068[ Yosemite+ ] imported/w3c/web-platform-tests/media-source/mediasource-timestamp-offset.html [ Pass ]
     1069
     1070# Passes, but will need rebaselining once <https://github.com/w3c/web-platform-tests/pull/3758> is merged
     1071[ Yosemite+ ] imported/w3c/web-platform-tests/media-source/interfaces.html [ Pass ]
    10681072
    10691073# Newly failing Media Source tests
  • trunk/LayoutTests/platform/mac/imported/w3c/web-platform-tests/media-source/interfaces-expected.txt

    r206145 r206146  
    11
    22PASS URL interface: operation createObjectURL(MediaSource)
    3 PASS HTMLVideoElement interface: operation getVideoPlaybackQuality()
    43PASS AudioTrack interface: attribute sourceBuffer
    54PASS VideoTrack interface: attribute sourceBuffer
     
    2928PASS MediaSource interface: mediaSource must inherit property "readyState" with the proper type (2)
    3029PASS MediaSource interface: mediaSource must inherit property "duration" with the proper type (3)
    31 PASS MediaSource interface: mediaSource must inherit property "onsourceopen" with the proper type (4)
    32 PASS MediaSource interface: mediaSource must inherit property "onsourceended" with the proper type (5)
    33 PASS MediaSource interface: mediaSource must inherit property "onsourceclose" with the proper type (6)
     30FAIL MediaSource interface: mediaSource must inherit property "onsourceopen" with the proper type (4) Unrecognized type EventHandler
     31FAIL MediaSource interface: mediaSource must inherit property "onsourceended" with the proper type (5) Unrecognized type EventHandler
     32FAIL MediaSource interface: mediaSource must inherit property "onsourceclose" with the proper type (6) Unrecognized type EventHandler
    3433PASS MediaSource interface: mediaSource must inherit property "addSourceBuffer" with the proper type (7)
    3534PASS MediaSource interface: calling addSourceBuffer(DOMString) on mediaSource with too few arguments must throw TypeError
     
    6867PASS SourceBuffer interface: attribute onerror
    6968PASS SourceBuffer interface: attribute onabort
    70 PASS SourceBuffer interface: operation appendBuffer(ArrayBuffer)
    71 PASS SourceBuffer interface: operation appendBuffer(ArrayBufferView)
    72 PASS SourceBuffer interface: operation appendStream(ReadableStream,unsigned long long)
     69PASS SourceBuffer interface: operation appendBuffer(BufferSource)
    7370PASS SourceBuffer interface: operation abort()
    7471PASS SourceBuffer interface: operation remove(double,unrestricted double)
    75 PASS SourceBuffer interface: attribute trackDefaults
    7672PASS SourceBuffer must be primary interface of sourceBuffer
    7773PASS Stringification of sourceBuffer
     
    8581PASS SourceBuffer interface: sourceBuffer must inherit property "appendWindowStart" with the proper type (7)
    8682PASS SourceBuffer interface: sourceBuffer must inherit property "appendWindowEnd" with the proper type (8)
    87 PASS SourceBuffer interface: sourceBuffer must inherit property "onupdatestart" with the proper type (9)
    88 PASS SourceBuffer interface: sourceBuffer must inherit property "onupdate" with the proper type (10)
    89 PASS SourceBuffer interface: sourceBuffer must inherit property "onupdateend" with the proper type (11)
    90 PASS SourceBuffer interface: sourceBuffer must inherit property "onerror" with the proper type (12)
    91 PASS SourceBuffer interface: sourceBuffer must inherit property "onabort" with the proper type (13)
     83FAIL SourceBuffer interface: sourceBuffer must inherit property "onupdatestart" with the proper type (9) Unrecognized type EventHandler
     84FAIL SourceBuffer interface: sourceBuffer must inherit property "onupdate" with the proper type (10) Unrecognized type EventHandler
     85FAIL SourceBuffer interface: sourceBuffer must inherit property "onupdateend" with the proper type (11) Unrecognized type EventHandler
     86FAIL SourceBuffer interface: sourceBuffer must inherit property "onerror" with the proper type (12) Unrecognized type EventHandler
     87FAIL SourceBuffer interface: sourceBuffer must inherit property "onabort" with the proper type (13) Unrecognized type EventHandler
    9288PASS SourceBuffer interface: sourceBuffer must inherit property "appendBuffer" with the proper type (14)
    93 PASS SourceBuffer interface: calling appendBuffer(ArrayBuffer) on sourceBuffer with too few arguments must throw TypeError
    94 PASS SourceBuffer interface: sourceBuffer must inherit property "appendBuffer" with the proper type (15)
    95 PASS SourceBuffer interface: calling appendBuffer(ArrayBufferView) on sourceBuffer with too few arguments must throw TypeError
    96 PASS SourceBuffer interface: sourceBuffer must inherit property "appendStream" with the proper type (16)
    97 PASS SourceBuffer interface: calling appendStream(ReadableStream,unsigned long long) on sourceBuffer with too few arguments must throw TypeError
    98 PASS SourceBuffer interface: sourceBuffer must inherit property "abort" with the proper type (17)
    99 PASS SourceBuffer interface: sourceBuffer must inherit property "remove" with the proper type (18)
     89PASS SourceBuffer interface: calling appendBuffer(BufferSource) on sourceBuffer with too few arguments must throw TypeError
     90PASS SourceBuffer interface: sourceBuffer must inherit property "abort" with the proper type (15)
     91PASS SourceBuffer interface: sourceBuffer must inherit property "remove" with the proper type (16)
    10092PASS SourceBuffer interface: calling remove(double,unrestricted double) on sourceBuffer with too few arguments must throw TypeError
    101 PASS SourceBuffer interface: sourceBuffer must inherit property "trackDefaults" with the proper type (19)
    10293PASS EventTarget interface: sourceBuffer must inherit property "addEventListener" with the proper type (0)
    10394PASS EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on sourceBuffer with too few arguments must throw TypeError
     
    117108PASS Stringification of mediaSource.sourceBuffers
    118109PASS SourceBufferList interface: mediaSource.sourceBuffers must inherit property "length" with the proper type (0)
    119 PASS SourceBufferList interface: mediaSource.sourceBuffers must inherit property "onaddsourcebuffer" with the proper type (1)
    120 PASS SourceBufferList interface: mediaSource.sourceBuffers must inherit property "onremovesourcebuffer" with the proper type (2)
     110FAIL SourceBufferList interface: mediaSource.sourceBuffers must inherit property "onaddsourcebuffer" with the proper type (1) Unrecognized type EventHandler
     111FAIL SourceBufferList interface: mediaSource.sourceBuffers must inherit property "onremovesourcebuffer" with the proper type (2) Unrecognized type EventHandler
    121112PASS EventTarget interface: mediaSource.sourceBuffers must inherit property "addEventListener" with the proper type (0)
    122113PASS EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on mediaSource.sourceBuffers with too few arguments must throw TypeError
     
    125116PASS EventTarget interface: mediaSource.sourceBuffers must inherit property "dispatchEvent" with the proper type (2)
    126117PASS EventTarget interface: calling dispatchEvent(Event) on mediaSource.sourceBuffers with too few arguments must throw TypeError
    127 PASS VideoPlaybackQuality interface: existence and properties of interface object
    128 PASS VideoPlaybackQuality interface object length
    129 PASS VideoPlaybackQuality interface object name
    130 PASS VideoPlaybackQuality interface: existence and properties of interface prototype object
    131 PASS VideoPlaybackQuality interface: existence and properties of interface prototype object's "constructor" property
    132 PASS VideoPlaybackQuality interface: attribute creationTime
    133 PASS VideoPlaybackQuality interface: attribute totalVideoFrames
    134 PASS VideoPlaybackQuality interface: attribute droppedVideoFrames
    135 PASS VideoPlaybackQuality interface: attribute corruptedVideoFrames
    136 PASS VideoPlaybackQuality interface: attribute totalFrameDelay
    137 PASS VideoPlaybackQuality must be primary interface of video.getVideoPlaybackQuality()
    138 PASS Stringification of video.getVideoPlaybackQuality()
    139 PASS VideoPlaybackQuality interface: video.getVideoPlaybackQuality() must inherit property "creationTime" with the proper type (0)
    140 PASS VideoPlaybackQuality interface: video.getVideoPlaybackQuality() must inherit property "totalVideoFrames" with the proper type (1)
    141 PASS VideoPlaybackQuality interface: video.getVideoPlaybackQuality() must inherit property "droppedVideoFrames" with the proper type (2)
    142 PASS VideoPlaybackQuality interface: video.getVideoPlaybackQuality() must inherit property "corruptedVideoFrames" with the proper type (3)
    143 PASS VideoPlaybackQuality interface: video.getVideoPlaybackQuality() must inherit property "totalFrameDelay" with the proper type (4)
    144 PASS TrackDefault interface: existence and properties of interface object
    145 PASS TrackDefault interface object length
    146 PASS TrackDefault interface object name
    147 PASS TrackDefault interface: existence and properties of interface prototype object
    148 PASS TrackDefault interface: existence and properties of interface prototype object's "constructor" property
    149 PASS TrackDefault interface: attribute type
    150 PASS TrackDefault interface: attribute byteStreamTrackID
    151 PASS TrackDefault interface: attribute language
    152 PASS TrackDefault interface: attribute label
    153 PASS TrackDefault interface: operation getKinds()
    154 PASS TrackDefaultList interface: existence and properties of interface object
    155 PASS TrackDefaultList interface object length
    156 PASS TrackDefaultList interface object name
    157 PASS TrackDefaultList interface: existence and properties of interface prototype object
    158 PASS TrackDefaultList interface: existence and properties of interface prototype object's "constructor" property
    159 PASS TrackDefaultList interface: attribute length
    160 PASS TrackDefaultList must be primary interface of sourceBuffer.trackDefaults
    161 PASS Stringification of sourceBuffer.trackDefaults
    162 PASS TrackDefaultList interface: sourceBuffer.trackDefaults must inherit property "length" with the proper type (0)
    163118
  • trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt

    r205893 r206146  
    19991999PASS Object.getOwnPropertyDescriptor(global, 'ShadowRoot').enumerable is false
    20002000PASS Object.getOwnPropertyDescriptor(global, 'ShadowRoot').configurable is true
     2001PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').value is SourceBuffer
     2002PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('get') is false
     2003PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('set') is false
     2004PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').enumerable is false
     2005PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').configurable is true
     2006PASS Object.getOwnPropertyDescriptor(global, 'SourceBufferList').value is SourceBufferList
     2007PASS Object.getOwnPropertyDescriptor(global, 'SourceBufferList').hasOwnProperty('get') is false
     2008PASS Object.getOwnPropertyDescriptor(global, 'SourceBufferList').hasOwnProperty('set') is false
     2009PASS Object.getOwnPropertyDescriptor(global, 'SourceBufferList').enumerable is false
     2010PASS Object.getOwnPropertyDescriptor(global, 'SourceBufferList').configurable is true
    20012011PASS Object.getOwnPropertyDescriptor(global, 'SpeechSynthesisEvent').value is SpeechSynthesisEvent
    20022012PASS Object.getOwnPropertyDescriptor(global, 'SpeechSynthesisEvent').hasOwnProperty('get') is false
  • trunk/Source/WebCore/ChangeLog

    r206145 r206146  
     12016-09-20  Jer Noble  <jer.noble@apple.com>
     2
     3        [media-source] Support MediaSource.setLiveSeekableRanges()
     4        https://bugs.webkit.org/show_bug.cgi?id=162252
     5
     6        Reviewed by Sam Weinig.
     7
     8        Fixes tests: imported/w3c/web-platform-tests/media-source/interfaces.html
     9                     imported/w3c/web-platform-tests/media-source/mediasource-liveseekable.html
     10
     11        Add support for a new part of the Media Source specification, the ability for clients to
     12        specify the seekable ranges for a MediaSource-backed HTMLMediaElement.
     13
     14        Adding the live-seekable methods to MediaSource fixes a large number of the interfaces.html
     15        tests, and the rest are fixed by adding on<event> handlers to MediaSource, SourceBuffer,
     16        and SourceBufferList.
     17
     18        * Modules/mediasource/MediaSource.cpp:
     19        (WebCore::MediaSource::seekable):
     20        (WebCore::MediaSource::setLiveSeekableRange):
     21        (WebCore::MediaSource::clearLiveSeekableRange):
     22        * Modules/mediasource/MediaSource.h:
     23        * Modules/mediasource/MediaSource.idl:
     24        * Modules/mediasource/SourceBuffer.idl:
     25        * Modules/mediasource/SourceBufferList.idl:
     26        * Modules/mediasource/VideoPlaybackQuality.idl:
     27        * html/HTMLMediaElement.cpp:
     28        (WebCore::HTMLMediaElement::seekable):
     29
    1302016-09-20  Per Arne Vollan  <pvollan@apple.com>
    231
  • trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp

    r206127 r206146  
    260260    m_pendingSeekTime = MediaTime::invalidTime();
    261261    monitorSourceBuffers();
     262}
     263
     264Ref<TimeRanges> MediaSource::seekable()
     265{
     266    // 6. HTMLMediaElement Extensions, seekable
     267    // W3C Editor's Draft 16 September 2016
     268    // https://rawgit.com/w3c/media-source/45627646344eea0170dd1cbc5a3d508ca751abb8/media-source-respec.html#htmlmediaelement-extensions
     269
     270    // ↳ If duration equals NaN:
     271    // Return an empty TimeRanges object.
     272    if (m_duration.isInvalid())
     273        return TimeRanges::create();
     274
     275    // ↳ If duration equals positive Infinity:
     276    if (m_duration.isPositiveInfinite()) {
     277        auto buffered = this->buffered();
     278        // If live seekable range is not empty:
     279        if (m_liveSeekable && m_liveSeekable->length()) {
     280            // Let union ranges be the union of live seekable range and the HTMLMediaElement.buffered attribute.
     281            buffered->unionWith(*m_liveSeekable);
     282            // Return a single range with a start time equal to the earliest start time in union ranges
     283            // and an end time equal to the highest end time in union ranges and abort these steps.
     284            buffered->add(buffered->start(0), buffered->maximumBufferedTime());
     285            return TimeRanges::create(*buffered);
     286        }
     287
     288        // If the HTMLMediaElement.buffered attribute returns an empty TimeRanges object, then return
     289        // an empty TimeRanges object and abort these steps.
     290        if (!buffered->length())
     291            return TimeRanges::create();
     292
     293        // Return a single range with a start time of 0 and an end time equal to the highest end time
     294        // reported by the HTMLMediaElement.buffered attribute.
     295        return TimeRanges::create({MediaTime::zeroTime(), buffered->maximumBufferedTime()});
     296    }
     297
     298
     299    // ↳ Otherwise:
     300    // Return a single range with a start time of 0 and an end time equal to duration.
     301    return TimeRanges::create({MediaTime::zeroTime(), m_duration});
     302}
     303
     304void MediaSource::setLiveSeekableRange(double start, double end, ExceptionCode& ec)
     305{
     306    // W3C Editor's Draft 16 September 2016
     307    // https://rawgit.com/w3c/media-source/45627646344eea0170dd1cbc5a3d508ca751abb8/media-source-respec.html#dom-mediasource-setliveseekablerange
     308
     309    // If the readyState attribute is not "open" then throw an InvalidStateError exception and abort these steps.
     310    if (!isOpen()) {
     311        ec = INVALID_STATE_ERR;
     312        return;
     313    }
     314
     315    // If start is negative or greater than end, then throw a TypeError exception and abort these steps.
     316    if (start < 0 || start > end) {
     317        ec = TypeError;
     318        return;
     319    }
     320
     321    // Set live seekable range to be a new normalized TimeRanges object containing a single range
     322    // whose start position is start and end position is end.
     323    m_liveSeekable = std::make_unique<PlatformTimeRanges>(MediaTime::createWithDouble(start), MediaTime::createWithDouble(end));
     324}
     325
     326void MediaSource::clearLiveSeekableRange(ExceptionCode& ec)
     327{
     328    // W3C Editor's Draft 16 September 2016
     329    // https://rawgit.com/w3c/media-source/45627646344eea0170dd1cbc5a3d508ca751abb8/media-source-respec.html#dom-mediasource-clearliveseekablerange
     330
     331    // If the readyState attribute is not "open" then throw an InvalidStateError exception and abort these steps.
     332    if (!isOpen()) {
     333        ec = INVALID_STATE_ERR;
     334        return;
     335    }
     336    m_liveSeekable = nullptr;
    262337}
    263338
  • trunk/Source/WebCore/Modules/mediasource/MediaSource.h

    r206127 r206146  
    8383    bool isSeeking() const { return m_pendingSeekTime.isValid(); }
    8484    void completeSeek();
     85    Ref<TimeRanges> seekable();
     86    void setLiveSeekableRange(double start, double end, ExceptionCode&);
     87    void clearLiveSeekableRange(ExceptionCode&);
     88
    8589
    8690    void setDuration(double, ExceptionCode&);
     
    144148    RefPtr<SourceBufferList> m_activeSourceBuffers;
    145149    mutable std::unique_ptr<PlatformTimeRanges> m_buffered;
     150    std::unique_ptr<PlatformTimeRanges> m_liveSeekable;
    146151    HTMLMediaElement* m_mediaElement;
    147152    MediaTime m_duration;
  • trunk/Source/WebCore/Modules/mediasource/MediaSource.idl

    r205890 r206146  
    5757
    5858    static boolean isTypeSupported (DOMString type);
     59
     60    [RaisesException] void setLiveSeekableRange(double start, double end);
     61    [RaisesException] void clearLiveSeekableRange();
     62
     63    attribute EventHandler onsourceopen;
     64    attribute EventHandler onsourceended;
     65    attribute EventHandler onsourceclose;
    5966};
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl

    r206028 r206146  
    3838    Conditional=MEDIA_SOURCE,
    3939    ExportMacro=WEBCORE_EXPORT,
    40     NoInterfaceObject,
    4140] interface SourceBuffer : EventTarget {
    4241
     
    6665    [RaisesException] void abort();
    6766    [RaisesException] void remove(unrestricted double start, unrestricted double end);
     67
     68    attribute EventHandler onupdatestart;
     69    attribute EventHandler onupdate;
     70    attribute EventHandler onupdateend;
     71    attribute EventHandler onerror;
     72    attribute EventHandler onabort;
    6873};
    6974
  • trunk/Source/WebCore/Modules/mediasource/SourceBufferList.idl

    r196568 r206146  
    3131[
    3232    Conditional=MEDIA_SOURCE,
    33     NoInterfaceObject,
    3433    GenerateIsReachable=Impl,
    3534    CallWith=ScriptExecutionContext,
     
    3736    readonly attribute unsigned long length;
    3837    getter SourceBuffer item(unsigned long index);
     38
     39    attribute EventHandler onaddsourcebuffer;
     40    attribute EventHandler onremovesourcebuffer;
    3941};
    4042
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r206127 r206146  
    48374837Ref<TimeRanges> HTMLMediaElement::seekable() const
    48384838{
     4839#if ENABLE(MEDIA_SOURCE)
     4840    if (m_mediaSource)
     4841        return m_mediaSource->seekable();
     4842#endif
     4843
    48394844    if (m_player)
    48404845        return TimeRanges::create(*m_player->seekable());
Note: See TracChangeset for help on using the changeset viewer.