# ZoomVideoSDKVideoSource onInitialize() is not called

**URL:** <https://devforum.zoom.us/t/zoomvideosdkvideosource-oninitialize-is-not-called/135352>\
**Category:** Video SDK\
**Created:** [July 17, 2025, 11:19am UTC](https://devforum.zoom.us/t/zoomvideosdkvideosource-oninitialize-is-not-called/135352 "2025-07-17T11:19:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichaelCG8](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@MichaelCG8](https://devforum.zoom.us/u/MichaelCG8)\
**Post date:** [July 17, 2025, 11:19am UTC](https://devforum.zoom.us/t/zoomvideosdkvideosource-oninitialize-is-not-called/135352/1 "2025-07-17T11:19:05Z")

</div>

# Meeting SDK Type and Version

Android Version 2.2.10 Kotlin (and lower, see description)

# Description

When joining a session with an external video source, source’s `onInitialize` function is only called rarely. `onStartSend` is called reliably, whether I begin my session with `localVideoOn = true` or if I start with it `false` and wait for the `onSessionJoin` callback and run `ZoomVideoSDK.getInstance().videoHelper.startVideo()` inside it (which returns a success code).

I have a custom audio capturer and renderer in the same session and both are working reliably.

Here is how I join the session:

```auto
val sdk = ZoomVideoSDK.getInstance()
sdk.addListener(zoomListener)

// Implements ZoomVideoSDKVideoSource
// videoCapturer is a class variable, so I maintain a strong reference to it.
// It has a pushFrame method which internally calls sender.sendVideoFrame, and I can call this reliably.
videoCapturer = ZoomVideoCapturer(familyID, callbacks::onPublishStarted, callbacks::onPublishEnded)

audioRenderer = ZoomAudioRenderer(activity.applicationContext)

val sessionContext = ZoomVideoSDKSessionContext().apply {
    audioOption = ZoomVideoSDKAudioOption().apply {
        connect = true
        mute = false
        isMyVoiceInMix = false
    }
    videoOption = ZoomVideoSDKVideoOption().apply {
        localVideoOn = true
    }
    sessionName = sessionID
    userName = userID
    token = jwtToken
    virtualAudioMic = ZoomAudioCapturer(activity.applicationContext)
    virtualAudioSpeaker = audioRenderer
    externalVideoSource = videoCapturer
}
sdk.joinSession(sessionContext)

```

`ZoomVideoCapturer` has this in it:

```auto
override fun onInitialize(
    sender: ZoomVideoSDKVideoSender?,
    support_cap_list: MutableList<ZoomVideoSDKVideoCapability>?,
    suggest_cap: ZoomVideoSDKVideoCapability?
) {
    Timber.d("onInitialize, null = ${sender == null}, ${support_cap_list == null}, ${suggest_cap == null}")
    this.sender = sender
    readyToSend = sender != null
}

```

The SDK has previously been initialized like this:

```auto
val sdk = ZoomVideoSDK.getInstance()
val params = ZoomVideoSDKInitParams().apply {
    domain = "zoom.us"
    enableLog = true // Optional: enable logging for debugging
    videoRawDataMemoryMode = ZoomVideoSDKRawDataMemoryMode.ZoomVideoSDKRawDataMemoryModeHeap
    audioRawDataMemoryMode = ZoomVideoSDKRawDataMemoryMode.ZoomVideoSDKRawDataMemoryModeHeap
}
sdk.initialize(context, params).let {
    ZoomErrors.msgOrNull(it)?.let { msg ->
        Timber.e("Failed to init zoom sdk: $msg")
    }
}

```

# Troubleshooting Routes

I’ve experimented with the following SDK versions with no difference in behaviour:  
2.2.10, 2.2.5, 2.2.0, 2.1.13, 1.14.1

Restarting the app, or rebooting the device seems to make no difference.

# Comments

Because of the intermittent nature, I’m wondering about the possibility of a race condition, or sensitivity to network conditions. Are there any other pieces of setup I need ensure have finished before starting the session with an external video source? Or are there any known reasons why `onInitialize` wouldn’t be called, but `onStartSend` would?

Thanks a lot!  
Michael

---

<div class="post-metadata">

**Author:** ![MichaelCG8](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@MichaelCG8](https://devforum.zoom.us/u/MichaelCG8)\
**Post date:** [July 21, 2025, 8:35am UTC](https://devforum.zoom.us/t/zoomvideosdkvideosource-oninitialize-is-not-called/135352/2 "2025-07-21T08:35:56Z")

</div>

Well, it looks like the key here is to join the session on the main thread. Changing to this code solved the problem.

```auto
activity.runOnUiThread {
    sdk.joinSession(sessionContext)
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [July 22, 2025, 9:36am UTC](https://devforum.zoom.us/t/zoomvideosdkvideosource-oninitialize-is-not-called/135352/3 "2025-07-22T09:36:25Z")

</div>

Closed on July 22, 2025, 9:36am UTC

This topic was automatically closed 25 hours after the last reply. New replies are no longer allowed.
