Commit 1e972aaf by Kim Peace

Fixed exit collaborations

parent 207cdfab
......@@ -48,7 +48,6 @@
<div class="menu-bar menu-bar2"></div>
<div class="menu-bar menu-bar3"></div>
</div>
<!-- <button type="button" name="button" class="btn exit_btn" onclick="CoviewBridge.exitCollaboration();"></button> -->
</div>
</div>
</div>
......
......@@ -29,7 +29,6 @@
<button type="button" name="button" class="btn user_btn"></button>
<button type="button" name="button" class="btn menu_btn"></button>
<button type="button" name="button" class="btn add_user_btn none"></button>
<!-- <button type="button" name="button" class="btn exit_btn" onclick="CoviewBridge.exitCollaboration();"></button> -->
</div>
</div>
</div>
......
......@@ -32,7 +32,6 @@
<div class="menu-bar menu-bar2"></div>
<div class="menu-bar menu-bar3"></div>
</div>
<!-- <button type="button" name="button" class="btn exit_btn" onclick="CoviewBridge.exitCollaboration();"></button> -->
</div>
</div>
</div>
......
......@@ -28,7 +28,6 @@
<button type="button" name="button" class="btn user_btn"></button>
<button type="button" name="button" class="btn add_user_btn none"></button>
<button type="button" name="button" class="btn menu_btn"></button>
<!-- <button type="button" name="button" class="btn exit_btn" onclick="CoviewBridge.exitCollaboration();"></button> -->
</div>
</div>
</div>
......
......@@ -39,8 +39,6 @@ $(".home_btn").on("click", function () {
});
document.addEventListener("DOMContentLoaded", function () {
var h = $(window).height(); //画面の高さを取得
// ローディング表示
$("footer a").click(function (event) {
const a = $(this);
......
......@@ -69,7 +69,7 @@ FermiWebSocketMessageHandler.handleMessagesToAll = function (data) {
}
break;
case "API_SEND_OWNER_CHANGE_COMPLETE":
FermiWebSocketMessageHandler.apiSendOwnerChangeComplete();
FermiWebSocketMessageHandler.apiSendOwnerChangeComplete(data);
break;
case "API_SEND_OWNER_CHANGE_CONFIRM":
if (globalUserInfo.collaborationType == COLLABORATION_TYPE.CAMERA) {
......@@ -198,7 +198,7 @@ FermiWebSocketMessageHandler.pipEndRequest = function () {
};
// API_SEND_OWNER_CHANGE_COMPLETE
FermiWebSocketMessageHandler.apiSendOwnerChangeComplete = function () {
FermiWebSocketMessageHandler.apiSendOwnerChangeComplete = function (data) {
penOff();
if ($("#recordBtn .record").hasClass("disable")) {
recordStop(function () {});
......
......@@ -121,7 +121,7 @@ CoviewBridge.bindMessageEvent = function () {
if (json.resultCode != 200) {
break;
}
CollaborationFeature.searchHostIntervally();
CollaborationFeature.updateHost();
// fall through
case "RoomMemberJoinedEvent":
// fall through
......@@ -162,8 +162,6 @@ CoviewBridge.bindMessageEvent = function () {
};
CollaborationFeature.didReceiveLoginResponseMessage = async function () {
CollaborationFeature.searchHostIntervally();
const isDocument =
globalUserInfo.collaborationType == COLLABORATION_TYPE.DOCUMENT;
const isAttendee =
......@@ -187,7 +185,9 @@ CollaborationFeature.didReceiveLoginResponseMessage = async function () {
case COLLABORATION_JOIN_TYPE.INVITED:
// fall through
case COLLABORATION_JOIN_TYPE.ATTENDEE:
// TODO:: here to update host
coview_api.JoinRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
break;
case COLLABORATION_JOIN_TYPE.HOST:
let deleteRoomResult = JSON.parse(
......@@ -201,7 +201,7 @@ CollaborationFeature.didReceiveLoginResponseMessage = async function () {
default:
break;
}
CollaborationFeature.updateHost();
CollaborationUI.moveToVideoShareArea();
};
......@@ -252,26 +252,18 @@ CoviewBridge.addLoginID = function (loginID) {
});
};
CollaborationFeature.searchHostIntervally = function () {
let hostName = "";
function searchHost() {
CollaborationFeature.updateHost = function () {
if (g_isMainMan) {
CollaborationUI.showHostButtons();
} else {
CollaborationUI.hideHostButtons();
}
CollaborationUI.showHostMark(hostName);
if (hostName != g_isMainManUsername) {
hostName = g_isMainManUsername;
}
}
timeInterval = setInterval(searchHost, 2000);
CollaborationUI.showHostMark(g_isMainManUsername);
};
CollaborationUI.showHostButtons = function () {
$("#collaboration_user_" + currentUserInfo.loginID).addClass("host");
$(".host_contents").removeClass("none");
if (globalUserInfo.collaborationType == COLLABORATION_TYPE.CAMERA) {
$(".photo_select_button").removeClass("none");
......@@ -283,7 +275,7 @@ CollaborationUI.showHostButtons = function () {
};
CollaborationUI.hideHostButtons = function () {
$("#collaboration_user_" + currentUserInfo.loginID).removeClass("host");
$(".host_contents").addClass("none");
if (globalUserInfo.collaborationType == COLLABORATION_TYPE.CAMERA) {
$(".photo_select_button").addClass("none");
......@@ -304,13 +296,7 @@ CollaborationUI.showHostMark = function (hostName) {
const replacedMainManUserID = $(
"#collaboration_user_" + getReplacedLoginId(g_isMainManUsername)
);
if (hostName != g_isMainManUsername) {
if (hostName != "") {
replaceHostIDDiv.removeClass("host");
}
replacedMainManUserID.addClass("host");
return;
}
if (hostName == "") {
if (!currentUserLoginIDDiv.hasClass("host") && coview_api.getRoomUsers()) {
currentUserLoginIDDiv.addClass("host");
......@@ -436,9 +422,7 @@ CoviewBridge.exitCollaboration = function () {
};
CoviewBridge.finishCollaboration = function () {
clearInterval(timeInterval);
coview_api.LeaveRoom();
NativeBridgeDelegate.finishCollaboration(true);
if (coview_api.getRoomUsers()) {
NativeBridgeDelegate.finishCollaboration();
}
......
......@@ -3,7 +3,6 @@
/* --------------------------------------------------- */
let coview_api = new CoviewApi();
var isBoard = false;
let timeInterval = null;
var backgroundFileName;
document.addEventListener("DOMContentLoaded", function () {
......
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