Skip to content

Commit 642fb16

Browse files
Use Iterator properly in currentlyPlayingAssets
1 parent 595a147 commit 642fb16

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/playlist.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,13 @@ export class Playlist {
5151
}
5252

5353
get currentlyPlayingAssets() {
54-
return this.trackMap
55-
.keys()
56-
.map((t) => t.currentAsset)
57-
.filter((a) => !!a);
54+
const assets = [];
55+
for (const t of this.trackMap.keys()) {
56+
if (t.currentAsset) {
57+
assets.push(t.currentAsset);
58+
}
59+
}
60+
return assets;
5861
}
5962

6063
updateParams({ listenerPoint, listenTagIds, ...params }) {

0 commit comments

Comments
 (0)