Add files via upload

pull/550/head
Pablo Fuente Pérez 2020-10-01 14:57:23 +02:00 committed by GitHub
parent b3081d6d43
commit 92123d6df5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,55 @@
<html>
<head>
<script>
const xmlHttp = new XMLHttpRequest();
xmlHttp.open('GET', 'https://api.github.com/repos/OpenVidu/openvidu/releases/latest', false);
xmlHttp.send(null);
const response = JSON.parse(xmlHttp.responseText);
const version = response.tag_name.replace(/^v/, '');
const newScript = document.createElement('script');
newScript.src = 'https://github.com/OpenVidu/openvidu/releases/download/v' + version +
'/openvidu-browser-' + version + '.min.js';
document.getElementsByTagName('head')[0].appendChild(newScript);
newScript.onload = () => {
startOpenVidu();
};
</script>
</script>
<style>
video {
height: 5px !important;
width: 10px !important;
}
</style>
</head>
<body style='background-color: red'>
<div id='videos'></div>
</body>
<script>
function startOpenVidu() {
var url = new URL(window.location.href);
var SESSION_ID = url.searchParams.get('sessionId');
var SECRET = url.searchParams.get('secret');
var TOKEN = 'wss://' + location.hostname + ':4443?sessionId=' + SESSION_ID + '&secret=' + SECRET +
'&recorder=true';
var OV = new OpenVidu();
var session = OV.initSession();
session.on('streamCreated', (event) => {
session.subscribe(event.stream, 'videos');
});
session.connect(TOKEN)
.then(() => {
console.log('Recorder participant connected')
})
.catch(error => {
console.error(error)
});
}
</script>
</html>