From eea1cfb40ec7142fafd75acfadc560b009947d77 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 24 Mar 2020 14:14:04 -0700 Subject: [PATCH] Shim AudioTrack type removed in TS3.9 (#43362) AudioTrack isn't standard (only supported in IE and Safari), and is removed from the DOM lib in TS 3.9: microsoft/TSJS-lib-generator#802 This PR puts a copy of the type called VideojsAudioTrack in instead. That should be compatible with the DOM version for older Typescripts, since it's copied directly from the old source. --- types/video.js/index.d.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/types/video.js/index.d.ts b/types/video.js/index.d.ts index e6279079af..b7a4dcf81c 100644 --- a/types/video.js/index.d.ts +++ b/types/video.js/index.d.ts @@ -608,8 +608,17 @@ declare namespace videojs { new(player: Player, options?: AudioTrackMenuItemOptions): AudioTrackMenuItem; }; + interface VideojsAudioTrack { + enabled: boolean; + readonly id: string; + kind: string; + readonly label: string; + language: string; + readonly sourceBuffer: SourceBuffer | null; + } + interface AudioTrackMenuItemOptions extends MenuItemOptions { - track?: AudioTrack; + track?: VideojsAudioTrack; } /**