Skip to content

Commit

Permalink
Merge pull request #146 from millicast/bugfix/audio-not-playing-after…
Browse files Browse the repository at this point in the history
…-network-recovery

Reset current audio source object when network error occurs
  • Loading branch information
aravind-raveendran authored Jun 5, 2024
2 parents 5b2c2d2 + 9d594fb commit 56cc63a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
11 changes: 0 additions & 11 deletions src/screens/multiview/MultiView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ export const MultiView = ({ navigation }) => {
dispatch({ type: 'viewer/setPlaying', payload: false });
dispatch({ type: 'viewer/setIsMediaSet', payload: true });
dispatch({ type: 'viewer/resetRemoteTrackSources' });
dispatch({
type: 'viewer/setSelectedSource',
payload: null,
});
dispatch({ type: 'viewer/setSourceIds', payload: [] });
};

const handleTrack = async (event: RTCTrackEvent) => {
Expand Down Expand Up @@ -364,12 +359,6 @@ export const MultiView = ({ navigation }) => {
useEffect(() => {
if (netInfo.isConnected === false) {
dispatch({ type: 'viewer/resetRemoteTrackSources' });
dispatch({
type: 'viewer/setSelectedSource',
payload: null,
});
dispatch({ type: 'viewer/setSourceIds', payload: [] });

// Set error when there is no network connection
dispatch({ type: 'viewer/setError', payload: 'No internet connection' });
}
Expand Down
8 changes: 3 additions & 5 deletions src/store/reducers/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ const viewerReducer = (state = initialState, action) => {
...state,
accountId: action.payload,
};
case 'viewer/setSourceIds':
return {
...state,
sourceIds: action.payload,
};
case 'viewer/setActiveLayers':
return {
...state,
Expand Down Expand Up @@ -96,6 +91,9 @@ const viewerReducer = (state = initialState, action) => {
return {
...state,
remoteTrackSources: [],
audioRemoteTrackSource: null,
selectedSource: null,
sourceIds: [],
};
case 'viewer/addAudioRemoteTrackSource':
return {
Expand Down

0 comments on commit 56cc63a

Please sign in to comment.