The BlueJeans iOS Client Software Development Kit (SDK) enables the embedding of BlueJeans Video and Audio capabilities into iOS apps. BlueJeansSDK
is a single namespace that encapsulates all the APIs related to establishing and managing a BlueJeans Video and Audio connection.
The design of the SDK emphasizes simplicity. Developers can quickly integrate BlueJeans video into their applications.
This framework requires *Swift 5.7.0 or later and Xcode 14.1 or above.
Target deployment requires a minimum of iOS version 14.0.
All dependent frameworks are included as part of the Frameworks folder.
Detailed documentation of SDK functions is available here.
You can experience BlueJeans meetings using the iOS client SDK by following the two steps below:
As a prerequisite to using the BlueJeans iOS Client SDK to join meetings, you need a BlueJeans meeting ID. If you do not have a meeting ID then you can create one using a BlueJeans account:
closedCaptioningService.isClosedCaptioningAvailable
). To enable a feature that is not available on your account, please contact your enterprise admin and get the feature enabled through the BlueJeans support team.Integrate the SDK using the below guidelines and use SDK APIs to join a meeting using the generated meeting ID.
https://github.com/bluejeans/ios-client-sdk
using Swift Package Manager in Xcode.bluejeans-ios-client-sdk
or bluejeans-ios-client-sdk-simulator
in your target depending on whether you want to support physical devices or the simulator. We currently can not support both in one target using SPM, please follow the instructions for manual integration below if you require support for both in one target.Steps:
https://swdl.bluejeans.com/bjnvideosdk/ios/1.8.0/Frameworks.zip
Frameworks
folder to the root folder where the Xcode project(xxxx.xcodeproj file) is located.Frameworks
Frameworks
folder to this section. Make sure the project settings look like the below image after adding it. Note that BJNiOSBroadcastExtension.xcframework
is only needed if you intend to support screen sharing.If you follow the manual integration steps above you will notice that you can not run your app on the iOS Simulator. The SDK does support using the simulator for debugging but there are some extra steps to get it working.
The following frameworks are not built with support for the simulator.
To work around this, follow these steps.
Other dependency managers such as Carthage, or Cocoapods are not currently supported.
Whenever a newer version of SDK is available, you can consume it by replacing the xcframeworks with the newer versions.
BlueJeans iOS Client SDK cannot support bitcode. To integrate this SDK into your application, you will have to disable bitcode for the project.
To disable bitcode:
In iOS, the user must explicitly grant the app permission to access device cameras or microphones for video, or audio capture. Your app must provide an explanation for its use of these capture devices. Failure to do so will result in a crash.
Permissions can be requested using the BlueJeansSDK.permissionService
or otherwise will be requested on joining a meeting. By default, the SDK requires both audio and video permissions to be granted or we can not join the meeting. The minimum permissions can also be changed in the PermissionService
.
See also Apple's developer documentation on audio and video capture permissions.
Open your application's Info.plist
and provide a short explanation for both of these Info.plist
keys:
iOS displays this prompt when asking the user for permission, and thereafter in the Settings app. See Apple documentation for more details.
The work needed to add the BlueJeans functionality into your application code is outlined here. Briefly, you will do these steps:
BJNClientSDK
module, and optionally initialize the SDK by calling the BlueJeansSDK.initalize
method.There! That is the extent of the work you need to do to make your application join a BlueJeans meeting.
import BJNClientSDK
As seen in the architecture diagram above, the BlueJeans iOS Client SDK is made up of "Services". These objects provide a static interface to the state of the SDK as well as methods to operate on it.
You can retain references to these objects for your convenience. We'll start with the MeetingService and VideoDeviceService, which will let us join/leave a meeting and get at the video streams in it.
let meetingService = BlueJeansSDK.meetingService
let videoDeviceService = BlueJeansSDK.videoDeviceService
To connect to a Video/Audio meeting,
meetingService.join(meetingID: "your-meeting-id", passcode: "your-passcode", displayName: "John Doe") { joinResult in
if joinResult == .success {
print("Join meeting: Success")
} else {
print("Join meeting failed with result \(joinResult)")
}
}
To disconnect from the meeting,
meetingService.leave()
BlueJeansSDK uses a system that receives multiple streams of video and audio and the client joins these together to create different layouts. This complexity is handled by the Remote Video Controller. To use this view controller, instantiate it with the code:
let remoteVideoViewController = videoDeviceService.getRemoteVideoController()
and add it to your view using view controller containment. For example:
addChild(remoteVideoViewController)
view.addSubview(remoteVideoViewController.view)
view.sendSubviewToBack(remoteVideoViewController.view)
remoteVideoViewController.didMove(toParent: self)
// Add auto-layout constraints here if desired.
The Self and Content Share views can be added as follows:
videoContainer
) in Storyboard, XIB, or code.videoContainer
view.// Select the camera to use for the self view
videoDeviceService.selectCameraDevice(.front)
let videoView = videoDeviceService.getSelfView() else { return }
videoContainer.addSubview(videoView)
//Set constraints programatically for top, bottom, left and right anchors
videoView.translatesAutoresizingMaskIntoConstraints = false
videoView.leftAnchor.constraint(equalTo: videoContainer.leftAnchor).isActive = true
videoView.rightAnchor.constraint(equalTo: videoContainer.rightAnchor).isActive = true
videoView.topAnchor.constraint(equalTo: videoContainer.topAnchor).isActive = true
videoView.bottomAnchor.constraint(equalTo: videoContainer.bottomAnchor).isActive = true
Similar code can be used with getContentShareView
in place of getSelfView
to add it to your view hierarchy. Note that, as with the RemoteVideoViewController, the SDK does not retain a reference to these views.
Note that the aspect ratio of the self-view will change as the device is rotated, or as the resolution changes. Possible aspect ratios are currently 3x4, 4x3, 9x16, 16x9. The video view will maintain the correct aspect ratio to fit, but you may wish to change the size of the container or make other UI adjustments when this changes.
To handle these changes (and many other properties), the SDK provides observable properties that allow you to react whenever they change. In this case, you need to observe the VideoDeviceService.selfViewSize property as follows:
Swift:
videoDeviceService.selfViewSize.onChange {
print("Self view size changed to ", videoDeviceService.selfViewSize.value)
// Update self view container size
}
Content Share (Screen Share) from another device can come in many different sizes and aspect ratios. You should observe the contentShareSize
property and make changes appropriately.
The iOS Client SDK will record logs. If you have experienced an issue you can upload these logs, with a comment and email for us to diagnose the issue.
let loggingService = BlueJeansSDK.loggingService // This will instantiate the logger, do this early in the lifecycle of your application.
loggingService.uploadLogs(comments: "Issue with the SDK", username: "[email protected]") { uploadResult in
print("Log Upload Finished")
}
BlueJeansSDK
uses CocoaLumberjack
and will respect log levels set at the app level.
The SDK is made up of several services. These fall into two main categories, in-meeting, and out-of-meeting. While they can be accessed at any time, in-meeting services will return nil or default values when a meeting is not active. In-meeting services are all accessed from the MeetingService.
Here we will cover each service at a high level, for more detail check the detailed docs here.
This service takes care of all meeting-related APIs. It also provides access to the in-meeting services - ContentShareService, PublicChatService, and PrivateChatService.
The meeting service provides methods to join and leave meetings, change video layout, mute local audio/video. Observable properties include meeting state, video layout, local mute, a list of active participants, and recording status.
Represents how remote participant's videos are composed:
VideoStreamService
to create your own.videoLayout reflects the current video layout, while setVideoLayout(to layout: VideoLayout) can be used to set a layout of your choice.
Note that by default layout will be set by the meeting scheduler in their account's meeting settings.
BlueJeansSDK.initialize(...)
provides a parameter to turn on 5x5 gallery layouts - the default will be 3x3. 5x5 works well on all supported devices, but developers may want to consider limiting 5x5 on older devices if needed.
Provides a method to get a UIView for selecting an audio device. Currently, this will return a standard iOS audio picker. BlueJeans will respect all normal changes in input/output audio devices - for example, plugging in headphones or connecting to a Bluetooth device.
The VideoDeviceService provides views for the self-view, remote endpoints, and any content that is being received currently. It also exposes methods/properties related to these, for example selecting a camera or the current size of received self or content share video.
The ParticipantsService provides information about the participants in the meeting.
Screen sharing on iOS involves creating an app extension that can capture the entire screen - even when your app is in the background. This is covered in detail in here.
The ContentShareService provides methods for starting and stopping screen sharing as well as observable properties to know if screen sharing is available (for example it may be restricted in the meeting settings), and the current status of screen sharing.
The SDK provides a facility to chat within the meeting with participants present in the meeting. The chat will remain for the duration of the meeting and will be cleared once the meeting is over.
As the names suggest, the Public and Private chat services provide access to send and receive messages either directly to an individual or to share with all participants in the meeting.
This has already been briefly covered above. The desired logging level can be set and logs can be uploaded to BlueJeans.
By default, the SDK will ask for microphone/camera permission at the last possible moment - when joining a meeting for the first time. It will use the strings specified in your app's Info.plist when requesting permission (see above).
The PermissionService provides methods and states to allow more fine-grained control over how and when permission is asked for.
When you join a BlueJeans meeting with a moderator passcode, various extra controls are available. For example, to mute the other participants in the meeting, or to start or stop recording.
The ModeratorControlsService provides the ability to check if an SDK user has joined with moderator privileges, and functions to perform moderator-specific actions.
BlueJeans meetings can optionally include the "Waiting Room" feature, which allows users who join with a participant passcode to first be placed into a waiting room state, from here a moderator can individually admit them into the meeting - after which they will join automatically.
The ModeratorWaitingRoomService provides functions and properties to see who has joined the waiting room, admit or deny those in the waiting room, or demote someone from the meeting back into the waiting room. It also provides functions to toggle the waiting room function on or off in a meeting and check if the meeting supports the 'Waiting Room' feature.
The BlueJeans meeting platform supports automatically generated closed captioning for meetings.
The ClosedCaptioningService provides functions and properties to check if automatic captions are available for the current meeting, to start and stop the captions on the client, and the captions themselves.
The SDK supports limited customization of the colors in the video layouts. Three colors can be customized.
The colors can either be specified as a named color from the main asset bundle, or with a closure that configures a CAGradientLayer. The three colors are given in the CustomizationParams struct and should be set at initialization, they can be left nil to leave as the default colors.
let gradientBackground: CustomBackground = .gradient { layer in
layer.colors = [ UIColor.blue.cgColor, UIColor.magenta.cgColor]
layer.type = .axial
}
let colorBackground: CustomBackground = .colorNamed("colorFromAssetBundle")
let customizationParams = CustomizationParams(audioTileColor: gradientBackground, containerColorOfAllTiles: colorBackground, videoTileBackgroundColor: gradientBackground)
let initParameters = BlueJeansSDKInitParams(customizationParams: customizationParams)
BlueJeansSDK.initialize(bluejeansSDKInitParams: initParameters)
You either have the option of using the built in BlueJeans layouts for remote video - or you can use the VideoStreamService
to create your own.
See the documentation for the VideoStreamService
and the examples in the HelloBlueJeans layout for more details.
We have bundled two sample apps in this repo.
The code in these sample applications will provide a working example of the API, but may not be production ready, for example, they may ignore error cases for simplicity.
If you need to support Audio after the app moves to the background, you need to enable Background Modes -> Audio capability.
Note: Without this, if you join a meeting -> background the app -> foreground it after some time, the audio will be lost and it will show an error in console as "Audio, Airplay and Picture in Picture" background mode missing from app capabilities.
Note that the iOS Client SDK does not support Video in Background mode. An app needs to be in the foreground to use the Video capability. Once the app is backgrounded, video streaming will be paused until the user foregrounds the app.
Video/Audio capability of BlueJeansSDK
would only work in an iOS Device since iOS Simulator cannot support Camera/Microphone. Hence you may not be able to use iOS Simulators for integrating and testing all SDK features. Features that do not rely on audio/video should work but are not officially supported.
Layout | Max participants | Layout pattern for max participants | Video Receive max resolution, FPS | Video Receive BW max |
---|---|---|---|---|
Speaker View | 1 | 1 | 640x360/640x480 30fps | 600 kbps |
People View | 6 | 1 (main stage) + 5 (film strip) | main stage 640x360/640x480 30fps (if single participant) | 600 kbps |
main stage 320x180/240x180 30fps (if > 1 participant) | 300 kbps | |||
film strip 160x90/120x90, 15fps | 400 kbps | |||
Gallery View | 9 | 3x3 (landscape) / 4x2+1 (portrait) | 640x360/640x480 (participants < 2) 30 fps | 1200 kbps |
320x180/240x180 (participants > 2, < 4) 30 fps | 1200 kbps | |||
160x90/120x90 (participants > 4) 15 fps | 900 kbps | |||
160x90/120x90 (participants > 9) 15 fps | 1700 kbps | |||
------------- | :---------------: | :---------------------------------: | :--------------------------------------------------------: | :--------------------: |
Note: Endpoints that send video in an aspect ratio of 4:3 instead of 16:9, will result in the video received at a resolution of 640x480 in place of 640x360, 240x180 in place of 320x180, and 120x90 in place of 160x90. Some mobile endpoints send video at 640x480 i.e at an aspect ratio of 4:3.
BlueJeans collects data from app clients who integrate with SDK to join BlueJeans meetings like device information (ID, OS, etc.), coarse location (based on IP address), and usage data.
The BlueJeans iOS Client SDK is closed source and proprietary. As a result, we cannot accept pull requests. However, we enthusiastically welcome feedback on how to make our SDK better. If you think you have found a bug, or have an improvement or feature request, please file a GitHub issue and we will get back to you. Thanks in advance for your help!
Copyright © 2023 BlueJeans Network. All usage of the SDK is subject to the Developer Agreement that can be found here. Download the agreement and send an email to [email protected] with a signed version of this agreement. Before any commercial or public-facing usage of this SDK.
Use of this SDK is subject to our Terms & Conditions and Privacy Policy.
Q. I set the video layout / mute state before joining a meeting but it changed after I joined the meeting without me calling any APIs?
A. Certain properties, such as the video layout should only be set after connecting to the meeting. While it is possible to set these while the meeting state is .connecting
after the state becomes .connected
the meeting owner's preferred layout will be pushed to all clients, overriding the changed selection. Similarly setting the audioMuted
or videoMuted
properties may be overridden by the "mute on entry" setting in some meetings.
Q. Can I use Bitcode?
A. No, the BlueJeans iOS Client SDK does not support Bitcode.
link |
Stars: 2 |
Last commit: 6 days ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics