我正在探索基于WebRTC的视频会议解决方案。发现Jitsi是从各种框架环顾四周的杰出候选人之一。
示例代码:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<?php
$webroot = '/openemr-local';
?>
<script src="<?php echo $webroot ?>/jitsi-meet/libs/lib-jitsi-meet.min.js"></script>
<script src="<?php echo $webroot ?>/jitsi-meet/libs/jquery-2.1.1.min.js"></script>
<script src="<?php echo $webroot ?>/jitsi-meet/libs/strophe/strophe.js"></script>
<script src="<?php echo $webroot ?>/jitsi-meet/libs/strophe/strophe.disco.min.js?v=1"></script>
<script type="text/javascript" src="<?php echo $webroot ?>/jitsi-meet/example.js"></script>
</head>
<body>
<div class="container">
<div id="jitsi-test">
<span>Join Meeting Name</span><input type="text" id="meetingroom" name="meetingroom"/>
<button id="join" name="join" onclick="joinMeeting()">Join Me</button>
<button id="disconnect" name="disconnect" onclick="unload()">Disconnect</button>
</div>
<div id="video-container">
</div>
</div>
</body>
</html>
我正在使用Jitsi-meet Git Hub Example中的example.js
,并进行以下更改:
const options = {
hosts: {
domain: 'beta.meet.jit.si',
muc: 'conference.beta.meet.jit.si', // FIXME: use XEP-0030
focus: 'focus.beta.meet.jit.si',
},
bosh:'//beta.meet.jit.si/http-bind', // FIXME: use xep-0156 for that
// The name of client node advertised in XEP-0115 'c' stanza
clientNode: 'http://jitsi.org/jitsimeet'
};
无法在浏览器上启动视频
onConnectionSuccess
从未被调用。我确实放了
调试器。Access to XMLHttpRequest at 'http://beta.meet.jit.si/http-bind' from origin 'http://localhost' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.
编辑:
将https:
添加到bosh:'//beta.meet.jit.si/http-bind'
之后。 CORS错误消失了,并且onConnectionSuccess正常工作。
仍然,需要一些有关工作会议示例的提示。
我正在尝试实现类似于以下示例的内容: jitsi-meet custom GUI