mirror of
https://github.com/zoriya/v10.git
synced 2026-08-12 08:59:02 +00:00
fix(utils): handle missing media.querySelectorAll for HLS (#986)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user