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(newUint8Array(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:
interfaceSourceBufferextendsEventTarget{
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:
interfaceSourceBufferextendsEventTarget{
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;}
According to the MediaSource Candidate Recommendation Spec, there are two
SourceBuffer.appendBuffer()method overloads.MSDN only mentions the
ArrayBufferoverload, even though this is later contradicted in the example code, further down on the same page:(
Uint8Arrayindeed inherits fromArrayBufferView, notArrayBuffer).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.tschange request, as supported by the spec, MSDN example code and Chrome 36:Existing:
Suggested: