# Need Help on Zoom CDN Video SDK

**URL:** <https://devforum.zoom.us/t/need-help-on-zoom-cdn-video-sdk/106242>\
**Category:** Twilio Migration\
**Tags:** video-sdk\
**Created:** [March 21, 2024, 2:49pm UTC](https://devforum.zoom.us/t/need-help-on-zoom-cdn-video-sdk/106242 "2024-03-21T14:49:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eagalflaging](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eagalflaging/32/57747_2.png) [@eagalflaging](https://devforum.zoom.us/u/eagalflaging)\
**Post date:** [March 21, 2024, 2:49pm UTC](https://devforum.zoom.us/t/need-help-on-zoom-cdn-video-sdk/106242/1 "2024-03-21T14:49:30Z")

</div>

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.

> **[Video SDK - web - Get started](https://developers.zoom.us/docs/video-sdk/web/get-started/#install-from-cdn)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

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

```auto
 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) =\> {  
document.querySelector(‘video-player-container’).appendChild(userVideo)  
})  
})  
}  
not sure what I’m missing, any help? thanks!

the html code is here

```auto
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <script src="https://code.jquery.com/jquery-3.6.1.min.js"></script>
    <script src="https://source.zoom.us/videosdk/zoom-video-1.10.8.min.js"></script>
    <!--<script src="/js/zoomload.js" type="module"></script>-->
</head>
<body>
    <style>
        /* adjust the CSS to your liking */

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

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

    <video-player-container></video-player-container>

    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>
    </select>
    <br />
    <input type="text" id="sessionkey" value="1234" placeholder="session key" /><br />

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

    <script>

        
        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;
                $.ajax({
                    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(() => {
                                client
                                    .join(roomname, token, username, sessionkey)
                                    .then(() => {
                                        stream = client.getMediaStream()

                                    })
                            })
                        }
                    },
                    error: function (errormessage) {
                        console.log(errormessage);
                    }
                });
            })
        }
        catch (ex) {
            alert(ex);
        }

        function startVideo() {
            stream.startVideo().then(() => {
                stream.attachVideo(stream.getCurrentUserInfo().userId, VideoQuality.Video_720P).then((userVideo) => {
                    document.querySelector('video-player-container').appendChild(userVideo)
                })
            })
        }

    </script>
</body>
</html>

```

---

<div class="post-metadata">

**Author:** ![will.ezrine](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.ezrine/32/56999_2.png) [@will.ezrine](https://devforum.zoom.us/u/will.ezrine)\
**Post date:** [March 21, 2024, 7:56pm UTC](https://devforum.zoom.us/t/need-help-on-zoom-cdn-video-sdk/106242/2 "2024-03-21T19:56:10Z")

</div>

Hi @eagalflaging,

Welcome and thank you for your post!

It looks like you are trying to use the getCurrentUserInfo function on the [Stream](https://marketplacefront.zoom.us/sdk/custom/web/modules/Stream.html) namespace. The [getCurrentUserInfo](https://marketplacefront.zoom.us/sdk/custom/web/modules/VideoClient.html#getCurrentUserInfo) function belongs to the [Video Client](https://marketplacefront.zoom.us/sdk/custom/web/modules/VideoClient.html) namespace.

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

```auto
client.getCurrentUserInfo()

```

Let me know if I can provide additional support!

Best,  
Will

---

<div class="post-metadata">

**Author:** ![will.ezrine](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.ezrine/32/56999_2.png) [@will.ezrine](https://devforum.zoom.us/u/will.ezrine)\
**Post date:** [March 21, 2024, 8:57pm UTC](https://devforum.zoom.us/t/need-help-on-zoom-cdn-video-sdk/106242/3 "2024-03-21T20:57:54Z")

</div>

Hi @eagalflaging ,

I want to clarify that we recently corrected an example in our docs that used `stream.getCurrentUserInfo()`. Please look at [docs](https://developers.zoom.us/docs/video-sdk/web/video/#start-video) and [Twilio guide](https://developers.zoom.us/docs/video-sdk/twilio/web/#zoom-self-video-view-code) for the updated usage of `client.getCurrentUserInfo()` when attempting to implement attachVideo.

Best,  
Will

---

<div class="post-metadata">

**Author:** ![eagalflaging](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eagalflaging/32/57747_2.png) [@eagalflaging](https://devforum.zoom.us/u/eagalflaging)\
**Post date:** [April 1, 2024, 8:15pm UTC](https://devforum.zoom.us/t/need-help-on-zoom-cdn-video-sdk/106242/4 "2024-04-01T20:15:02Z")

</div>

thanks Will!, thanks for the fix
