MediaStreamAPI: Difference between revisions

Line 61: Line 61:


  interface HTMLMediaElement {
  interface HTMLMediaElement {
  // Returns the stream of "what the element is playing" ---
  // whatever the element is currently playing, after its
  // volume and playbackrate are taken into account.
  // While the element is not playing (e.g. because it's paused,
  // seeking, or buffering), the stream is blocked. When the element
  // is in the ended state, the stream is in the ended state.
  // When something else causes this stream to be blocked,
  // we block the output of the media element.
   readonly attribute Stream stream;
   readonly attribute Stream stream;
   
   
Line 74: Line 66:
   Stream captureStream();
   Stream captureStream();
   
   
  // When set, do not produce direct audio output. Audio output
  // is still sent to 'stream'.
   // This attribute is NOT reflected into the DOM. It's initially false.
   // This attribute is NOT reflected into the DOM. It's initially false.
   attribute boolean captureAudio;
   attribute boolean captureAudio;
   
   
  // Can be set to a Stream. Blocked streams play silence and show the last video frame.
   attribute any src;
   attribute any src;
  };
  };
'stream' returns the stream of "what the element is playing" --- whatever the element is currently playing, after its volume and playbackrate are taken into account. While the element is not playing (e.g. because it's paused, seeking, or buffering), the stream is blocked. When the element is in the ended state, the stream is in the ended state. When something else causes this stream to be blocked, we block the output of the media element.
When 'captureAudio' is set, the element does not produce direct audio output. Audio output is still sent to 'stream'.
'src' can be set to a Stream. Blocked streams play silence and show the last video frame.


==== Stream extensions  ====
==== Stream extensions  ====
1,295

edits