Multi-camera mode
Function description
During a call, sometimes it is necessary to show pictures in different directions or angles for other people in the channel to see, such as art teachingFor scenes, Cloudhub provides the following methods to meet the needs of multi-camera mode.
Before you start, make sure that you have implemented basic real-time audio and video functions in your project. For details, see Starting an audio and video call .
Multi-camera mode usually refers to having multiple video capture devices. The multi-camera mode method is mainly used to capture and play different directions orAngled picture.CloudHub SDK provides a unified management mode for multiple cameras, including some common methods for managing cameras. internal usesourceId to identify and video. Ensure that each video device is unique.
Implementation reference
Android
- Initialize RtcEnginePlus->initEngineWhen the API is enabled, the multi-camera mode is enabled.
- The list of local cameras can be obtained throughgetLocalCameraIds
- Turn on local video device capture->enableLocalVideo and pass in the cameraId of the device that needs to be enabled.
- Play this video stream->startPlayingLocalVideo and pass in the cameraId of the corresponding video device
- Stop this video stream->stopPlayingLocalVideo and pass in the cameraId of the corresponding video device
- Publish this video stream->publishStream and pass in the cameraId of the corresponding video device
- Stop publishing this video stream->unpublishStream,Incoming comes that you need to stop publishing the video device’s cameraId
Web
- Create a client
- enableMultiStream enables multi-stream mode
- Join the channel
- getDevices get input/output devices
- createStream creates a
Stream
object, which can pass different sourceid - Pass in the
Stream
object publish publish local audio and video streams (Multi-stream many times as necessary to create aStream
, issued several) - unpublish unpublish the local audio and video stream
Development considerations
Multi-camera mode supports PC clients, PC browsers, and android devices. iOS devices only accept multi-camera video streams, not supportPublish a multi-camera stream.
The above methods all have return values, and the return value is less than 0, which means the method call failed.