override fun startVideoShare()

in amazon-chime-sdk/src/main/java/com/amazonaws/services/chime/sdk/meetings/internal/contentshare/DefaultContentShareVideoClientController.kt [57:102]


    override fun startVideoShare(videoSource: VideoSource, config: LocalVideoConfiguration) {

        if (configuration.features.contentMaxResolution == VideoResolution.Disabled) {
            logger.info(TAG, "Could not start content because max content resolution was set to disabled")
            return
        }

        // Start the given content share source
        if (eglCore == null) {
            logger.debug(TAG, "Creating EGL core")
            eglCore = eglCoreFactory.createEglCore()
        }

        // Start video client only when not currently sharing
        if (!isSharing) {
            if (videoClient == null) {
                initializeVideoClient()
            }

            if (!startVideoClient()) {
                ObserverUtils.notifyObserverOnMainThread(observers) {
                    it.onContentShareStopped(
                        ContentShareStatus(
                            ContentShareStatusCode.VideoServiceFailed
                        )
                    )
                }
                return
            }
        }

        logger.debug(TAG, "Setting external video source to content share source")
        videoSourceAdapter.source = videoSource
        videoClient?.setExternalVideoSource(videoSourceAdapter, eglCore?.eglContext)
        logger.debug(TAG, "Setting sending to true")
        videoClient?.setSending(true)
        isSharing = true
        config.safeMaxBitRateKbps.let {
            if (it > 0) videoClient?.setMaxBitRateKbps(it)
        }

        if (configuration.features.contentMaxResolution == VideoResolution.VideoResolutionUHD) {
            videoClient?.setMaxBitRateKbps(ContentHighResolutionBitrateKbps)
            logger.info(TAG, "Set Max Bitrate to 2500kbps for UHD content")
        }
    }