From 3c78fd8f4af1d5f222c8094509f5d49dee0efbe4 Mon Sep 17 00:00:00 2001 From: Wesley Luyten Date: Mon, 4 Dec 2023 08:50:59 -0600 Subject: [PATCH] fix: ts error due to duplicate same dependency fixes #836 --- packages/mux-video/package.json | 2 +- packages/playback-core/package.json | 1 - packages/playback-core/src/media-tracks.ts | 4 ++-- yarn.lock | 8 ++++---- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/mux-video/package.json b/packages/mux-video/package.json index 75b24f790..a29b6a944 100644 --- a/packages/mux-video/package.json +++ b/packages/mux-video/package.json @@ -69,7 +69,7 @@ "@mux/playback-core": "0.21.0", "castable-video": "0.5.2", "custom-media-element": "0.2.0", - "media-tracks": ">=0.2.3" + "media-tracks": "0.2.4" }, "devDependencies": { "@mux/test-esm-exports": "0.1.0", diff --git a/packages/playback-core/package.json b/packages/playback-core/package.json index 91e8c8674..3a9184607 100644 --- a/packages/playback-core/package.json +++ b/packages/playback-core/package.json @@ -60,7 +60,6 @@ }, "dependencies": { "hls.js": "^1.4.10", - "media-tracks": "0.2.3", "mux-embed": "^4.27.0" }, "devDependencies": { diff --git a/packages/playback-core/src/media-tracks.ts b/packages/playback-core/src/media-tracks.ts index c750d28b5..881aa7381 100644 --- a/packages/playback-core/src/media-tracks.ts +++ b/packages/playback-core/src/media-tracks.ts @@ -1,5 +1,4 @@ import Hls from './hls'; -import type { VideoRenditionList } from 'media-tracks'; export function setupMediaTracks( customMediaEl: HTMLMediaElement, @@ -80,7 +79,8 @@ export function setupMediaTracks( // 2. if 1 of the renditions is disabled we assume a selection was made // and lock it to the first rendition that is enabled. const switchRendition = (event: Event) => { - const level = (event.target as VideoRenditionList).selectedIndex; + // @ts-ignore + const level = event.target.selectedIndex as number; if (level != hls.nextLevel) { smoothSwitch(level); } diff --git a/yarn.lock b/yarn.lock index d4f2b06c5..6954534eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10677,10 +10677,10 @@ media-chrome@~1.5.3: resolved "https://registry.yarnpkg.com/media-chrome/-/media-chrome-1.5.3.tgz#9ce238d68d055bed39a019e65a5e331a417cb2f9" integrity sha512-XiE29yNa9jyCMdshDLvSgXb0e/RJauMaTXT9kL9dTJmmZXz0RK+Ol/TsE2z4uO68x+rqZauoGEANUbDEyN8NLg== -media-tracks@0.2.3, media-tracks@>=0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/media-tracks/-/media-tracks-0.2.3.tgz#ba9a23c45e1ee1be2acdd580f985d25b9036fff9" - integrity sha512-h5HRl1tIyeV+aF59FAmHmxChmdM/Ewf/twpxZkRme1ny46owD24uTA0BmRuPoO+uzvE0lx9ZIkZj1TbXi2VCng== +media-tracks@0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/media-tracks/-/media-tracks-0.2.4.tgz#aee3bd69bdc8f246b44af5245f7b0a68d4c94540" + integrity sha512-P/TbDCYTFH5gxpQ6r99iabXOwjsFwzKRgK7wiwo64Ii6nHXYhHtwEP7A7ufmEKxkNCoHc4j3Z2hvs+lXL4wPeQ== media-typer@0.3.0: version "0.3.0"