Skip to content

Commit

Permalink
move conditional for handling clones
Browse files Browse the repository at this point in the history
  • Loading branch information
wseymour15 committed Nov 6, 2023
1 parent 5d2f7ce commit 2e484f0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/playlist-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2163,13 +2163,7 @@ export class PlaylistController extends videojs.EventTarget {
return;
}

const pastClones = this.contentSteeringController_.currentPathwayClones;
const nextClones = this.contentSteeringController_.nextPathwayClones;
const hasClones = (pastClones && pastClones.size) || (nextClones && nextClones.size);

if (hasClones) {
this.handlePathwayClones_();
}
this.handlePathwayClones_();

const main = this.main();
const playlists = main.playlists;
Expand Down Expand Up @@ -2236,6 +2230,12 @@ export class PlaylistController extends videojs.EventTarget {
const currentPathwayClones = this.contentSteeringController_.currentPathwayClones;
const nextPathwayClones = this.contentSteeringController_.nextPathwayClones;

const hasClones = (currentPathwayClones && currentPathwayClones.size) || (nextPathwayClones && nextPathwayClones.size);

if (!hasClones) {
return;
}

for (const [id, clone] of currentPathwayClones.entries()) {
const newClone = nextPathwayClones.get(id);

Expand Down

0 comments on commit 2e484f0

Please sign in to comment.