fix(utils): handle missing media.querySelectorAll for HLS (#986)

This commit is contained in:
Sam Potts
2026-03-18 08:57:29 +11:00
committed by GitHub
parent c5ad81cf26
commit 7bacb1b2ae
+1 -1
View File
@@ -1,6 +1,6 @@
/** Find the `<track>` element that owns the given `TextTrack`. */
export function findTrackElement(media: HTMLMediaElement, track: TextTrack): HTMLTrackElement | null {
for (const el of media.querySelectorAll('track')) {
for (const el of media.querySelectorAll?.('track') ?? []) {
if (el.track === track) return el;
}
return null;