codeigniter 如何在meetingSDK元素DOM中添加zmmtg-root

t5fffqht  于 11个月前  发布在  其他
关注(0)|答案(1)|浏览(84)

我正在我的网站内实现缩放会议。我使用缩放会议SDK。一切都很好,但DOM只是附加在关闭的</html>标记上方。然而,在我看来,我已经按照缩放指令定义了DOM。
我使用Codeigniter,jQuery。下面是我的代码

//This is view

<div id="meetingSDKElement"></div>

//This is footer
<script src="https://source.zoom.us/2.18.2/lib/vendor/react.min.js"></script>
<script src="https://source.zoom.us/2.18.2/lib/vendor/react-dom.min.js"></script>
<script src="https://source.zoom.us/2.18.2/lib/vendor/redux.min.js"></script>
<script src="https://source.zoom.us/2.18.2/lib/vendor/redux-thunk.min.js"></script>
<script src="https://source.zoom.us/2.18.2/lib/vendor/lodash.min.js"></script>
<script src="https://source.zoom.us/zoom-meeting-2.18.2.min.js"></script>
<script type="text/javascript" src="<?php echo base_url('assets/js/client-view.js'); ?>?v=<?php echo VERSION; ?>"></script>

//This is Javascript
$(document).ready(function(){
   getSignature();
});
function getSignature() {
  fetch(authEndpoint, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      meetingNumber: meetingNumber,
      role: role,
      password:passWord
    })
  }).then((response) => {
    return response.json()
  }).then((data) => {
    console.log(data)
    startMeeting(data.signature)
  }).catch((error) => {
    console.log(error)
  })
}

function startMeeting(signature) {
$(".meeting-loader").css("visibility", "hidden");
  document.getElementById('zmmtg-root').style.display = 'block'

  ZoomMtg.init({
    leaveUrl: leaveUrl,
    success: (success) => {
      console.log(success)
      ZoomMtg.join({
        signature: signature,
        sdkKey: sdkKey,
        meetingNumber: meetingNumber,
        passWord: passWord,
        userName: userName,
        userEmail: userEmail,
        tk: registrantToken,
        zak: zakToken,
        success: (success) => {
          console.log(success)
        },
        error: (error) => {
          console.log(error)
        },
      })
    },
    error: (error) => {
      console.log(error)
    }
  })
}

字符串
我想把zmmtg-root附加到meetingSDKElement里面。

yhuiod9q

yhuiod9q1#

Zoom Developer Advocate here.由于Zoom Meeting SDK web Client View被设计为占据整个页面,因此它不支持附加到给定的HTML元素。
但是,有两种方法可以将Meeting SDK附加到给定的HTML元素中:

  1. Embed the Meeting SDK web Client View in an iFrame,保留现有代码,但托管并设置为iframe src:
<div id="meetingSDKElement">
   <iframe src="https://example.com/meetingsdk" allow="camera; microphone"></iframe>
</div>

字符串
1.使用Meeting SDK web Component View,它被设计为附加在给定的HTML元素中:

<div id="meetingSDKElement">
  <!-- Meeting SDK renders here when a user starts or joins a Zoom meeting -->
</div>
const client = ZoomMtgEmbedded.createClient()

let meetingSDKElement = document.getElementById('meetingSDKElement')

client.init({ zoomAppRoot: meetingSDKElement, language: 'en-US' })

client.join({
   sdkKey: sdkKey,
   signature: signature,
   meetingNumber: meetingNumber,
   password: password,
   userName: userName,
   zak: zakToken
})

有关Zoom Developer Platform的特定问题,请随时在Zoom devforum上提问。

相关问题