Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

SourceBuffer.appendBuffer() is missing overload for ArrayBufferView param in lib.d.ts #314

Copy link
Copy link
Closed
@philipbulley

Description

@philipbulley
Issue body actions

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueRevisitAn issue worth coming back toAn issue worth coming back to

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.