[Webkit-unassigned] [Bug 64731] New: Add MediaSource API to HTMLMediaElement

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 18 10:30:01 PDT 2011


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

           Summary: Add MediaSource API to HTMLMediaElement
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Media Elements
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: acolwell at chromium.org


Adding an experimental API for allowing JavaScript to stream media data to an HTMLMediaElement. This functionality will be hidden behind the ENABLE_MEDIA_SOURCE feature define.

This change adds a 2 methods, 2 attributes, and 1 event to the HTMLMediaElement.

webkitMediaSourceUrl - This attribute is passed to the src attribute when JavaScript wants to use the MediaSource API. An HTMLMediaElement will only accept a media source URL from itself. It will not accept a URL from a different element.

webkitSourceAppend() - This method allows one to stream media data to the HTMLMediaElement. This data is expected to be in a suitable streaming container like WebM or Ogg.

webkitSourceEndOfStream(status) - This method signals that the end of stream has been reached. The status parameter indicates what caused the end of stream.
  EOS_NO_ERROR - The stream ended normally without any error.
  EOS_NETWORK_ERROR - The stream ended because a network error was encountered.
  EOS_DECODE_ERROR - The stream ended because a decoding error was encountered while processing the stream.

webkitSourceState - This attribute is similar to the networkState & readyState attributes. It simply reflects the state of the media source. The source can be closed, open, or ended. 
  SOURCE_CLOSED - Indicates that the media source is closed and media data cannot be sent to it.
  SOURCE_OPEN - Indicates that the media source is open and ready to accept data via webkitSourceAppend().
  SOURCE_ENDED - Indicates that the media source is open, but the end of the stream has been reached. Transition to this state can be triggered by the browser or a call to webkitSourceEndOfStream().

open - This event is fired when the media source is ready to receive data. It is triggered when the browser transitions webkitSourceState from SOURCE_CLOSED to SOURCE_OPEN.

JavaScript handles seeks by attaching to the seeking event and appending data for the new seek point after that event fires. The media source implementation is expected to have flushed all pre-seek media data before the seeking event fires. When seeking fires the currentTime attribute contains the desired seek point so JavaScript can use that to figure out what data to fetch. The media source implementation will use the timestamps on the first data passed in after the seeking event fires to determine the actual point seeked to.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list