Commit 1e972aaf by Kim Peace

Fixed exit collaborations

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