Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(SUP-39117): handle when audio tracks are returned with video tracks #209

Merged
merged 2 commits into from
Sep 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/hls-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,8 @@ export default class HlsAdapter extends BaseMediaSourceAdapter {
*/
_parseVideoTracks(hlsVideoTracks: Array<Object>): Array<VideoTrack> {
let videoTracks = [];
let audioTracks = [];
MosheMaorKaltura marked this conversation as resolved.
Show resolved Hide resolved

for (let i = 0; i < hlsVideoTracks.length; i++) {
// Create video tracks
let settings = {
Expand All @@ -681,7 +683,14 @@ export default class HlsAdapter extends BaseMediaSourceAdapter {
language: '',
index: i
};
videoTracks.push(new VideoTrack(settings));
if (hlsVideoTracks[i].height || hlsVideoTracks[i].width) {
videoTracks.push(new VideoTrack(settings));
} else {
audioTracks.push(new VideoTrack(settings));
}
}
if (!videoTracks.length) {
return audioTracks;
}
return videoTracks;
}
Expand Down