Skip to content

Commit

Permalink
Merge pull request #134 from millicast/bugfix/reconnection-for-non-em…
Browse files Browse the repository at this point in the history
…pty-sourceid

Fix: Use MillicastViewRef.current for project call
  • Loading branch information
aravind-raveendran authored Feb 20, 2024
2 parents 62cc1ea + a10f200 commit 23df86f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/screens/multiview/MultiView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export const MultiView = ({ navigation }) => {
const mediaStream = new MediaStream();
const transceiver = await millicastViewRef.current.addRemoteTrack('video', [mediaStream]);
const mediaId = transceiver.mid;
await millicastView.project(sourceId, [
await millicastViewRef.current.project(sourceId, [
{
media: 'video',
mediaId,
Expand Down Expand Up @@ -307,7 +307,13 @@ export const MultiView = ({ navigation }) => {

useEffect(() => {
if (netInfo.isConnected === false) {
resetState();
dispatch({ type: 'viewer/setStreams', payload: [] });
dispatch({
type: 'viewer/setSelectedSource',
payload: { url: null, mid: null },
});
dispatch({ type: 'viewer/setSourceIds', payload: [] });

// Set error when there is no network connection
dispatch({ type: 'viewer/setError', payload: 'No internet connection' });
}
Expand Down

0 comments on commit 23df86f

Please sign in to comment.