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 [Pref="media.mediasource.enabled",
20 interface SourceBuffer : EventTarget {
22 attribute SourceBufferAppendMode mode;
23 readonly attribute boolean updating;
25 readonly attribute TimeRanges buffered;
27 attribute double timestampOffset;
28 //readonly attribute AudioTrackList audioTracks;
29 //readonly attribute VideoTrackList videoTracks;
30 //readonly attribute TextTrackList textTracks;
32 attribute double appendWindowStart;
34 attribute unrestricted double appendWindowEnd;
35 attribute EventHandler onupdatestart;
36 attribute EventHandler onupdate;
37 attribute EventHandler onupdateend;
38 attribute EventHandler onerror;
39 attribute EventHandler onabort;
41 undefined appendBuffer(ArrayBuffer data);
43 undefined appendBuffer(ArrayBufferView data);
45 //undefined appendStream(Stream stream, [EnforceRange] optional unsigned long long maxSize);
49 undefined remove(double start, unrestricted double end);
52 // Mozilla extensions for experimental features
53 partial interface SourceBuffer {
54 // Experimental function as proposed in:
55 // https://github.com/w3c/media-source/issues/100 for promise proposal.
56 [NewObject, Pref="media.mediasource.experimental.enabled"]
57 Promise<undefined> appendBufferAsync(ArrayBuffer data);
58 [NewObject, Pref="media.mediasource.experimental.enabled"]
59 Promise<undefined> appendBufferAsync(ArrayBufferView data);
60 [NewObject, Pref="media.mediasource.experimental.enabled"]
61 Promise<undefined> removeAsync(double start, unrestricted double end);
63 // Experimental function as proposed in:
64 // https://github.com/w3c/media-source/issues/155
66 undefined changeType(DOMString type);