Video


iOS Client SDK provides "Pre-built video layouts", with which, users can experience highly interactive video experiences. BlueJeans SDK currently offers three pre-built video layouts and support for building your customized layout to your choice.  

The VideoDeviceService handles video-related APIs, such as selecting a camera device or getting the Remote/Self/Content video streams. 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 the received self or content share video.

Use the following command to check the current local camera device selected.

BlueJeansSDK.videoDeviceServiceProtocol.cameraDevice

You can use the following command to select the local camera device.

BlueJeansSDK.videoDeviceServiceProtocol.selectCameraDevice(_ desiredDevice: CameraDevice)

Note

You can select the Font and Back values for the camera device.

Adding video

Adding Remote video

BlueJeans SDK 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()

You can add it to your view using view controller containment. A sample example is shown below

addChild(remoteVideoViewController)
view.addSubview(remoteVideoViewController.view)
view.sendSubviewToBack(remoteVideoViewController.view)
remoteVideoViewController.didMove(toParent: self)
// Add auto-layout constraints here if desired. 

Adding Self and Content Share views

The Self and Content Share views can be added as follows:

  • Create a container view (e.g. videoContainer) in Storyboard, XIB, or code.
  • Setup AutoLayout constraints for the videoContainer view.
  • Add the self or content share view as shown below
// 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

You can use the sample code above for getContentShareView instead of getSelfView and add it to your view hierarchy.

Note

This SDK does not keep references to these views, just like RemoteVideoViewController.

Setting Flash mode

The BlueJeans SDK provides several APIs, including the "setFlashMode" API, which allows you to toggle the flash feature on and off. "setFlashMode" is a boolean property where setting it to true turns on the flash and setting it to false turns it off.

BluejeansSDK.meetingService.videoDeviceProtocol.setFlashMode(_enabled: Boolean)

Use FlashLightEnabled API to check whether the flashlight is turned on/off, you can always check this and update your UI.

By default, the SDK turns off the flash when you switch between the cameras. However, if you want to turn on the flash, you can use the "setFlashMode" API.

Note

To turn on the flashlight on certain devices, you may need to access a camera device that is equipped with a flashlight feature.

Video Layouts

Represents how remote participant's videos are composed

  • Speaker: The video stream will be shown only the most recent speaker.

  • People: The most recent speaker will be shown in a larger video. A filmstrip of the next up to 5 most recent speakers is shown at the bottom.

 

  • Gallery: The gallery layout can fit a maximum number of participant tiles up to 9 or 25 depending on the SDK input configuration. By default, the configuration will be set to 3x3, meaning 9 participants sorted 3x3. You can customize the configuration to 25 participants which are sorted in 5x5 style (Ref.  ).

Note

By default, the current layout will be in the People layout, or it will be the one chosen by the host's meeting settings.

  • Custom: Override BlueJeans pre-built layouts and use the VideoStreamService to create your own. For more details on the custom layout, you can see it here
    • You can manually configure a custom layout and ignore the meeting layout. Request and render a video stream using the VideoStreamServiceProtocol.
    • Setting the layout to custom is possible before or during a meeting. Gallery, People, or Speaker layouts can only be set during a meeting.

Changing Layout

setVideoLayout is used to change a Video Layout of your choice.  To change your current video layout by calling the setVideoLayout function with one of VideoLayout.

BluejeansSDK.meetingService.setVideoLayout(to layout: Gallery) // to set gallery view
BluejeansSDK.meetingService.setVideoLayout(to layout: People) //to set people view  
BluejeansSDK.meetingService.setVideoLayout(to layout: Speaker) //to set speaker view

videoLayout reflects the current video layout, while setVideoLayout(to layout: VideoLayout) can be used to set a layout of your choice.

Note

By default, the meeting scheduler will set the layout in their account's meeting settings.

Video Resolutions and BW consumption

The below table explains the supported video receive resolution and BW max. 

Layout Resolution FPS Video Receive BW max
Speaker View 1280x720 30  1400 kbps
640x480 30 600 kbps
640x360 30 600 kbps
People View 1280x720 30 Main Stage (if > 1 participant) 1600 kbps
640x480 30 Main Stage (if > 1 participant) 600 kbps
640x360 30 Main Stage (if > 1 participant) 600 kbps
320x180 30 Main Stage (if > 1 participant) 300 kbps
240x180 30 Main Stage (if > 1 participant) 300 kbps
160x90 15 film strip 400 kbps
120x90 15 film strip 400 kbps
Gallery View (3x3 (landscape) / 4x2+1 (portrait) 1280x720 30 (participants < 2) 1400 kbps
640x480 30 (participants < 2) 1200 kbps
640x360 30 (participants < 2) 1200 kbps
320x180 30 (participants > 2 and  < 4) 1200 kbps
240x180 30 (participants > 2 and  < 4) 1200 kbps
320x180 30 (participants > 2 and  < 4) 1200 kbps
240x180 30 (participants > 2 and  < 4) 1200 kbps
160x90 15 (participants > 4)  900 kbps
120x90 15 (participants > 4)  900 kbps
160x90 15 (participants > 9)  1700 kbps
120x90 15 (participants > 9)  1700 kbps