Skip to content

Commit

Permalink
fix(SUP-38407): [GaTech] [Multistream - V7 Player] Child entries not …
Browse files Browse the repository at this point in the history
…loading high quality flavor assets (#155)

Issue:
Quality is not changed in childe entries when it is changed in the parent entry.

Fix:
Add listener to videotrackchange and change the quality manually to all the other entries.

part of - kaltura/playkit-js#793, kaltura/kaltura-player-js#851

solves SUP-38407
  • Loading branch information
Tzipi-kaltura authored Sep 15, 2024
1 parent cd2e28d commit 124b0d7
Showing 1 changed file with 17 additions and 0 deletions.
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) {
//@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

0 comments on commit 124b0d7

Please sign in to comment.