Closed
Description
According to the MediaSource Candidate Recommendation Spec, there are two SourceBuffer.appendBuffer()
method overloads.
MSDN only mentions the ArrayBuffer
overload, even though this is later contradicted in the example code, further down on the same page:
videoSource.appendBuffer(new Uint8Array(xhr.response));
(Uint8Array
indeed inherits from ArrayBufferView
, not ArrayBuffer
).
My tests show that Chrome 36 currently only works with ArrayBufferView
(as per the MSDN example code).
Anyway, long story short:
Here is the lib.d.ts
change request, as supported by the spec, MSDN example code and Chrome 36:
Existing:
interface SourceBuffer extends EventTarget {
updating: boolean;
appendWindowStart: number;
appendWindowEnd: number;
buffered: TimeRanges;
timestampOffset: number;
audioTracks: AudioTrackList;
appendBuffer(data: ArrayBuffer): void;
remove(start: number, end: number): void;
abort(): void;
appendStream(stream: MSStream, maxSize?: number): void;
}
Suggested:
interface SourceBuffer extends EventTarget {
updating: boolean;
appendWindowStart: number;
appendWindowEnd: number;
buffered: TimeRanges;
timestampOffset: number;
audioTracks: AudioTrackList;
appendBuffer(data: ArrayBuffer): void;
appendBuffer(data: ArrayBufferView): void;
remove(start: number, end: number): void;
abort(): void;
appendStream(stream: MSStream, maxSize?: number): void;
}