SourceBuffer.webidl (2401B)
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/. 5 * 6 * The origin of this IDL file is 7 * http://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html 8 * 9 * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C 10 * liability, trademark and document use rules apply. 11 */ 12 13 enum SourceBufferAppendMode { 14 "segments", 15 "sequence" 16 }; 17 18 [Pref="media.mediasource.enabled", 19 Exposed=Window] 20 interface SourceBuffer : EventTarget { 21 [SetterThrows] 22 attribute SourceBufferAppendMode mode; 23 readonly attribute boolean updating; 24 [Throws] 25 readonly attribute TimeRanges buffered; 26 [SetterThrows] 27 attribute double timestampOffset; 28 //readonly attribute AudioTrackList audioTracks; 29 //readonly attribute VideoTrackList videoTracks; 30 //readonly attribute TextTrackList textTracks; 31 [SetterThrows] 32 attribute double appendWindowStart; 33 [SetterThrows] 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; 40 [Throws] 41 undefined appendBuffer(ArrayBuffer data); 42 [Throws] 43 undefined appendBuffer(ArrayBufferView data); 44 //[Throws] 45 //undefined appendStream(Stream stream, [EnforceRange] optional unsigned long long maxSize); 46 [Throws] 47 undefined abort(); 48 [Throws] 49 undefined remove(double start, unrestricted double end); 50 }; 51 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); 62 63 // Experimental function as proposed in: 64 // https://github.com/w3c/media-source/issues/155 65 [Throws] 66 undefined changeType(DOMString type); 67 };