Commit 36acb182 by Kim Peace

Added some comments

parent 01e4b615
...@@ -164,6 +164,8 @@ CoviewBridge.bindMessageEvent = function () { ...@@ -164,6 +164,8 @@ CoviewBridge.bindMessageEvent = function () {
CollaborationFeature.didReceiveLoginResponseMessage = async function () { CollaborationFeature.didReceiveLoginResponseMessage = async function () {
try { try {
// check device has camera and mic
// esp, in ios, ask the permission for usermedia in everytime it use.
await navigator.mediaDevices.getUserMedia({ audio: true, video: true }); await navigator.mediaDevices.getUserMedia({ audio: true, video: true });
if ( if (
globalUserInfo.collaborationType == COLLABORATION_TYPE.CAMERA && globalUserInfo.collaborationType == COLLABORATION_TYPE.CAMERA &&
...@@ -174,6 +176,7 @@ CollaborationFeature.didReceiveLoginResponseMessage = async function () { ...@@ -174,6 +176,7 @@ CollaborationFeature.didReceiveLoginResponseMessage = async function () {
}, 100); }, 100);
} }
} catch (err) { } catch (err) {
// if the user denied the permission, it goes back to chat room
if (err.name == "NotAllowedError") { if (err.name == "NotAllowedError") {
CoviewBridge.exitCollaboration(); CoviewBridge.exitCollaboration();
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment