Interface VideoController


  • public interface VideoController
    Interface for controlling different video settings. An VideoController object is only valid while the SinchClient is started. As soon as the SinchClient is stopped, this object is invalidated and must not be used.
    • Method Detail

      • getLocalView

        android.view.View getLocalView()
        Returns:
        A View containing the local users camera preview
      • getRemoteView

        android.view.View getRemoteView()
        Returns:
        A View containing the remote users camera feed
      • getCaptureDevicePosition

        int getCaptureDevicePosition()
        Returns:
        The current device facing position, one of Camera.CameraInfo.CAMERA_FACING_FRONT or Camera.CameraInfo.CAMERA_FACING_BACK
      • setCaptureDevicePosition

        void setCaptureDevicePosition​(int facing)
        Sets the camera to use for capturing video
        Parameters:
        facing - one of Camera.CameraInfo.CAMERA_FACING_FRONT or Camera.CameraInfo.CAMERA_FACING_BACK
        Throws:
        java.lang.IllegalArgumentException - if facing is invalid.
        See Also:
        android.hardware.Camera.CameraInfo
      • toggleCaptureDevicePosition

        void toggleCaptureDevicePosition()
        Toggles the capture device position. If current facing position is Camera.CameraInfo.CAMERA_FACING_FRONT, sets it to Camera.CameraInfo.CAMERA_FACING_BACK. If current facing position is Camera.CameraInfo.CAMERA_FACING_BACK, sets it to Camera.CameraInfo.CAMERA_FACING_FRONT.
      • setRemoteVideoFrameListener

        void setRemoteVideoFrameListener​(RemoteVideoFrameListener listener)
        Sets a listener for the remote video frames. Blocks rendering. In-place modification of provided I420 frame would affect rendering. If heavy operation is required, which does not affect rendering, e.g. saving screen-shot in JPEG - spawn a work thread and work with a copy of the frame. See VideoUtils for I420 into NV21 conversion.

        See RemoteVideoFrameListener for more information.

        IMPORTANT: set to null when listener is no longer needed - it will increase performance by eliminating otherwise necessary conversion from captured texture-based frame into memory buffer-backed I420 frame.
        Parameters:
        listener - will be called on each frame from the remote video stream.
      • setLocalVideoZOrder

        void setLocalVideoZOrder​(boolean onTopOfRemoteView)
        Sets whether local video (preview from camera) should be rendered on top of remove video view (default behaviour) or vice versa in case views are overlapping.
        Parameters:
        onTopOfRemoteView - if set to false will make remove video rendered on top of preview.
      • setTorchMode

        void setTorchMode​(boolean enabled)
        Enables/disables flash torch mode during current video session. Might be ignored if not available.
        Parameters:
        enabled - sets flash torch mode ON if true.