diff --git a/src/app/actions/ConferenceActions.js b/src/app/actions/ConferenceActions.js index d619581..1eb0cc6 100644 --- a/src/app/actions/ConferenceActions.js +++ b/src/app/actions/ConferenceActions.js @@ -544,6 +544,16 @@ export class Actions { videoProcessor: videoProcessorOptions, }) .then((res) => { + let participant = VoxeetSDK.session.participant; + if (VoxeetSDK.conference.current.params.spatialAudioStyle === "shared") { + if (participant.type === "user") { + VoxeetSDK.conference.setSpatialPosition(participant, { + x: 0, + y: 0, + z: 0, + }); + } + } dispatch( ParticipantActions.saveCurrentUser( userInfo.name, @@ -671,6 +681,16 @@ export class Actions { videoProcessor: videoProcessorOptions, }) .then((res) => { + let participant = VoxeetSDK.session.participant; + if (VoxeetSDK.conference.current.params.spatialAudioStyle === "shared") { + if (participant.type === "user") { + VoxeetSDK.conference.setSpatialPosition(participant, { + x: 0, + y: 0, + z: 0, + }); + } + } dispatch( ParticipantActions.saveCurrentUser( userInfo.name, diff --git a/src/app/components/attendees/modes/MeasuredTile.js b/src/app/components/attendees/modes/MeasuredTile.js index e975d1d..d9531ab 100644 --- a/src/app/components/attendees/modes/MeasuredTile.js +++ b/src/app/components/attendees/modes/MeasuredTile.js @@ -44,6 +44,8 @@ export default function MeasuredTile(props) { ); const onBoundsUpdate = (size) => { + if(VoxeetSDK.conference.current.params.spatialAudioStyle === "shared") + return const currentBounds = size.bounds; if (currentBounds) { const participant = VoxeetSDK.conference.current.participants.get( diff --git a/src/app/libs/position.js b/src/app/libs/position.js index 693886a..762b45d 100644 --- a/src/app/libs/position.js +++ b/src/app/libs/position.js @@ -328,19 +328,22 @@ const generatePositionLayout = ( }; const refreshPositionLayout = () => { - const layout = generatePositionLayout(participantsConnected.length); - - for (var i = 0; i < participantsConnected.length; i++) { - if ( - !excludedParticipants.includes(participantsConnected[i].participant_id) - ) { - participantsConnected[i].id = participantsConnected[i].participant_id; - VoxeetSDK.conference.setSpatialPosition( - participantsConnected[i], - layout[i] - ); - participantsConnected[i].x = layout[i].x; - participantsConnected[i].y = layout[i].y; + if (VoxeetSDK.conference.current.params.spatialAudioStyle === "shared") + return; + else { + const layout = generatePositionLayout(participantsConnected.length); + for (var i = 0; i < participantsConnected.length; i++) { + if ( + !excludedParticipants.includes(participantsConnected[i].participant_id) + ) { + participantsConnected[i].id = participantsConnected[i].participant_id; + VoxeetSDK.conference.setSpatialPosition( + participantsConnected[i], + layout[i] + ); + participantsConnected[i].x = layout[i].x; + participantsConnected[i].y = layout[i].y; + } } } }; @@ -361,6 +364,7 @@ export const updateParticipantPositions = (participants) => { export const updateSpatialScene = ( currentBounds = { width: 1, height: 1, left: 0, top: 0 } ) => { + if(VoxeetSDK.conference.current.params.spatialAudioStyle === "shared") return; if (currentBounds) { // Set the scale so the pixel size of the component maps to the audio scene size const right = { x: 1, y: 0, z: 0 };