Add sound effect for call joined / left (#2794)
* Add renderer for call joined / left * lint * Add new sounds * Updates sounds in renderer * lint * move import * pad sounds with silence * lint * tidy * Drop autoplay since we now subscribe correctly. * Comitting test files I am going to be going to lunch so will tidy up in a little while. * finish up tests * Add support for multiple channels per sound. * lint
This commit is contained in:
@@ -475,6 +475,19 @@ export class CallViewModel extends ViewModel {
|
||||
),
|
||||
);
|
||||
|
||||
public readonly memberChanges = this.userMedia
|
||||
.pipe(map((mediaItems) => mediaItems.map((m) => m.id)))
|
||||
.pipe(
|
||||
scan<string[], { ids: string[]; joined: string[]; left: string[] }>(
|
||||
(prev, ids) => {
|
||||
const left = prev.ids.filter((id) => !ids.includes(id));
|
||||
const joined = ids.filter((id) => !prev.ids.includes(id));
|
||||
return { ids, joined, left };
|
||||
},
|
||||
{ ids: [], joined: [], left: [] },
|
||||
),
|
||||
);
|
||||
|
||||
private readonly localUserMedia: Observable<LocalUserMediaViewModel> =
|
||||
this.mediaItems.pipe(
|
||||
map((ms) => ms.find((m) => m.vm.local)!.vm as LocalUserMediaViewModel),
|
||||
|
||||
Reference in New Issue
Block a user