Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCSA-155 Open a session to backend in preview screen in order to star… #273

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/app/components/ConferencePreConfigContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,10 @@ class ConferencePreConfigContainer extends Component {
}

async init() {
if (!VoxeetSDK.session.participant) {
await VoxeetSDK.session.open(this.props.userInfo);
}

let resultAudio = [];
let resultVideo = [];
let resultAudioOutput = [];
Expand Down Expand Up @@ -1678,6 +1682,7 @@ ConferencePreConfigContainer.propTypes = {
virtualBackgroundMode: PropTypes.string,
videoDenoise: PropTypes.bool,
virtualBackgroundModeSupported: PropTypes.bool,
userInfo: PropTypes.object,
};

export default ConferencePreConfigContainer;
55 changes: 31 additions & 24 deletions src/app/components/ConferenceRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,30 @@ class ConferenceRoom extends Component {
this.handleJoin = this.handleJoin.bind(this);
this.initializeControlsStore();
this.startConferenceWithParams = this.startConferenceWithParams.bind(this);

// Initialize SDK
const {
chatOptions,
consumerKey,
consumerSecret,
oauthToken,
refreshTokenCallback,
} = this.props;
if (oauthToken != null) {
this.initialized = this.props.dispatch(
ConferenceActions.initializeWithToken(
oauthToken,
refreshTokenCallback,
{ chatOptions }
)
);
} else {
this.initialized = this.props.dispatch(
ConferenceActions.initialize(consumerKey, consumerSecret, {
chatOptions,
})
);
}
}

replayConference(conferenceId) {
Expand Down Expand Up @@ -85,8 +109,6 @@ class ConferenceRoom extends Component {
// constraints,
displayModes,
displayActions,
consumerKey,
consumerSecret,
userInfo,
pstnNumbers,
autoJoin,
Expand All @@ -98,12 +120,10 @@ class ConferenceRoom extends Component {
handleOnLeave,
conferenceReplayId,
isAdmin,
oauthToken,
disableSounds,
dvwc,
simulcast,
invitedUsers,
refreshTokenCallback,
isListener,
chatOptions,
spatialAudio,
Expand Down Expand Up @@ -158,23 +178,6 @@ class ConferenceRoom extends Component {
);
this.videoDenoise = preConfigPayload.videoDenoise;
}
let initialized;
let pinCodeTmp = pinCode;
if (oauthToken != null) {
initialized = this.props.dispatch(
ConferenceActions.initializeWithToken(
oauthToken,
refreshTokenCallback,
{ chatOptions }
)
);
} else {
initialized = this.props.dispatch(
ConferenceActions.initialize(consumerKey, consumerSecret, {
chatOptions,
})
);
}

if (handleOnConnect != null) {
this.props.dispatch(ParticipantActions.handleOnConnect(handleOnConnect));
Expand All @@ -184,6 +187,7 @@ class ConferenceRoom extends Component {
setPstnNumbers(pstnNumbers);
}

let pinCodeTmp = pinCode;
if (pinCodeTmp != null) {
if (pinCodeTmp.length !== 8 || !/^\d+$/.test(pinCodeTmp)) {
pinCodeTmp = "";
Expand Down Expand Up @@ -217,7 +221,7 @@ class ConferenceRoom extends Component {
}

if (conferenceReplayId != null) {
initialized.then(() => {
this.initialized.then(() => {
this.props.dispatch(
ConferenceActions.subscribeConference(conferenceAlias)
);
Expand Down Expand Up @@ -271,7 +275,7 @@ class ConferenceRoom extends Component {
ControlsActions.setSimulcast(simulcast);

if (isDemo) {
initialized.then(() =>
this.initialized.then(() =>
this.props.dispatch(
ConferenceActions.joinDemo(userInfo, spatialAudio)
)
Expand Down Expand Up @@ -301,7 +305,7 @@ class ConferenceRoom extends Component {
);
} */ else if (autoJoin && conferenceReplayId == null) {
// Autojoin when entering in fullscreen mode
initialized.then(() => {
this.initialized.then(() => {
this.props.dispatch(
ConferenceActions.join(
conferenceAlias,
Expand Down Expand Up @@ -732,6 +736,9 @@ class ConferenceRoom extends Component {
virtualBackgroundModeSupported={
this.props.virtualBackgroundModeSupported
}
userInfo={
this.props.userInfo
}
/>
);
} else if (isJoined || !isWidget || conferenceReplayId != null) {
Expand Down
Loading