const lensClickUtils = { handleLoadVideoClick: function handleLoadVideoClick(lensId) { log('handleLoadVideoClick: enter'); log('handleLoadVideoClick: lensId=' + lensId); const btnElemId = elemIdUtils.getElemId(lensId, elemIdUtils.BUTTON_LOAD_VIDEO_PREFIX, undefined); const loadBtnSelector = '#' + btnElemId; // get the jQuery selector for the Load Video button $(loadBtnSelector).hide(); // hide the Load Video button var videoElemSize = lensUIUtils._getVideoElemSize(viewWidth, viewHeight); // get the desired size of the video element given the view dimensions var videoElemWidth = videoElemSize.width; var videoElemHeight = videoElemSize.height; const videoType = videoUtils.getVideoType(lensId); // what type of video will we create? log('handleLoadVideoClick: videoType=' + videoType); var videoHtml = ''; var videoUrl = ''; var vId; var videoElemId; vId = elemIdUtils.getElemId(lensId, elemIdUtils.VIDEO_CONTENT_PREFIX, true); // get the HTML id for the parent of the video element log('handleLoadVideoClick: vId=' + vId); videoElemId = elemIdUtils.getVideoElemId(lensId); // get the id of the video element log('handleLoadVideoClick: videoElemId=' + videoElemId); if (videoType === videoUtils.VIDEO_TYPE_BLOB) { // if blob video videoUrl = videoUtils.getVideoUrl(lensId); // get the URL of the blob videoHTML = videoUtils.getVideoHtml_video(lensId, videoElemWidth, videoElemHeight, videoUrl); // get html for the video $('#' + vId).append(videoHTML); // add the HTML for the video tag to the page lensUIUtils.subscribeToEventsForVideoElem(videoElemId); // subscribe to the events for the blob video } else { // if Vimeo video videoUrl = videoUtils.getIFrameUrl(lensId); // get the URL of the iFrame source videoHTML = videoUtils.getVideoHtml_iFrame(lensId, videoElemWidth, videoElemHeight, videoUrl); // get html for the Vimeo video in an iFrame $('#' + vId).append(videoHTML); // add the HTML for the iFrame to the page lensUIUtils.subscribeToEventsForVimeoVideo(videoElemId); // subscribe to the events for the blob video } log('handleLoadVideoClick: leave'); }, handleTabClickAsync: async function handleTabClickAsync(evt) { log('handleTabClickAsync: enter'); const elem = evt.currentTarget; if (elem === null) { log('handleTabClickAsync: currentTarget is NULL'); log('handleTabClickAsync: leave'); return; } const id = elem.id; // get the id of the DOM element if (id === null) { log('handleTabClickAsync: currentTarget.id is NULL'); log('handleTabClickAsync: leave'); return; } log('handleTabClick: id=' + id); const isVideo = id.startsWith(elemIdUtils.LIST_ITEM_VIDEO_TAB_PREFIX); // is the tab a Video tab? const lensId = lensUIUtils.getLensIdFromElemId(id); // convert the element id to a lens id log('handleTabClickAsync: lensId=' + lensId); if (isVideo) { await lensUIUtils._addVideoElemToTabIfNecAsync(lensId); // when the user clicks the Video tab, make sure the tab contains a