Skip to content

Commit 6a5fbd0

Browse files
Use simpler access for currently playing assets
1 parent dec05f5 commit 6a5fbd0

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

src/playlist.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ export class Playlist {
5252

5353
get currentlyPlayingAssets() {
5454
const assets = [];
55-
for (const t of this.trackMap.keys()) {
56-
if (t.currentAsset) {
57-
assets.push(t.currentAsset);
55+
for (const a of this.trackMap.values()) {
56+
if (a) {
57+
assets.push(a);
5858
}
5959
}
6060
return assets;

src/roundware.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,7 @@ export class Roundware {
160160

161161
get currentlyPlayingAssets() {
162162
if (this._mixer && this._mixer.playlist) {
163-
const assets = [];
164-
const tracks = Object.values(this._mixer.playlist.trackIdMap);
165-
for (const t of tracks) {
166-
assets.push(t.currentAsset);
167-
}
168-
return assets;
163+
return this._mixer.playlist.currentlyPlayingAssets;
169164
} else {
170165
return [];
171166
}

0 commit comments

Comments
 (0)