- Introduction
- Join Meeting
- Local User Meeting Controls and Helper Methods
- Mute/Unmute Local Audio
- Mute/Unmute Local Video
- Switch Camera
- Start Preview
- Stop Preview
- Raise Local User Hand
- Lower Local User Raised Hand
- Leave Meeting
- Decline Host's Audio Request
- Decline Host's Video Request
- Switch Local User Role
- Apply Virtual Background
- Toggle Audio-Only Mode
- Send Reaction Type
- Public Getter Methods
- Remote User Meeting Controls and Helper Methods
- Subscribe Remote User Audio
- Unsubscribe Remote User Audio
- Subscribe Remote User Video
- Unsubscribe Remote User Video
- Hard Mute/Unmute User's Audio
- Soft Mute Users Audio
- Lowers All Users Hands
- Change Participant Audio State
- Change Participant Video State
- Remove Participant From Meeting
- Change Participant User Role
- Stop Screenshare of User
- Start Recording
- Stop Recording
- Lock Meeting
- UnLock Meeting
- Start Whiteboard
- Stop Whiteboard
- Update User Co-Host Rights
- Set Audio File Path for User Join Chime Sound
- Set Audio File Path for User Left Chime Sound
- Create Live Stream
- Get Live Stream List
- Update Live Stream
- Start Live Stream
- Edit Live Stream
- Delete Live Stream
- Stop Live Stream
- Observe Meeting Events
- User Failed to join the meeting
- User Joined Meeting Successfully
- Local User Audio Status Update
- Local User Video Status Update
- Local User Hand Raise Status Update
- Remote User Joined Meeting
- Remote User Audio Status Update
- Remote User Video Status Update
- Remote User Hand Raise Status Update
- Remote User Left Meeting
- Host Enable Hard Audio Mute
- Host Disable Hard Audio Mute
- Host Enable Soft Audio Mute
- Host Lowers all Raised Hands
- Meeting Data Refreshed
- Loudest Speaker Detected
- Network Quality Update
- Network Stats Update
- Network Connection State Update
- Local ScreenShare State Change
- Remote ScreenShare State Change
- Recording Started
- Recording Stopped
- Host/Co-Host Requests Participant to change Audio/Video state
- Participant Declines Request to Change Audio/Video State by Host/Co-Host
- Local User moved to Audience
- Local User moved to Participant
- Remote User moved to Audience
- Remote User moved to Participants
- Audio Output Route Change
- Local User Leaves Meeting
- Meeting Locked Event
- Meeting UnLocked Event
- Local Speaker Volume Change Event
- Local Participant Connection State Change Event
- Co-Host Rights Change Event
- Whiteboard Started Event
- Whiteboard Stopped Event
- Waiting Room State Change Event
- Live Stream State Change Event
- Showing Reaction by Local User
- Receive Participant Reactions
- Classes, Structs and Enums
- Screen Share Integration
- Sample App
- Troubleshooting
In this documentation, we'll guide you through the process of integrating methods for incorporating audio, video and joining rooms (meetings) within your application, covering essential functionalities and configurations for seamless communication experiences.
First create JMJoinMeetingData
type object. Following are the properties of this object.
Property Name | Type | Description |
---|---|---|
meetingId | String | Meeting ID of the meeting user is going to join. |
meetingPin | String | Meeting PIN of the meeting user is going to join. |
displayName | String | Display Name with which user is going to join the meeting. |
let joinMeetingData = JMJoinMeetingData(
meetingId: "9680763133",
meetingPin: "1tKzt",
displayName: "John Appleased"
)
Create a JMJoinMeetingConfig
type object. Following are the properties of this object.
Property Name | Type | Description |
---|---|---|
userRole | JMUserRole | Role of the user in the meeting. Possible values are .host , .speaker , .audience . If you are assigning .host value, please pass the token in its argument. |
isInitialAudioOn | Bool | Initial Audio State of the user when user joins the meeting. If meeting is hard muted by a host, initial audio state will be muted and this setting will not take place. |
isInitialVideoOn | Bool | Initial Video State of the user when user joins the meeting. |
let joinMeetingConfig = JMJoinMeetingConfig(
userRole: .host(hostToken: "MD5hQxGAwjW2"),
isInitialAudioOn: true,
isInitialVideoOn: true
)
Create a JMClient
class instance. Use this instance to call all the SDK Methods.
let jioMeetClient = JMClient()
After creating JMJoinMeetingData
and JMJoinMeetingConfig
objects, call joinMeeting
method of JMClient
instance.
Following are the arguments of joinMeeting
method.
Argument Name | Type | Description |
---|---|---|
data | JMJoinMeetingData | Meeting Data which include meeting id, pin and user display name. |
config | JMJoinMeetingConfig | Meeting Configuration which include user role, mic and camera initial states. |
delegate | JMClientDelegate? | A class conforming to JMClientDelegate protocol. |
jioMeetClient.joinMeeting(
data: joinMeetingData,
config: joinMeetingConfig,
delegate: self
)
Below Local Users Methods will be called via SDK JMClient
instance.
Summary
This method mute or unmute local user Audio.
Declaration
func muteLocalAudio(isMute: Bool)
Important
Please not if you are a normal user and host has done hard audio mute, you will not be able to unmute yourself. Please check wether room is hard muted or not before unmuting yourself.
Parameters
Parameter Name | Type | Description |
---|---|---|
isMute | Bool | Mute or Unmute Audio. |
Usage Example
jioMeetClient.muteLocalAudio(isMute: true)
Summary
This method mute or unmute local user Video.
Declaration
func muteLocalVideo(isMute: Bool)
Parameters
Parameter Name | Type | Description |
---|---|---|
isMute | Bool | Mute or Unmute Video. |
Usage Example
jioMeetClient.muteLocalVideo(isMute: false)
Summary
Switches between front and rear cameras.
Declaration
func switchCamera()
Usage Example
jioMeetClient.switchCamera()
Summary
Starts the local video preview before joining a channel.
Declaration
func startPreview()
Usage Example
jioMeetClient.startPreview()
Summary
Stops the local video preview.
Declaration
func stopPreview()
Usage Example
jioMeetClient.stopPreview()
Summary
Raise Local user hand in meeting.
Declaration
func raiseHand()
Usage Example
jioMeetClient.raiseHand()
Summary
Lower Local user raised hand in meeting.
Declaration
func lowerHand()
Usage Example
jioMeetClient.lowerHand()
Summary
This function helps a user leave a meeting and uses a JMUserLeftReason to explain why they left.
Declaration
func leaveMeeting(reason: JMUserLeftReason)
Parameters
Parameter Name | Type | Description |
---|---|---|
reason | JMUserLeftReason | Meeting left reasons such as voluntary leave, network issues, removal by the host, transitioning to an audience role, or a default undefined none state. Options are .leaveMeeting , .networkDropped , .removedFromMeeting(byHost: String) , .becomeAudience , .none |
Usage Example
jioMeetClient.leaveMeeting(reason: JMUserLeftReason)
Summary
This function allows a participant to decline a host's request to turn on their audio during a meeting.
Declaration
func declineHostRequestToTurnOnAudio(host: JMMeetingUser?)
Parameters
Parameter Name | Type | Description |
---|---|---|
host | JMMeetingUser | Host user information. |
Usage Example
jioMeetClient.declineHostRequestToTurnOnAudio(host: JMMeetingUser?)
Summary
This function allows a participant to decline a host's request to turn on their video during a meeting.
Declaration
func declineHostRequestToTurnOnVideo(host: JMMeetingUser?)
Parameters
Parameter Name | Type | Description |
---|---|---|
host | JMMeetingUser | Host user information. |
Usage Example
jioMeetClient.declineHostRequestToTurnOnVideo(host: JMMeetingUser?)
Summary
This allows the local user to switch their role within a meeting.
Declaration
func switchLocalUserRole(newRole: JMUserRole)
Parameters
Parameter Name | Type | Description |
---|---|---|
newRole | JMUserRole | Switch user roles in a meeting. Options are .speaker , .audience . |
Usage Example
jioMeetClient.switchLocalUserRole(newRole: JMUserRole)
Summary
This function allows users to apply a virtual background of a specified type (represented by JMVirtualBackgroundType) during a meeting or video call.
Declaration
func applyVirtualBackground(_ type: JMVirtualBackgroundType)
Parameters
Parameter Name | Type | Description |
---|---|---|
type | JMVirtualBackgroundType | Defines various types of virtual backgrounds. Options are .none , .blur(intensity: JMVirtaulBackgroundBlurIntensity) , .image(path: String) , .color(color: UIColor) |
Usage Example
jioMeetClient.applyVirtualBackground(_ type: JMVirtualBackgroundType)
Summary
This function lets users switch between audio-only and regular modes during a meeting.
Declaration
func setAudioOnlyMode(enabled: Bool)
Parameters
Parameter Name | Type | Description |
---|---|---|
enabled | Bool | When enabled, this feature mutes the video feed and restricts user screen share and whiteboard content. Otherwise it switches to regular mode. The available options are true or false. |
Usage Example
jioMeetClient.setAudioOnlyMode(enabled: true)
Summary
This function enables the current user to send a reaction during a meeting.
Declaration
func sendReactionType(type: String)
Parameters
Parameter Name | Type | Description |
---|---|---|
type | String | Reaction type. |
Usage Example
jioMeetClient.sendReactionType(type: reactionType)
All the methods below are public getter methods.
Summary
This method returns Local user object in a meeting.
Declaration
func getMeetingLocalUser() -> JMMeetingUser
Important
Please call this method only when local user has joined meeting successfully.
Summary
This method returns all remote users objects in a meeting.
Declaration
func getMeetingRemoteUsers() -> [JMMeetingUser]
Important
Please call this method only when local user has joined meeting successfully.
Summary
This method returns all users objects in a meeting.
Declaration
func getMeetingUsers() -> [JMMeetingUser]
Important
Please call this method only when local user has joined meeting successfully.
All the methods below are remote user methods.
Summary
This method subscribe a remote User's audio Stream
Declaration
func subscribeRemoteUserAudio(id: String)
Important
When a remote user joins the meeting, by default you will not be able to hear his audio. You need to subscribe his audio by calling above method.
Parameters
Parameter Name | Type | Description |
---|---|---|
id | String | id of remote user. |
Summary
This method unsubscribe a remote User's audio Stream
Declaration
func unsubscribeRemoteUserAudio(id: String)
Parameters
Parameter Name | Type | Description |
---|---|---|
id | String | id of remote user. |
Summary
This method subscribe a remote User's Video Stream
Declaration
func subscribeRemoteUserVideo(id: String)
Important
When a remote user joins the meeting, by default you will not be able to observe his video stream. You need to subscribe his video stream by calling above method.
Parameters
Parameter Name | Type | Description |
---|---|---|
id | String | id of remote user. |
Summary
This method unsubscribe a remote User's Video Stream
Declaration
func unsubscribeRemoteUserVideo(id: String)
Important
This methos is helpful in scenarios when there are lot of users in meeting but you want to display video tiles of only few users. It will reduce app resource utilisation and network bandwidth also.
Parameters
Parameter Name | Type | Description |
---|---|---|
id | String | id of remote user. |
Summary
This method do hard audio mute of all users in meeting.
Important
This method should be called only by Host or Co-host. Once a room is hard audio muted, only host and co-host will be able to unmute themselves.
Declaration
func hardMuteUnmuteUsersAudio(isMute: Bool)
Parameters
Parameter Name | Type | Description |
---|---|---|
isMute | Bool | Wether hard mute is enabled or not. |
Usage Example
jioMeetClient.hardMuteUnmuteUsersAudio(isMute: true)
Summary
This method do soft audio mute of all users in meeting.
Important
This method should be called only by Host or Co-host. Once a room is soft audio muted, all users audio will be muted. Users can unmute themselves.
Declaration
func softMuteUsersAudio()
Usage Example
jioMeetClient.softMuteUsersAudio()
Summary
This method lowers all raised hands in the meeting.
Important
This method should be called only by Host or Co-host.
Declaration
func lowerAllUsersHands()
Usage Example
jioMeetClient.lowerAllUsersHands()
Summary
This method enables the Host or Co-host to request participants to modify their audio settings.
Important
This method should be called only by Host or Co-host. .
Declaration
func changeUserAudioState(userId: String, isOn: Bool)
Parameters
Parameter Name | Type | Description |
---|---|---|
userId | String | ID of the participant: JMMeetingUser. |
isOn | Bool | request to Mute or Unmute Audio. |
Usage Example
jioMeetClient.changeUserAudioState(userId: jmMeetingUser.id, isOn: true)
Summary
This method requests the video of the participant to modify their camera state.
Important
This method should be called only by Host or Co-host.
Declaration
func changeUserVideoState(userId: String, isOn: Bool)
Parameters
Parameter Name | Type | Description |
---|---|---|
userId | String | ID of the participant: JMMeetingUser. |
isOn | Bool | request to enable or disable Video. |
Usage Example
jioMeetClient.changeUserVideoState(userId: jmMeetingUser.id, isOn: true)
Summary
This method removes the participant from meeting.
Important
This method should be called only by Host or Co-host.
Declaration
func removeUserFromMeeting(user: JMMeetingUser)
Parameters
Parameter Name | Type | Description |
---|---|---|
user | JMMeetingUser | participant: JMMeetingUser. |
Usage Example
jioMeetClient.removeUserFromMeeting(user: jmMeetingUser)
Summary
This method changes the participant user role in the meeting.
Important
This method should be called only by Host or Co-host.
Declaration
func changeUserRole(user: JMMeetingUser, newRole: JMUserRole)
Parameters
Parameter Name | Type | Description |
---|---|---|
user | JMMeetingUser | participant: JMMeetingUser. |
newRole | JMUserRole | Role of the user in the meeting. Possible values are .speaker, .audience. |
Usage Example
jioMeetClient.changeUserRole(user: jmMeetingUser, newRole: .audience)
Summary
This method terminates the participant's screen sharing session.
Important
This method should be called only by Host or Co-host.
Declaration
func stopUserScreenShare(user: JMMeetingUser)
Parameters
Parameter Name | Type | Description |
---|---|---|
user | JMMeetingUser | participant: JMMeetingUser. |
Usage Example
jioMeetClient.stopUserScreenShare(user: jmMeetingUser)
Summary
This method is responsible for starting screen recording. Once recording is completed recordings will be available in portal.
Important
This method should be called only by Host or Co-host.
Declaration
func startRecording()
Usage Example
jioMeetClient.startRecording()
Summary
This method is responsible for stopping screen recording.
Declaration
func stopRecording()
Usage Example
jioMeetClient.stopRecording()
Summary
This method is responsible for locking the current meeting session, once we lock the meeting no new remote participants can join until meeting is un-locked.
Important
This method should be called only by Host or Co-host.
Declaration
func lockMeeting()
Usage Example
jioMeetClient.lockMeeting()
Summary
This method is responsible for unlocking the current meeting session, once un-lock new remote participants can join the meeting.
Important
This method should be called only by Host or Co-host.
Declaration
func unLockMeeting()
Usage Example
jioMeetClient.unLockMeeting()
Summary
This method initializes the whiteboard feature for a meeting session. It can be used to start a whiteboard session either locally or for remote whiteboard rendering as well.
Declaration
func startWhitebboard(remote: Bool, startedBy: String)
Parameters
Parameter Name | Type | Description |
---|---|---|
remote | Bool | Determines local or remote user. Options are true/false. |
startedBy | startedBy | Name of the user. |
Usage Example
jioMeetClient.startWhitebboard(remote: true, startedBy: senderName)
Summary
This method is responsible for ending the whiteboard session within a meeting.
Declaration
func stopWhiteboard()
Usage Example
jioMeetClient.stopWhiteboard()
Summary
This method facilitates the modification of co-host rights for a specific user within a meeting.
Important
This method should be called only by Host or Co-host.
Declaration
func updateUserCoHostRights(user: JMMeetingUser, makeCoHost: Bool)
Parameters
Parameter Name | Type | Description |
---|---|---|
user | JMMeetingUser | Participant user within the meeting. |
makeCoHost | Bool | Update coHost rights. Options are true/false. |
Usage Example
jioMeetClient.updateUserCoHostRights(user: jmMeetingUser, makeCoHost: true)
Summary
This function configures the audio file path for the chime sound, which is provided by the client app, to notify the Host/Co-Host when a user joins the meeting.
Declaration
func setAudioFilePathForUserJoin(filePath: String)
Parameters
Parameter Name | Type | Description |
---|---|---|
filePath | String | The file path to an audio file. |
Usage Example
jioMeetClient.setAudioFilePathForUserJoin(filePath: entryChimeSoundPath)
Summary
This function configures the audio file path for the chime sound, which is provided by the client app, to notify the Host/Co-Host when a user leaves the meeting.
Declaration
func setAudioFilePathForUserLeft(filePath: String)
Parameters
Parameter Name | Type | Description |
---|---|---|
filePath | String | The file path to an audio file. |
Usage Example
jioMeetClient.setAudioFilePathForUserLeft(filePath: exitChimeSoundPath)
Summary
This function facilitates the creation of live streams by taking input parameters such as stream name, platform, URL, and stream key.
Declaration
func createLiveStream(streamName: String, streamPlatform: String, streamingUrl: String, streamKey: String, completion: @escaping (_ isSuccess: Bool, _ errorMessage: String) -> Void)
Parameters
Parameter Name | Type | Description |
---|---|---|
streamName | String | The user-defined title represents the desired name for the live stream. |
streamPlatform | String | Indicates the platform on which the live stream will be hosted. Examples could include platforms like yt(YouTube), fb(facebook), or custom. |
streamingUrl | String | This parameter holds the URL or endpoint where the live stream will be accessible. |
streamKey | String | The stream key is often required for secure and authorized access to the streaming platform. |
completion | Closure | A callback function executed after completing the live stream creation. It returns isSuccess (boolean indicating success) and errorMessage (details if an error occurred). |
Usage Example
jioMeetClient.createLiveStream(streamName: streamName, streamPlatform: streamPlatform, streamingUrl: streamUrl, streamKey: streamKey) { (isSuccess, errorMessage) in }
Summary
This function used to fetch live stream channel list.
Declaration
func getLiveStreamsList(completion: @escaping (_ response: [JMLiveStreamDetails], _ isSuccess: Bool) -> Void)
Parameters
Parameter Name | Type | Description |
---|---|---|
completion | Closure | A closure or callback function that is executed when the live stream creation process is complete. It includes parameters such as isSuccess (a boolean indicating whether the operation was successful) and the array of JMLiveStreamDetails representing details of live streams. |
Usage Example
jioMeetClient.getLiveStreamsList(completion: { [weak self] (liveStreamList, isSuccess) in })
Summary
This function facilitates the update of parameters required to start a live stream.
Declaration
func updateToStartLiveStream(streamChannel: String, serverUrl: String, streamKey: String, streamPageUrl: String, completion: @escaping (_ isSuccess: Bool, _ errorMessage: String) -> Void)
Parameters
Parameter Name | Type | Description |
---|---|---|
streamChannel | String | Represents the channel or platform for the live stream. |
serverUrl | String | Indicates the URL or server address associated with the live stream. |
streamKey | String | Represents the unique key or identifier for the live stream. |
completion | Closure | A callback function executed after completing the live stream update. It returns isSuccess (boolean indicating success) and errorMessage (details if an error occurred). |
Usage Example
jioMeetClient.updateToStartLiveStream(streamChannel: streamPlatform, serverUrl: streamingUrl, streamKey: streamKey, streamPageUrl: streamPageUrl, completion: { [weak self] (isSuccess, errorMessage) in })
Summary
This function is used to start the live streaming.
Declaration
func startLiveStream(streamChannel: String, completion: @escaping (_ isSuccess: Bool, _ errorMessage: String) -> Void)
Parameters
Parameter Name | Type | Description |
---|---|---|
streamChannel | String | Represents the channel or platform for the live stream. |
completion | Closure | A callback function executed after live stream started. It returns isSuccess (boolean indicating success) and errorMessage (details if an error occurred). |
Usage Example
jioMeetClient.startLiveStream(streamChannel: streamPlatForm, completion: { (isSuccess, errorMessage) in })
Summary
This function is used for modifying live stream parameters.
Declaration
func editLiveStream(streamId: String, streamName: String, streamPlatform: String, streamingUrl: String, streamKey: String, completion: @escaping (_ isSuccess: Bool, _ errorMessage: String) -> Void)
Parameters
Parameter Name | Type | Description |
---|---|---|
streamId | String | Represents the unique identifier of the live stream. |
streamName | String | The user-defined title represents the desired name for the live stream. |
streamPlatform | String | Indicates the platform on which the live stream will be hosted. Examples could include platforms like yt(YouTube), fb(facebook), or custom. |
streamingUrl | String | This parameter holds the URL or endpoint where the live stream will be accessible. |
streamKey | String | The stream key is often required for secure and authorized access to the streaming platform. |
completion | Closure | A callback function executed after live stream started. It returns isSuccess (boolean indicating success) and errorMessage (details if an error occurred). |
Usage Example
jioMeetClient.editLiveStream(streamId: streamId, streamName: streamName, streamPlatform: streamPlatform, streamingUrl: streamUrl, streamKey: streamKey, completion: { [weak self] (isSuccess, errorMessage) in })
Summary
This function is used for deleting a live stream based on its unique identifier.
Declaration
func deleteLiveStream(streamId: String, completion: @escaping (_ isSuccess: Bool) -> Void)
Parameters
Parameter Name | Type | Description |
---|---|---|
streamId | String | Represents the unique identifier of the live stream. |
completion | Closure | A callback function executed after live stream started. It returns isSuccess (boolean indicating success). |
Usage Example
jioMeetClient.deleteLiveStream(streamId: streamId, completion: { isSuccess in })
Summary
This function is used to stop the live stream associated with a specified streamChannel.
Declaration
func stopLiveStream(streamChannel: String, completion: @escaping (_ isSuccess: Bool, _ errorMessage: String) -> Void)
Parameters
Parameter Name | Type | Description |
---|---|---|
streamChannel | String | Represents the channel or platform associated with the live stream to be stopped. |
completion | Closure | A callback function executed after live stream started. It returns isSuccess (boolean indicating success) and errorMessage (details if an error occurred). |
Usage Example
jioMeetClient.stopLiveStream(streamChannel: platform, completion: { (isSuccess, errorMessage) in })
The methods of JMClientDelegate
will be triggered by JioMeet SDK to notify updates happening in the meeting like user join/leave meeting, mic/video status updates of local and remote users, etc.
Following are the methods of JMClientDelegate
protocol
Summary
Triggered when Local User Failed to join a meeting due to some error.
Declaration
func jmClient(didLocalUserFailedToJoinMeeting error: JMMeetingJoinError)
Parameters
Parameter Name | Type | Description |
---|---|---|
error | JMMeetingJoinError | Error Occurred when user try to join a meeting. |
Summary
Triggered when Local User Successfully joined a meeting.
Declaration
func jmClient(_ meeting: JMMeeting, didLocalUserJoinedMeeting user: JMMeetingUser)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Meeting Object which User joined. |
user | JMMeetingUser | User information like display name, audio track, video track and other meta data. |
Summary
Triggered when Local User Audio State is changed.
Declaration
func jmClient(_ meeting: JMMeeting, didLocalUserMicStatusUpdated isMuted: Bool)
Discussion
Update your UI and properties either on the basis of isMuted property.
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
isMuted | Bool | Audio Muted or not. |
Summary
Triggered when Local User Video State is changed.
Declaration
func jmClient(_ meeting: JMMeeting, didLocalUserVideoStatusUpdated isMuted: Bool)
Discussion
Update your UI and properties either on the basis of isMuted property or isVideoMuted of user parameter.
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
isMuted | Bool | Video Muted or not. |
Summary
Triggered when Local User Hand Raise State is changed.
Declaration
func jmClient(_ meeting: JMMeeting, didLocalUserHandRaiseStatusUpdated isRaised: Bool)
Discussion
Update your UI and properties either on the basis of isRaised property or isHandRaised of user parameter.
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
isRaised | Bool | Hand Raised or not. |
Summary
Triggered when a remote Users Joined a meeting.
Declaration
func jmClient(_ meeting: JMMeeting, didRemoteUserJoinedMeeting user: JMMeetingUser)
Discussion
By default, remote user’s video and audio will be muted for local user. You need to subscibe his audio and video streams by calling subscribeRemoteUserAudio
and subscribeRemoteUserVideo
methods of JMClient
instance.
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | Remote User Information. |
Summary
Triggered when a remote Users Mic state is updated.
Declaration
func jmClient(_ meeting: JMMeeting, didRemoteUserMicStatusUpdated user: JMMeetingUser, isMuted: Bool)
Discussion
This event, will be triggered when either remote user mute/unmute his audio or when local user subscribe or unsubscribe respective remote user audio stream
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | Remote User Information. |
isMuted | Bool | Audio Muted or not. |
Summary
Triggered when a remote Users Video state is updated.
Declaration
func jmClient(_ meeting: JMMeeting, didRemoteUserVideoStatusUpdated user: JMMeetingUser, isMuted: Bool)
Discussion
This event, will be triggered when either remote user mute/unmute his video or when local user subscribe or unsubscribe respective remote user video stream.
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | Remote User Information. |
isMuted | Bool | Video Muted or not. |
Summary
Triggered when a remote Users Hand Raised State is updated.
Declaration
func jmClient(_ meeting: JMMeeting, didRemoteUserHandRaiseStatusUpdated user: JMMeetingUser, isRaised: Bool)
Discussion
This event, will be triggered when either remote user lowers his hand or a host/co-host lowered all users hand
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | Remote User Information. |
isRaised | Bool | Hand Raised or not. |
Summary
Triggered when a remote Users leaves the meeting.
Declaration
func jmClient(_ meeting: JMMeeting, didRemoteUserLeftMeeting user: JMMeetingUser, reason: JMUserLeftReason)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | Remote User who left meeting. |
reason | JMUserLeftReason | Reason why User Left meeting. Possible values are .leaveMeeting and .networkDropped . |
Summary
Triggered When a Host/Co-Host Enables Hard Audio Mute
Declaration
func jmClient(_ meeting: JMMeeting, didHostEnableHardAudioMute host: JMMeetingUser?)
Discussion
When a room is hard audio muted, all users audio will be muted. Only Host or Co-hosts can unmute themselves. If any user who is not a host or co-host try to unmute himself when hard mute is enabled, Error Delegate method will be triggered. Once hard audio mute is disabled, users can unmute themselves.
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
host | JMMeetingUser | Host user who perform this action. |
Summary
Triggered When a Host/Co-Host disables Hard Audio Mute.
Declaration
func jmClient(_ meeting: JMMeeting, didHostDisableHardAudioMute host: JMMeetingUser?)
Discussion
Once hard audio mute is disabled, users can unmute themselves.
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
host | JMMeetingUser | Host user who perform this action. |
Summary
Triggered When a Host/Co-Host Enable Soft Audio Mute.
Declaration
func jmClient(_ meeting: JMMeeting, didHostEnableSoftAudioMute host: JMMeetingUser?)
Discussion
When a room is soft audio muted, all users audio will be muted. Users can unmute themselves.
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
host | JMMeetingUser | Host user who perform this action. |
Summary
Triggered When a Host/Co-Host lower all raised hands.
Declaration
func jmClient(_ meeting: JMMeeting, didHostLowerAllHands host: JMMeetingUser?)
Discussion
When this event occurs, all users hands will be lowered.
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
host | JMMeetingUser | Host user who perform this action. |
Summary
Triggered Periodically after 25 Seconds or When App switch state from inactive to active state or When your connection is restored if it was disconnected.
Declaration
func jmClient(_ meeting: JMMeeting, didMeetingDataRefreshed reason: JMMeetingDataRefreshReason)
Discussion
Use this to Refresh your current local meeting data and Update UI.
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
reason | JMMeetingDataRefreshReason | Reason for refresh. |
Summary
This event will notify loudest speaker in the meeting.
Declaration
func jmClient(_ meeting: JMMeeting, didLoudestSpeakerUpdated user: JMMeetingUser?)
Discussion
If user object is nil, it means there is no active loudest user.
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | Loudest User object. |
Summary
The SDK triggers this callback once every two seconds to report the network quality of local user in meeting. If local user is not sending or recieving any audio or video stream, then you will get value as .detecting
.
Declaration
func jmClient(_ meeting: JMMeeting, didNetworkQualityUpdated quality: JMNetworkQuality)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
quality | JMNetworkQuality | Network Quality. Possible values are .good , .low , .bad and .detecting . |
Summary
The SDK triggers this callback once every two seconds to report the statistics of the current meeting.
Declaration
func jmClient(_ meeting: JMMeeting, didMeetingNetworkStatsUpdated stats: JMMeetingNetworkStats)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
stats | JMMeetingNetworkStats | Network stats info like uplink/downlink packet loss, latency, etc. |
Summary
This method triggers every second to monitor and manage the participant's connection to the server, network status, and socket service.
Declaration
func jmClient(_ meeting: JMMeeting, didNetworkConnectedStateUpdated isConnected: Bool)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
isConnected | Bool | Updates regarding Network connection status. |
Summary
This method is triggered when the local screen share status changed. Declaration
func jmClient(_ meeting: JMMeeting, didLocalScreenShareStateChanged state: JMScreenShareState)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
state | JMScreenShareState | Defines the possible states of a screen sharing session, possible states are .started(mediaTrack: JMScreenShareTrack) , .stopped |
Summary
This method is triggered when a participant screen share status changed.
Declaration
func jmClient(_ meeting: JMMeeting, didRemoteScreenShareStateChanged state: JMScreenShareState)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
state | JMScreenShareState | Defines the possible states of a screen sharing session, possible states are .started(mediaTrack: JMScreenShareTrack) , .stopped |
Summary
This method is triggered when the user started the recording.
Declaration
func jmClient(_ meeting: JMMeeting, didRecordingStarted user: JMMeetingUser?)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | User who has started the recording. If user is nil recording is automatically start by server. |
Summary
This method is triggered when the user stopped the recording.
Declaration
func jmClient(_ meeting: JMMeeting, didRecordingStopped user: JMMeetingUser?)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | User who has stopped the recording. If user is nil recording is automatically stopped by server. |
Summary
This method is triggered when the Host/Co-Host request the participant user to change their audio or video state.
Declaration
func jmClient(_ meeting: JMMeeting, didHostRequestToChangeAudioVideoState host: JMMeetingUser?, state: AudioVideoState)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
host | JMMeetingUser | Host information. |
state | AudioVideoState | Defines the possible states of a audio and video, possible states are .startAudio , .stopAudio , .startVideo , .stopVideo |
Summary
This method is triggered when the participant user declining a request initiated by a host or co-host to change their audio/video state during a meeting session.
Declaration
func jmClient(_ meeting: JMMeeting, didUserDeclineToChangeAudioVideoState user: JMMeetingUser?, state: AudioVideoState)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | User information. |
state | AudioVideoState | Defines the possible states of a audio and video, possible states are .startAudio , .stopAudio , .startVideo , .stopVideo |
Summary
This method is triggered when the Local user's role is changed to Audience within a meeting session.
Declaration
func jmClient(_ meeting: JMMeeting, didLocalUserMovedToAudience user: JMMeetingUser?)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | User information. |
Summary
This method is triggered when the Local user's role is changed to Participant within a meeting session.
Declaration
func jmClient(_ meeting: JMMeeting, didLocalUserMovedToParticipant user: JMMeetingUser?)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | Local user information. |
Summary
This method is triggered when the remote user's role is changed to Audience within a meeting session.
Declaration
func jmClient(_ meeting: JMMeeting, didUserMovedToAudience user: JMMeetingUser?)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | User information. |
Summary This method is triggered when the remote user's role is changed to Participant within a meeting session.
Declaration
func jmClient(_ meeting: JMMeeting, didUserMovedToParticipants user: JMMeetingUser?)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | User information. |
Summary
The SDK triggers this callback when the local audio route changes. For e.g. when user has connected headphone or bluetooth earphone, this will notify that your audio output will be via respective audio route.
Declaration
func jmClient(_ meeting: JMMeeting, didAudioOutputRouteChanged newRoute: JMAudioRouteType)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
newRoute | JMAudioRouteType | Audio output route. Please check all values. |
Summary
Triggered when Local User leaves a meeting.
Declaration
func jmClient(_ meeting: JMMeeting, didLocalUserLeftMeeting reason: JMUserLeftReason)
Discussion
Once local user left meeting, no more events will be notified by the SDK to your app. Please call below method to release all resources used by SDK.
jioMeetClient.delegate = nil
Summary
It is triggered when a meeting is locked by the host.
Declaration
func jmClient(_ meeting: JMMeeting, didMeetingLocked host: JMMeetingUser?)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
host | JMMeetingUser | Host information. |
Summary
It is triggered when a meeting is unlocked by the host
Declaration
func jmClient(_ meeting: JMMeeting, didMeetingUnLocked host: JMMeetingUser?)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
host | JMMeetingUser | Host information. |
Summary
It is triggered when the local user's speaker volume level changes.
Declaration
func jmClient(_ meeting: JMMeeting, didLocalSpeakerVolumeChanges newLevel: Int, localUserSpeaking: Bool)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
newLevel | Int | speaker volume level. |
localUserSpeaking | Bool | Determines local user starts or stops speaking Options are true/false. |
Summary
It is triggered when the connection state of the local participant changes to a new state.
Declaration
func jmClient(_ meeting: JMMeeting, didLocalParticipantConnectionChangedTo state: JMConnectionState)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
state | JMConnectionState | Defines different states that represent the network connection status, Options are .disconnected , .connecting , .connected , .reconnecting , .failed |
Summary
It is triggered when the co-host rights for a specific user are modified.
Declaration
func jmClient(_ meeting: JMMeeting, didCoHostRightsChanged user: JMMeetingUser, isCoHost: Bool)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | Participant user. |
isCoHost | Bool | Determines whether the is the CoHost, Options are true/false. |
Summary
It is triggered when a whiteboard session is started within a meeting.
Declaration
func jmClient(_ meeting: JMMeeting, didWhiteboardStarted user: JMMeetingUser, isHost: Bool, whiteboardUrl: String)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | Participant user. |
isHost | Bool | Determines whether the user is the Host, Options are true/false. |
whiteboardUrl | String | URL to start the Whiteboard session. |
Summary
It is triggered when a whiteboard session is stopped or when user who is sharing the whiteboard leaves the meeting.
Declaration
func jmClient(_ meeting: JMMeeting, didWhiteboardStopped user: JMMeetingUser, isHost: Bool, whiteboardUrl: String)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | Participant user. |
isHost | Bool | Determines whether the user is the Host, Options are true/false. |
whiteboardUrl | String | URL of the Whiteboard session. |
Summary
It is triggered when the waiting room state change during a meeting.
Declaration
func jmClient(_ meeting: JMMeeting, didWaitingRoomStateChanged state: JMWaitingRoomState)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
state | JMWaitingRoomState | Defines the possible states such as started , admitted , rejected , leave . |
Summary
It is triggered when there is a change in the live stream state during a meeting.
Declaration
func jmClient(_ meeting: JMMeeting, didLiveStreamStateChanged state: LiveStreamState, streaming: Bool)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
state | LiveStreamState | Defines the possible states such as ytLiveStream , fbliveStream , customLiveStream , ytlivestreamerror , fblivestreamerror , customlivestreamerror . |
streaming | Bool | Indicates whether live streaming is currently active(true) or not(false). |
Summary
It is triggered for displaying reactions initiated by the local user(self tile) in a meeting.
Declaration
func jmClient(_ meeting: JMMeeting, showReactionForLocalUser user: JMMeetingUser, reactionsType: String)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | Meeting user. |
reactionsType | String | Indicates type of reaction. |
Summary
It is triggered for displaying reactions initiated by the Participant in a meeting.
Declaration
func jmClient(_ meeting: JMMeeting, didRecieveReaction user: JMMeetingUser, reactionsType: String)
Parameters
Parameter Name | Type | Description |
---|---|---|
meeting | JMMeeting | Current Joined Meeting Object. |
user | JMMeetingUser | Participant user. |
reactionsType | String | Indicates type of reaction. |
Below is lists of all the definitions of Classes, Structs and the enums for iOS.
Description
Meeting Join Data
Declaration
public struct JMJoinMeetingData {
public init(meetingId: String, meetingPin: String, displayName: String)
}
Properties
Property Name | Type | Description |
---|---|---|
meetingId | String | Meeting ID of the meeting user is going to join. |
meetingPin | String | Meeting PIN of the meeting user is going to join. |
displayName | String | Display Name with which user is going to join the meeting. |
Description
User Role in meeting.
Declaration
public enum JMUserRole {
case host(hostToken: String)
case speaker
case audience
}
Values
Value Name | Description |
---|---|
host(hostToken: String) | User role is Host. Please pass token in associated Value. |
speaker | User Role is Speaker. User can send his Audio+Video Streams and also can see Remote Users Streams. |
audience | User Role is Audience. User cannot send his Audio+Video Streams. He can only see Remote Users Streams. |
Description
Meeting Join Configurations like user role, initial audio and video state, etc.
Declaration
public struct JMJoinMeetingConfig {
public init(userRole: JioMeetCoreSDK.JMUserRole, isInitialAudioOn: Bool, isInitialVideoOn: Bool)
}
Properties
Property Name | Type | Description |
---|---|---|
userRole | JMUserRole | Role of the user in the meeting. |
isInitialAudioOn | Bool | Initial Audio State of the user when user joins the meeting. If meeting is hard muted by a host, initial audio state will be muted and this setting will not take place. |
isInitialVideoOn | Bool | Initial Video State of the user when user joins the meeting. |
canShareScreen | Bool | This parameter determines whether a user can share their screen during a meeting. The default value is false. |
canShareWhiteBoard | Bool | This parameter determines whether a user can share their whiteboard during a meeting. The default value is false. |
Description
Error while joining meeting.
Declaration
public enum JMMeetingJoinError {
case invalidConfiguration
case invalidMeetingDetails
case meetingExpired
case failedToRegisterUser
case maxParticipantsLimit
case failedToJoinCall(errorMessage: String)
case other(errorMessage: String)
}
Values
Value Name | Description |
---|---|
invalidConfiguration | SDK got Error in getting configurations. |
invalidMeetingDetails | Providing Meeting ID or Pin is invalid. |
meetingExpired | Meeting has expired. |
failedToRegisterUser | SDK Fails to register User for meeting due to some issue. |
maxParticipantsLimit | Meeting Participant limit has reached. |
failedToJoinCall(errorMessage: String) | User fails to join call with some issue. Please check associated value for error message. |
other(errorMessage: String) | Some Unknown issues occurred while joining meeting. Please check associated value for error message. |
Description
Current Meeting Object
Declaration
public struct JMMeeting {
public let meetingID: String
public let meetingPin: String
public let meetingTitle: String
public let allMediaTracks: [JMMediaTrack]
public let allParticipants: [JMMeetingUser]
public let remoteParticipants: [JMMeetingUser]
public let localParticipant: JMMeetingUser
public let isHardAudioMute: Bool
public let meetingOwnerName: String
public var isRecordingOn: Bool = false
public var isMeetingLocked: Bool = false
public var isWhiteboardShared: Bool = false
}
Properties
Property | Type | Description |
---|---|---|
meetingID | String | Meeting ID. |
meetingPin | String | Meeting Pin. |
meetingTitle | String | Title of the meeting. |
allMediaTracks | String | Media track information related to User or ScreenShare. |
allParticipants | [JMMeetingUser] | All participants in meeting (Local + Remote). |
localParticipant | JMMeetingUser | Local User Object. |
remoteParticipants | [JMMeetingUser] | Remote Users Objects. |
isHardAudioMute | Bool | Is Current Meeting Hard Audio Muted. |
meetingOwnerName | Bool | Host/Co-Host name. |
isRecordingOn | Bool | Indicates whether recording is enabled. |
isMeetingLocked | Bool | Indicates whether Meeting is locked by Host. |
isWhiteboardShared | Bool | Indicates whether Whiteboard is shared. |
Description
Meeting User Object
Declaration
public class JMMeetingUser {
public let id: String
public var userId: String
public var sourceType: JMMediaTrackSourceType = .user
public var audioTrack: JMAudioTrack
public var videoTrack: JMVideoTrack
public var displayName: String
public var isSpeaker: Bool = false
public var isCoHost: Bool = false
public var isHandRaised: Bool = false
public var isSharingScreen: Bool = false
public var isHost: Bool = false
}
Properties
Property | Type | Description |
---|---|---|
id | String | id if the User. |
userId | String | userId of the User. |
sourceType | JMMediaTrackSourceType | Media track of the User or ScreenShare. |
audioTrack | JMAudioTrack | Audio track controls of the User. |
videoTrack | JMVideoTrack | Video track controls of the User. |
displayName | String | Display Name of the User. |
isSpeaker | Bool | Indicates whether the User is a Audeince or Participant. |
isCoHost | Bool | Indicates whether the User is a Co-host. |
isSharingScreen | Bool | Indicates whether the user is currently sharing their screen. |
isHost | Bool | Indicates whether the user is the Host. |
Description
Network quality in meeting
Declaration
public enum JMNetworkQuality : Int {
case good
case bad
case poor
case detecting
}
Values
Value Name | Description |
---|---|
good | Network quality is good and stable. |
bad | Network quality is not good. User will get low resolution video streams of remote users. |
poor | Network quality is very bad. User can unsubscribe all remote video streams and only subscibe remote audio streams until network got restored to good. |
detecting | Network quality is in detecting state. |
You need to create a Broadcast Upload Extension to enable the screen sharing process. To do that,
open your project, go to Xcode -> File -> Target... ->
Select Broadcast Upload Extension and click on Next
Fill the Product name and other info, uncheck Include UI Extension, and click Finish.
Activate the Extension
Xcode automatically creates the Extension folder, which contains the SampleHandler.swift file.
NOTE: Please set deployment target for Broadcast Upload Extension same as of your main app.
Go to your Podfile. Add JioMeetScreenShareSDK_iOS
pod for your newly created broadcast upload extension and run pod install --repo-update --verbose
command to install the SDK.
target 'ScreenShareExtension' do
use_frameworks!
pod 'JioMeetScreenShareSDK_iOS', '~> 2.5'
end
NOTE: ScreenShareExtension
is name of target you fill while creating Broadcast Upload Extension
You need to enable app groups for your main app and screenshare extension. Please follow guide from below link. https://developer.apple.com/documentation/xcode/configuring-app-groups
https://www.appcoda.com/app-group-macos-ios-communication/
Go to your SampleHandler.swift
file. Replace the whole file content with content below.
NOTE: Please change YOUR_APP_GROUP_NAME_IDENTIFIER
with app group you created in above step.
import ReplayKit
import JioMeetScreenShareSDK
class SampleHandler: JMScreenShareHandler {
let appGroupsIdentifier: String = "YOUR_APP_GROUP_NAME_IDENTIFIER"
override func clearScreenShareDataFromUserDefaults() {
let currentUserDefaults = UserDefaults(suiteName: appGroupsIdentifier)
currentUserDefaults?.removeObject(forKey: ScreenShareUserDefaultsKeys.rtcAppIdKey.rawValue)
currentUserDefaults?.removeObject(forKey: ScreenShareUserDefaultsKeys.rtcRoomIdKey.rawValue)
currentUserDefaults?.removeObject(forKey: ScreenShareUserDefaultsKeys.rtcTokenKey.rawValue)
currentUserDefaults?.removeObject(forKey: ScreenShareUserDefaultsKeys.shareUidKey.rawValue)
}
override func didRequestScreenShareStartData() -> NSDictionary {
let currentUserDefaults = UserDefaults(suiteName: appGroupsIdentifier)
let rtcAppId = currentUserDefaults?.value(forKey: ScreenShareUserDefaultsKeys.rtcAppIdKey.rawValue) as? String ?? ""
let rtcRoomId = currentUserDefaults?.value(forKey: ScreenShareUserDefaultsKeys.rtcRoomIdKey.rawValue) as? String ?? ""
let rtcToken = currentUserDefaults?.value(forKey: ScreenShareUserDefaultsKeys.rtcTokenKey.rawValue) as? String ?? ""
let uid = currentUserDefaults?.value(forKey: ScreenShareUserDefaultsKeys.shareUidKey.rawValue) as? String ?? ""
let dataDictionary : NSDictionary = [
ScreenShareStrings.rtcAppId.rawValue: rtcAppId,
ScreenShareStrings.rtcRoomId.rawValue: rtcRoomId,
ScreenShareStrings.rtcToken.rawValue: rtcToken,
ScreenShareStrings.shareUid.rawValue: uid,
]
return dataDictionary
}
override func didRequestScreenShareStopReason() -> String? {
let currentUserDefaults = UserDefaults(suiteName: appGroupsIdentifier)
return currentUserDefaults?.value(forKey: ScreenShareUserDefaultsKeys.screenShareStopReason.rawValue) as? String
}
}
To sync broadcast upload extension and core sdk you need to provide your app group identifier to the JioMeetCoreSDK. Please use setParameters
method of JMClient
instance and pass info in dictionary. Call this method after you create JMClient
instance Please check below code.
let jmClient = JMClient()
jmClient.setParameters(params: ["jm_app_group_name": "YOUR_APP_GROUP_NAME_IDENTIFIER"])
NOTE: Replace YOUR_APP_GROUP_NAME_IDENTIFIER
with your app group name identifier.
From your UI, whenever user want to start/stop screen share execute below code to show native screen share view. Please import ReplayKit
in your file.
import ReplayKit
DispatchQueue .main.async {
let pickerView = RPSystemBroadcastPickerView (frame: .zero)
pickerButton = pickerView.subviews.first( where : { $ 0 is UIButton }) as? UIButton
pickerView.showsMicrophoneButton = false
pickerView.preferredExtension = "YOUR_BROADCAST_EXTENSION_BUNDLE_IDENTIFIER"
pickerButton?.sendActions( for : .touchUpInside)
}
NOTE: Replace YOUR_BROADCAST_EXTENSION_BUNDLE_IDENTIFIER
with your Broadcast Upload Extension bundle identifier.
// If a Remote user is currently sharing their screen, the host can use this method to force stop participant screen share.
jioMeetClient.stopUserScreenShare(user: sharingUser)
Please observe below events related to screen share state changes. These events are of JMClientDelegate
protocol.
// When Local User Screen Share State is Changed
func jmClient (_ meeting: JMMeeting, didLocalScreenShareStateChanged state: JMScreenShareState)
// When Remote User Screen Share State is Changed
func jmClient (_ meeting: JMMeeting, didRemoteScreenShareStateChanged state: JMScreenShareState)
Example Code
func jmClient(_ meeting: JMMeeting, didLocalScreenShareStateChanged state: JMScreenShareState) {
updatePropertiesWithMeetingObject(meeting: meeting)
switch state {
case .started(let mediaTrack):
jioMeetClient?.unsubscribeRemoteUserVideo(id: mediaTrack.videoTrack.sourceId)
jioMeetClient?.unsubscribeRemoteUserAudio(id: mediaTrack.audioTrack.sourceId)
// Implement your logic to handle local screen share started
case .stopped(let reason):
// Implement your logic to handle local screen share stopped
break
default: break
}
}
func jmClient(_ meeting: JMMeeting, didRemoteScreenShareStateChanged state: JMScreenShareState) {
updatePropertiesWithMeetingObject(meeting: meeting)
switch state {
case .started(let mediaTrack):
jioMeetClient?.subscribeRemoteUserVideo(id: mediaTrack.id)
// Implement your logic to handle remote screen share started
case .stopped(let reason):
// Implement your logic to handle remote screen share stopped
break
default: break
}
}
NOTE: mediaTrack object is of JMScreenShareTrack
type which confirms to JMMediaTrack
protocol. It contains Audio Track, Video Track and sharing user id and displayName
NOTE:If you are using Objective-C, please check this guide to import Swift Framework. https://developer.apple.com/documentation/swift/importing-swift-into-objective-c
Visit our Jiomeet Template UI Sample app repo to run the sample app.
Facing any issues while integrating or installing the JioMeet Core SDK please connect with us via real time support present in [email protected] or https://jiomeetpro.jio.com/contact-us