Commit 40d72c94 by Takatoshi Miura

コード整理

parent bc4fd237
......@@ -184,7 +184,7 @@ $(function () {
);
if (isDocument) {
if (CHAT_UTIL.isIOS()) {
//TODO 画面を縮小し、会議室に入場する処理
meetingId = CHAT_DB.createContentView();
} else if (CHAT_UTIL.isAndroid()) {
meetingId = android.createContentView();
}
......@@ -193,140 +193,6 @@ $(function () {
coview_api.JoinRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
}
Coview_moveToVideoShareArea();
<<<<<<< HEAD
$(".coview_share_title_name").text("LIVE");
});
// $("#coviewShareDoc").on("click", function(){
// console.log("ON click coviewShareDoc");
// alert("INTO a document share mode (only audio)");
// globalUserInfo.coWorkType = "audio";
// });
coview_api.addEventListener ("ready", function () {
console.log("=============> READY : ready for coview api");
Coview_addLoginId(globalUserInfo.loginId);
coview_api.Login(globalUserInfo.loginId);
});
coview_api.addEventListener ("start", function () {
console.log("=============> START : share start");
$("#loadingIndicator").removeClass("full_active");
});
coview_api.addEventListener ("allbye", function () {
console.log("=============> ALL BYE : share allbye");
$("#loadingIndicator").removeClass("full_active");
});
coview_api.addEventListener ("guestbye", function () {
console.log("=============> GUEST BYE : share guestbye");
$("#loadingIndicator").removeClass("full_active");
});
coview_api.addEventListener ("hostbye", function () {
console.log("=============> HOST BYE : share hostbye");
alert(getLocalizedString("inform_exit_host_collaboration"));
Coview_exitCollaboration();
$("#loadingIndicator").removeClass("full_active");
});
coview_api.addEventListener ("destroy", function () {
console.log("=============> DESTROY : share destroy");
coview_api.LeaveRoom();
$(".coview_share_area").hide();
$("#loadingIndicator").removeClass("full_active");
});
var meetingId;
coview_api.addEventListener ("message", async function (event, json) {
console.log("+++ addEventListener", json);
console.log("processMessage api = ", json.api);
if (isLeaved) return;
let loginIdList = new Array();
switch (json.api){
case "LoginResponse":
console.log('------------------------------');
console.log(globalUserInfo.coWorkType);
console.log(collaborationJoinFlg);
if (globalUserInfo.coWorkType == collaborationTypeKey.DOCUMENT) {
isDocument = true;
globalUserInfo.coWorkType = collaborationTypeKey.AUDIO;
}
if (collaborationJoinFlg == '1') {
coview_api.JoinRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
if (isDocument) {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.startContentView.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
android.startContentView();
}
}
} else if (collaborationJoinFlg == '0') {
coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
if (isDocument) {
if (CHAT_UTIL.isIOS()) {
meetingId = CHAT_DB.createContentView();
} else if (CHAT_UTIL.isAndroid()) {
meetingId = android.createContentView();
}
}
} else if (collaborationJoinFlg == '2') {
coview_api.JoinRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
}
Coview_moveToVideoShareArea();
break;
case "CreateRoomResponse":
if (json.resultCode == 200) {
var coviewInviteMessage;
if (isDocument) {
coviewInviteMessage = "" + messageSeperator + messageType.COMMUNICATIONSTART + messageSeperator + CHAT_UTIL.getCollaborationType(collaborationTypeKey.DOCUMENT) + messageSeperator + meetingId;
} else {
coviewInviteMessage = "" + messageSeperator + messageType.COMMUNICATIONSTART + messageSeperator + CHAT_UTIL.getCollaborationType(globalUserInfo.coWorkType);
}
socket.emit('createMessage', {
text: coviewInviteMessage
}, 0);
} else {
}
break;
case "JoinRoomInfoResponse":
if (json.resultCode == 200) {
} else {
alert("Not exist sharing call (" + json.resultCode + ")\nPlease using share menu.");
coview_api.LeaveRoom();
$(".coview_share_area").hide();
$("#loadingIndicator").removeClass("full_active");
}
break;
case "JoinRoomResponse":
if (json.resultCode == 200) {
for (let key in g_participants) {
loginIdList.push(key);
}
CHAT_UI.refreshJoinedCollaboration(loginIdList);
} else {
}
break;
case "RoomMemberJoinedEvent":
for (let key in g_participants) {
loginIdList.push(key);
}
CHAT_UI.refreshJoinedCollaboration(loginIdList);
break;
case "RoomMemberLeavedEvent":
for (let key in g_participants) {
loginIdList.push(key);
}
CHAT_UI.refreshJoinedCollaboration(loginIdList);
break;
default:
console.log('Unrecognized api', json);
break;
}
});
=======
break;
case "CreateRoomResponse":
if (json.resultCode == 200) {
......@@ -402,7 +268,6 @@ $(function () {
break;
}
});
>>>>>>> 4f062177e60f67d0fa536858ff5e5c966cbb8997
});
function Coview_shareDropdownHide() {
......@@ -417,20 +282,11 @@ function Coview_moveToVideoShareArea() {
}
function Coview_exitCollaboration(isDocument = false) {
<<<<<<< HEAD
if (isDocument) {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.exitMeetingRoom.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
android.exitMeetingRoom();
}
=======
if (isDocument) {
if (CHAT_UTIL.isIOS()) {
//TODO IOS会議室退場処理
webkit.messageHandlers.exitMeetingRoom.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
android.exitMeetingRoom();
>>>>>>> 4f062177e60f67d0fa536858ff5e5c966cbb8997
android.exitMeetingRoom();
}
}
coview_api.LeaveRoom();
......
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