Official iOS SDK of videosdk.live
- VideoSDK enables opportunity to integrate immersive video experiences into your application.
- Real-time comunication SDK is built with blend of webRTC and optimised UDP protocol. Our SDK helps developers to add real-time audio and video calls to any iOS mobile app.
- iOS 11.0+
- Xcode 12.0+
- Swift 5.0+
CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate VideoSDK into your Xcode project using CocoaPods, specify it in your Podfile
:
pod 'VideoSDKRTC'
or
pod 'VideoSDKRTC', :git => 'https://github.com/videosdk-live/videosdk-rtc-ios-sdk.git'
- You will need to set 'Enable Bitcode' to false.
import VideoSDKRTC
VideoSDK.config(token: <server token here>)
- JWT server token needs to be generated from your server.
- If you don't have your server setup yet, follow this on How to setup a local server.
let meeting = VideoSDK.initMeeting(
meetingId: <meetingId>, participantName: <your name>, micEnabled: true, webcamEnabled: true)
- First, you need to generate the meeting id or get it from server to initialize the meeting instance.
- For participantName -> provide your name to be displayed in the meeting.
- Optionally set true/false for mic and webcam settings.
meeting?.addEventListener(self)
- Implement
MeetingEventListener
in your ViewController to get notified on various meeting events.
meeting?.join()
onMeetingJoined()
Called when meeting starts.onMeetingLeft()
Called when meeting ends.onParticipantJoined(_ participant: Participant)
Called when new participant joins.onParticipantLeft(_ participant: Participant)
Called when participant leaves.onRecordingStarted()
Called when meeting recording starts.onRecordingStoppped
Called after meeting recording stops.onLivestreamStarted
Called when livestream starts.onLivestreamStopped
Called after livestream stops.onSpeakerChanged(participantId: String?)
Called when active speaker changes.onMicRequested(participantId: String?, accept: @escaping () -> Void, reject: @escaping () -> Void)
Called when someone requests to enable mic.onWebcamRequested(participantId: String?, accept: @escaping () -> Void, reject: @escaping () -> Void)
Called when someone requests to enable camera.
onStreamEnabled(_ stream: MediaStream, forParticipant participant: Participant)
Called when participant turns on the mic or camera.onStreamDisabled(_ stream: MediaStream, forParticipant participant: Participant)
Called when participant turns off the mic or camera.
- Your app needs to add permissions to use microphone and camera. Add below code your app's info.plist.
<key>NSCameraUsageDescription</key>
<string>Allow camera access to start video.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Allow microphone access to start audio.</string>
See Example for more details.