3

我正在尝试在流星中实现Simplewebrtc进行视频聊天。这些是我的文件

#webrtc.html
<head>
  <title>meteorwebrtc</title>
</head>

<body>
 {{> navbar}}
 <div class="col-md-10 col-md-offset-1">
  {{> video_chat}}
</div>

<template name="video_chat">
  <div class="col-md-12">
    <div class="col-md-4">
      <video id="localVideo"></video>
    </div>
   <div class="col-md-8">
    <div id="remoteVideos"></div>
  </div>
 </div>
</template>

#webrtc.js

if (Meteor.isClient) {
  var webrtc = new SimpleWebRTC({

   localVideoEl: 'localVideo',

   remoteVideosEl: 'remoteVideos',

   autoRequestMedia: true
});
  webrtc.on('readyToCall', function () {

  webrtc.joinRoom('your awesome room name');
 });
}

我在 lib 目录中包含 simplewebrtc.js 文件,以便我将首先加载

lib/latest.js

当我在本地尝试并将代码复制到服务器并运行它时,视频聊天工作正常,但是如果我使用meteor deploy meteor-webrtc.meteor.comwebrtc 捆绑和部署应用程序不起作用并且它不会引发任何错误。我什至尝试在模数.io中部署应用程序,但我也得到了相同的结果。

回购-meteor-webrtc

在流星服务器中部署的应用程序-meteor-webrtc.meteor.com

我该如何解决这个问题?

4

0 回答 0