Need Help on Zoom CDN Video SDK

Hi there, I’m trying to migration from Twilio Video to Zoom.
Followed this doc try to create a simple project for POC
I’m using CDN to load Zoom Video SDK in a HTML page.

the real code Im using is , I think this is the latest version

then call webservice to generate access token
all seems works when visit this page, it will ask to allow to use Camera but then when try to attach video to page, it throw error for
stream.getCurrentUserInfo() is not a function

 Uncaught (in promise) TypeError: stream.getCurrentUserInfo is not a function

function startVideo() {
stream.startVideo().then(() => {
stream.attachVideo(stream.getCurrentUserInfo().userId, VideoQuality.Video_720P).then((userVideo) => {
not sure what I’m missing, any help? thanks!

the html code is here

<!DOCTYPE html>
    <meta charset="utf-8" />
    <script src=""></script>
    <script src=""></script>
    <!--<script src="/js/zoomload.js" type="module"></script>-->
        /* adjust the CSS to your liking */

        video-player-container {
            width: 100%;
            height: 300px;

        video-player {
            width: 100%;
            height: auto;
            aspect-ratio: 16/9;


    Room Name
    <br />
    <input type="text" id="roomname" value="restroom" placeholder="Room name" /><br />
    User Name
    <br />
    <input type="text" id="identity" value="test111" placeholder="Your name" /><br />
    Role:<br />
    <select name="role" id="role">
        <option value="1">Host/Co-host</option>
        <option value="0" selected>Guest</option>
    <br />
    <input type="text" id="sessionkey" value="1234" placeholder="session key" /><br />

    <input type="button" onclick="startVideo();" value="Start Video" />


        const ZoomVideo = window.WebVideoSDK.default
        var client = ZoomVideo.createClient();

        var token = '';

        var stream

        try {
            var a = new Promise(function () {
                var roomname = $("#roomname")[0].value;
                var username = $("#identity")[0].value;
                var sessionkey = $("#sessionkey")[0].value;
                var roletype = $("#role")[0].value;
                    type: "POST",
                    url: "TwilioVideoService.asmx/GetZoomAuthJWT",
                    data: "roomname=" + roomname + "&username=" + username + "&roletype=" + roletype + "&session_key=" + sessionkey,
                    dataType: "text",
                    async: false,
                    success: function (result) {
                        if (result.length > 0 && $(result)[0].textContent !== '') {
                            token = $(result)[2].textContent.replace("\n", "").replace("  ", "").replace("\n", "");

                            client.init('en-US', 'Global', { patchJsMedia: true }).then(() => {
                                    .join(roomname, token, username, sessionkey)
                                    .then(() => {
                                        stream = client.getMediaStream()

                    error: function (errormessage) {
        catch (ex) {

        function startVideo() {
            stream.startVideo().then(() => {
                stream.attachVideo(stream.getCurrentUserInfo().userId, VideoQuality.Video_720P).then((userVideo) => {


Hi @eagalflaging,

Welcome and thank you for your post!

It looks like you are trying to use the getCurrentUserInfo function on the Stream namespace. The getCurrentUserInfo function belongs to the Video Client namespace.

I believe if you simply use the following code, your implementation will work.


Let me know if I can provide additional support!


1 Like

Hi @eagalflaging ,

I want to clarify that we recently corrected an example in our docs that used stream.getCurrentUserInfo(). Please look at docs and Twilio guide for the updated usage of client.getCurrentUserInfo() when attempting to implement attachVideo.


1 Like

thanks Will!, thanks for the fix

1 Like