1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * http://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html
9 * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
10 * liability, trademark and document use rules apply.
13 enum SourceBufferAppendMode {
18 [Func="mozilla::dom::MediaSource::Enabled"]
19 interface SourceBuffer : EventTarget {
21 attribute SourceBufferAppendMode mode;
22 readonly attribute boolean updating;
24 readonly attribute TimeRanges buffered;
26 attribute double timestampOffset;
27 //readonly attribute AudioTrackList audioTracks;
28 //readonly attribute VideoTrackList videoTracks;
29 //readonly attribute TextTrackList textTracks;
31 attribute double appendWindowStart;
33 attribute unrestricted double appendWindowEnd;
34 attribute EventHandler onupdatestart;
35 attribute EventHandler onupdate;
36 attribute EventHandler onupdateend;
37 attribute EventHandler onerror;
38 attribute EventHandler onabort;
40 void appendBuffer(ArrayBuffer data);
42 void appendBuffer(ArrayBufferView data);
43 // Experimental function as proposed in:
44 // https://github.com/w3c/media-source/issues/100 for promise proposal.
45 [Throws, Func="mozilla::dom::MediaSource::ExperimentalEnabled"]
46 Promise<void> appendBufferAsync(ArrayBuffer data);
47 [Throws, Func="mozilla::dom::MediaSource::ExperimentalEnabled"]
48 Promise<void> appendBufferAsync(ArrayBufferView data);
50 //void appendStream(Stream stream, [EnforceRange] optional unsigned long long maxSize);
54 void remove(double start, unrestricted double end);
55 // Experimental function as proposed in:
56 // https://github.com/w3c/media-source/issues/100 for promise proposal.
57 [Throws, Func="mozilla::dom::MediaSource::ExperimentalEnabled"]
58 Promise<void> removeAsync(double start, unrestricted double end);
59 // Experimental function as proposed in:
60 // https://github.com/w3c/media-source/issues/155
62 void changeType(DOMString type);