浏览器接入(通信测试demo)

1、demo启动步骤

  1. 修改appKey(从已发布应用中获取发布链接参数) live-cat-0.3.0-demo-img1

  2. 打开player.html,启动

  3. 左边是发送消息到应用端,右边是接收应用的消息(按F12,可以打开控制台看到详细的发送状态) webrtc demo send pic

2、浏览器直接接入代码参考

<script src="https://cdn.jsdelivr.net/npm/react@17.0.2/umd/react.production.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/react-dom@17.0.2/umd/react-dom.production.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/react-is@17.0.2/umd/react-is.production.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/rxjs@7.4.0/dist/bundles/rxjs.umd.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/styled-components@5.3.3/dist/styled-components.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/js-base64@3.7.2/base64.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/resize-observer-polyfill@1.5.1/dist/ResizeObserver.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/ray-streaming@2.17.4/ray-streaming.umd.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/live-cat@0.8.4/live-cat.umd.min.js"></script>
<script>
  let Launcher = window.LiveCat.Launcher //公有化
  // let Launcher = window.LiveCat.LauncherPrivate //私有化
  let launcher = new Launcher({
    baseOptions:{
      appKey: 'xxxxxxxxxx', 
      address: 'https://app.3dcat.live',
      startType: 1
    }
  })
  window.launch = launcher
  document.querySelector('body').style.width = '100vw'
  document.querySelector('body').style.height = '100vh'
  launcher.automata(document.querySelector('body'))
</script>
业务咨询:400-8037-298