Error messages
Error getting local media stream: MEDIA_ERR
easyrtc.enableVideo(true);
easyrtc.enableVideo(true); //if I want video, or
easyrtc.setScreenCapture(); //if I want screen sharing.
easyrtc.setOption("demosEnable",false);
easyrtc.easyApp(
"MyApp",
"selfVideo",
videoIds,
loginSuccess,
loginFailure);
easyrtc.setAcceptChecker(acceptCheckP2P);
function acceptCheckP2P(caller, cb) {
document.getElementById('acceptCallBox').style.display = "block";
document.getElementById('acceptCallLabel').innerHTML = "Accept call from " + easyrtc.idToName(caller) + " ?";
//Handler for decision.
var acceptTheCall = function(wasAccepted) {
//call accepted
if(wasAccepted){
enable('hangupButton');
document.getElementById(talkingTo).className="connected";
}
//hang up other calls
if( wasAccepted && easyrtc.getConnectionCount() > 0 ) {
easyrtc.hangupAll();
}
document.getElementById('acceptCallBox').style.display = "none";
cb(wasAccepted);
};
document.getElementById("callAcceptButton").onclick = function() {
acceptTheCall(true);
};
document.getElementById("callRejectButton").onclick =function() {
acceptTheCall(false);
};
}
function connect() {
easyrtc.enableAudio(false);
easyrtc.enableVideo(false);
easyrtc.setScreenCapture();
easyrtc.easyApp(
"MyApp",
"selfVideo",
videoIds,
loginSuccess,
loginFailure);
easyrtc.enableDataChannels(true);
easyrtc.setRoomOccupantListener(convertListToButtons);
easyrtc.setAcceptChecker(acceptCheckP2P);
}
function loginSuccess(easyrtcId) {
updateConnectedToRoomAndStatus("default");
easyrtc.getRoomList(convertRoomsToList, errorList);
easyrtc.setDisconnectListener(function(){
easyrtc.showError("SYSTEM-ERROR", "Se perdió la conexión al socket server");
});
//enable receiving files
easyrtc_ft.buildFileReceiver(acceptRejectCB, blobAcceptor, receiveStatusCB);
}
function loginFailure(errorCode, message) {
var reloadPage = setTimeout(function(){document.location.reload(false)},2000);
console.log("Failed to connect. errorCode: "+errorCode+"\n message: "+message);
}
easyrtc.onError = function(errorObject) {
console.log("I am into onError conferencias");
console.log(errorObject.errorText);
};
setTimeout(function () {
try {
firstCallTime = getCurrentTime();
getUserMedia(mode, onUserMediaSuccess, tryAgain);
} catch (e) {
tryAgain(e);
}
setTimeout(function () {
try {
firstCallTime = getCurrentTime();
if (easyrtc.screenSharing) { // ------------------- screen sharing condition ----------------------
getScreenId(function (error, sourceId, screen_constraints) {
// error == null || 'permission-denied' || 'not-installed' || 'installed-disabled' || 'not-chrome'
// sourceId == null || 'string'
screen_constraints = {
video: {
mandatory: {
chromeMediaSource: 'screen',
maxWidth: 1920,
maxHeight: 1080,
minAspectRatio: 1.77
}
}
};
if (error === 'permission-denied') return alert('Permission is denied.');
if (error === 'not-chrome') return alert('Please use chrome.');
if (!error && sourceId) {
screen_constraints.video.mandatory.chromeMediaSource = 'desktop';
screen_constraints.video.mandatory.chromeMediaSourceId = sourceId;
}
getUserMedia(screen_constraints, onUserMediaSuccess, function (error) {
console.error(error);
});
});
} else {
getUserMedia(mode, onUserMediaSuccess, tryAgain);
}
} catch (e) {
tryAgain(e);
}
try {
if (sdpRemoteFilter) {
sd.sdp = sdpRemoteFilter(sd.sdp);
}
pc.setRemoteDescription(sd, invokeCreateAnswer, function (message) {
self.showError(self.errCodes.INTERNAL_ERR, "set-remote-description: " + message);
});
} catch (srdError) {
console.log("set remote description failed");
if (self.debugPrinter) {
self.debugPrinter("saw exception in setRemoteDescription");
}
self.showError(self.errCodes.INTERNAL_ERR, "setRemoteDescription failed: " + srdError.message);
}
Please, check the problem and it would be nice if you could implement this solution. Maybe, as another function that can be modified externally.
We still have to have the option for own extention, as I mentioned in the previous post.
Thanks,
Tolik