BJNVideo
public class BJNVideo
BJNVideo
encapsulates all of the BlueJeans API related to establishing an audio/video connection.
It can be initialized as,
let video = BJNVideo()
To connect to an audio/video meeting,
video.join(meetingID: "111111111", passcode: "2222", displayName: "John Doe", onSuccess: {
print("Successfully joined the meeting")
}, onFailure: {})
To disconnect from the meeting,
video.leave()
BJNVideo
has several observable properties, some of which can be mutated.
All properties (BJNObservable
and BJNMutableObservable
) can be observed,
video.videoMuted.onChange {
print("video muted status changed to ", video.videoMuted.value)
}
and any properties that are of type BJNMutableObservable
can be modified
video.videoMuted.value = true
-
Creates a video instance and initializes all properties.
Declaration
Swift
public init(maxVideoBandwidth: Int? = nil)
Parameters
maxVideoBandwidth
Optional field. The maximum video bitrate that should be sent. Unit is kiloBitsPerSecond. Default value is nil.
-
The join function connects the client into a BlueJeans meeting room in the cloud. This call will not schedule a meeting, so the meeting must have already been scheduled/exist. When joining the (existing) meeting the client will either see participants, or the screen shown to the first participant.
Declaration
Swift
public func join(meetingID id: String, passcode: String?, displayName: String, useBlueJeansStaging: Bool = false, maxVideoBandwidth: Int? = nil, onSuccess: @escaping CompletionBlock, onFailure: @escaping CompletionBlock)
Parameters
meetingID
The dialable BlueJeans meeting ID number.
passcode
The passcode field serves multiple purposes. To manage the BlueJeans meeting, populate this field with the Moderator Code. To provide an extra level of security, a meeting may have assigned a Security pass code value. Lastly, if there is no code assigned, set this field to null or empty-string.
displayName
The name of this client as it would appear in the meeting roster.
useBlueJeansStaging
Optional field. Represents whether the client is connecting to the production or staging cloud services at BlueJeans. Default value is false.
maxVideoBandwidth
Optional field. The maximum video bitrate that should be sent. Unit is kiloBitsPerSecond. Default value is nil.
onSuccess
Callback if joinMeeting succeeded.
onFailure
Callback if there was a problem encountered.
-
The leave function disconnects this client session from the BlueJeans meeting room in the cloud. If the overload function is called with the
ejectAndEnd
parameter, the client can request BlueJeans to eject any remaining users and end the meeting session.Declaration
Swift
public func leave(ejectAndEnd: Bool = false)
Parameters
ejectAndEnd
Optional field. If true, eject any users in meeting room and then end the meeting session. Default value is false.
-
Represents the current state of connection between the client application, and a BlueJeans meeting.
Any change to the connection state, with the exception of initialization, will generate an event callback via the onChange handler.
Possible values are
idle, connecting, connected, disconnected, reconnecting
.Declaration
Swift
public private(set) lazy var connectionState: BJNObservable<ConnectionState> { get set }
-
Represents the extent of logging detail provided by the SDK in order to diagnose operations.
Any change to the loggingMode, with the exception of initialization, will generate an event callback via the onChange handler.
Possible values are
debug, info, warning, error, verbose
.Declaration
Swift
public let loggingMode: BJNMutableObservable<LoggingMode>
-
A boolean variable, if true, represents that the BlueJeans meeting has a collaborative screen sharing session running.
Any change to the screen share state, with the exception of initialization, will generate an event callback via the onChange handler.
Declaration
Swift
public let receivingScreenShare: BJNObservable<Bool?>
-
A boolean variable, if true, indicates that the SDK will turn on the local camera to allow the user to see themselves before connecting into a video meeting.
Any change to the screen share state, with the exception of initialization, will generate an event callback via the onChange handler.
Declaration
Swift
public let enableSelfVideoPreview: BJNMutableObservable<Bool>
-
Represents the current connection-state of the client application’s video media, and the meeting in the BlueJeans meeting.
Any change to the connection state, with the exception of initialization, will generate an event callback via the onChange handler.
Possible values are
active, inactiveOnlyParticipant, inactiveNoOneHasVideo, inactiveNeedsModerator, inactiveDisconnected
.Declaration
Swift
public private(set) lazy var videoState: BJNObservable<VideoState> { get set }
-
Represents how each of the remote participant’s video is composited into the single video stream received by the client.
This is usually set by the client, but may also be changed by the meeting moderator.
See the documention for
VideoLayout
for more details on each layout.Any change to the video layout, with the exception of initialization, will generate an event callback via the onChange handler.
Declaration
Swift
public private(set) var videoLayout: BJNMutableObservable<VideoLayout?>!
-
Represents the current state of microphone audio. The variable may be updated(set) by the client application, or by messages from the backend infrastructure.
Any update, with the exception of initialization, will generate an event callback via the onChange handler.
Declaration
Swift
public let audioMuted: BJNMutableObservable<Bool>
-
Represents the current state of video display. The variable may be updated(set) by the client application, or by messages from the backend infrastructure.
Any update, with the exception of initialization, will generate an event callback via the onChange handler.
Declaration
Swift
public let videoMuted: BJNMutableObservable<Bool>
-
Represents the current local camera device selected. Use
selectCameraDevice(:)
for selecting a local camera device.Any change to the camera device, with the exception of initialization, will generate an event callback via the onChange handler.
Possible values are
front, back
.Declaration
Swift
public var cameraDevice: BJNObservable<CameraDevice?> { get }
-
Engages the OS resident UI and method for Audio device selection.
Declaration
Swift
public func createAudioDeviceSelectionPresenterView() -> UIView?
Return Value
Returns a UIView or nil. This can be added on a view and used as Audio Device Picker.
-
Returns a new UIView instance that renders the shared collaboration view coming from the BlueJeans cloud.
Declaration
Swift
public func getContentShareInstance() -> UIView?
Return Value
Returns a UIView or nil.
-
Returns a new UIView instance that renders the video coming from the BlueJeans cloud.
Declaration
Swift
public func getRemoteVideoInstance() -> UIView?
Return Value
Returns a UIView or nil.
-
Selects which local camera device to use.
Declaration
Swift
public func selectCameraDevice(_ desiredDevice: CameraDevice)
Parameters
cameraDevice
camera device value to be selected. Possible values are
front, back
. -
Returns a new UIView instance that renders the video coming from the device’s internal camera(s).
Declaration
Swift
public func getSelfViewInstance() -> UIView?
Return Value
Returns a UIView or nil.