This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Contains variables for image-size, path of models and labels that are required by other modules | |
""" | |
IMAGE_SIZE = 50 # We'll be working with 50 * 50 pixel images | |
MODEL_PATH = "trained_model/bglessmodelv1.h5" | |
LABELS = ['A', 'C', 'E', 'H', 'I', 'L', 'O', 'U', 'V', 'W'] | |
# Minimum confidence percentage i.e allowed for prediction | |
THRESHOLD = 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = { | |
mode: "live", | |
codec: "h264" | |
} | |
var client = AgoraRTC.createClient(config); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myfunction(){ | |
let handlefail = function(err){ | |
console.log("Error: ", err); | |
}; | |
let remotecontainer = document.getElementById("remote"); | |
let appid = document.getElementById("appid"); | |
function addremotestream(streamid){ | |
let newdiv = document.createElement("div"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function close(){ | |
client.unpublish(localstream, function(err) { | |
console.log("unpublished!"); | |
//…… | |
}) | |
client.leave(function() { | |
console.log("client leaves channel"); | |
//…… | |
}, function(err) { | |
console.log("client leave failed ", err); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function start() { | |
console.log('Requesting local stream'); | |
startButton.disabled = true; | |
try { | |
const stream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); | |
console.log('Received local stream'); | |
localVideo.srcObject = stream; | |
localStream = stream; | |
local_Video.srcObject = stream; | |
callButton.disabled = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function call() { | |
callButton.disabled = true; | |
hangupButton.disabled = false; | |
console.log('Starting call'); | |
startTime = window.performance.now(); | |
const videoTracks = localStream.getVideoTracks(); | |
const audioTracks = localStream.getAudioTracks(); | |
if (videoTracks.length > 0) { | |
console.log(`Using video device: ${videoTracks[0].label}`); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const configuration = getSelectedSdpSemantics(); | |
console.log('RTCPeerConnection configuration:', configuration); | |
pc1 = new RTCPeerConnection(configuration); | |
console.log('Created local peer connection object pc1'); | |
pc1.addEventListener('icecandidate', e => onIceCandidate(pc1, e)); | |
pc2 = new RTCPeerConnection(configuration); | |
console.log('Created remote peer connection object pc2'); | |
pc2.addEventListener('icecandidate', e => onIceCandidate(pc2, e)); | |
pc1.addEventListener('iceconnectionstatechange', e => onIceStateChange(pc1, e)); | |
pc2.addEventListener('iceconnectionstatechange', e => onIceStateChange(pc2, e)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hangup() { | |
console.log('Ending call'); | |
pc1.close(); | |
pc2.close(); | |
pc1 = null; | |
pc2 = null; | |
hangupButton.disabled = true; | |
callButton.disabled = false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var client = AgoraRTC.createClient(config); | |
function myfunction(){ | |
let handlefail = function(err){ | |
console.log("Error: ", err); | |
}; | |
let remotecontainer = document.getElementById("remote1"); | |
let remote_container = document.getElementById("remote2"); | |
let appid = document.getElementById("appid"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function logger() | |
{ | |
//initialize client | |
const client = AgoraRTM.createInstance(appid.value); | |
//check connection state | |
client.on('ConnectionStateChange', (newState, reason) => { | |
console.log('on connection state changed to ' + newState + ' reason: ' + reason); | |
}); |