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-38407): [GaTech] [Multistream - V7 Player] Child entries not loading high quality flavor assets #155

Merged
merged 3 commits into from
Sep 15, 2024
Merged
Changes from all commits
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
17 changes: 17 additions & 0 deletions src/dualscreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ export class DualScreen extends BasePlugin<DualScreenConfig> implements IEngineD
}
}
});
this.eventManager.listen(this.player, EventType.VIDEO_TRACK_CHANGED, event => {
this._changeQuality(event.payload.selectedVideoTrack.label);
});
}

public getDualScreenPlayer = (id: string) => {
Expand Down Expand Up @@ -230,6 +233,20 @@ export class DualScreen extends BasePlugin<DualScreenConfig> implements IEngineD
return thumbs[0] && thumbs[1] ? thumbs : thumbs[0] ?? thumbs[1];
};

private _changeQuality = (label: string) => {
this._dualScreenPlayers.forEach(dualScreenPlayer => {
if (dualScreenPlayer.id !== MAIN_PLAYER_ID && dualScreenPlayer.id !== IMAGE_PLAYER_ID) {
Tzipi-kaltura marked this conversation as resolved.
Show resolved Hide resolved
//@ts-expect-error
const videoTrack = dualScreenPlayer.player.getTracks('video');
const selectedVideoTrack = videoTrack.find((track: any) => track.label === label);
if (selectedVideoTrack) {
//@ts-expect-error
dualScreenPlayer.player.changeQuality(selectedVideoTrack);
}
}
});
};

private _setActiveDualScreenPlayer = (id: string, container: PlayerContainers.primary | PlayerContainers.secondary) => {
if (this.getActiveDualScreenPlayer(container)?.id === id) {
// prevent set player to the same container
Expand Down
Loading