Asynchronously processes and updates video streams by filtering out the admin's video stream.
The options for getting videos.
The list of participants.
The list of all video streams.
The list of old video streams.
The ID of the admin's video stream.
Function to update the state variable for all video streams.
Function to update the state variable for old video streams.
A promise that resolves when the video streams have been processed and updated.
If an error occurs during the process of updating video streams.
const options = { participants: participantList, allVideoStreams: currentVideoStreams, oldAllStreams: previousVideoStreams, updateAllVideoStreams: (streams) => { console.log('Updated all video streams:', streams); }, updateOldAllStreams: (streams) => { console.log('Updated old video streams:', streams); },};const getVideosService = new GetVideos();await getVideosService.getVideos(options);console.log('Video streams processed successfully.'); Copy
const options = { participants: participantList, allVideoStreams: currentVideoStreams, oldAllStreams: previousVideoStreams, updateAllVideoStreams: (streams) => { console.log('Updated all video streams:', streams); }, updateOldAllStreams: (streams) => { console.log('Updated old video streams:', streams); },};const getVideosService = new GetVideos();await getVideosService.getVideos(options);console.log('Video streams processed successfully.');
Asynchronously processes and updates video streams by filtering out the admin's video stream.
Param: options
The options for getting videos.
Param: options.participants
The list of participants.
Param: options.allVideoStreams
The list of all video streams.
Param: options.oldAllStreams
The list of old video streams.
Param: options.adminVidID
The ID of the admin's video stream.
Param: options.updateAllVideoStreams
Function to update the state variable for all video streams.
Param: options.updateOldAllStreams
Function to update the state variable for old video streams.
Returns
A promise that resolves when the video streams have been processed and updated.
Throws
If an error occurs during the process of updating video streams.
Example