Commit d04302ed by Takatoshi Miura

#43125_host-change-record_レコード中にホスト変更すると新ホストでレコードできないバグを修正

parent 5ab391a4
......@@ -2,14 +2,14 @@
<div class="footer-wrap">
<div class="d-flex justify-content-around h-100">
<div class="footer_item">
<a href="#">
<a href="javascript:micTogle();">
<div class="img_wrap bg_red" id="micBtn">
<img src="icon/icon_voice_gray.png" alt="音声">
</div>
</a>
</div>
<div class="footer_item none host_contents">
<a href="#">
<a href="javascript:recordTogle();">
<div class="img_wrap bg_gray" id="recordBtn">
<img src="icon/icon_record.png" alt="録音">
</div>
......
......@@ -1867,9 +1867,6 @@ CHAT_UI.refreshArchiveDetailScreen = function(archiveId) {
// アーカイブ詳細取得
var archive = CHAT_DB.getArchiveDetail(archiveId);
// チャットルーム情報を取得
var roomId = archive.roomId;
//保存ユーザ情報を取得
var userInfo = CHAT_DB.getUserInfo(archive.saveUserId);
userInfo.profileUrl = CHAT.getProfileImgUrl(userInfo.profileUrl);
......
function recordStart() {
MainManRecord('on');
$('#recordBtn').removeClass('bg_gray');
$('#recordBtn').addClass('bg_red');
}
function recordStop(callback) {
// アーカイブ保存中は画面操作不可(協業終了,協業切り替え防止)
screenLock();
// アーカイブ保存処理
MainManRecordWithCollaboration('stop', CMS_SERVER_URL + '/chatapi/file/uploadArchive', callback);
}
function MainManRecordWithCollaboration(action, url, callback) {
mediaRecorder.stop();
console.log('Recorded Blobs: ', recordedBlobs);
setTimeout(function() {
console.log("Recoding File upload..");
const blob = new Blob(recordedBlobs, {type: 'video/webm'});
console.log(blob)
var uploadFileName = "record_" + g_webroom + "_" + g_shareCount + ".webm";
g_shareCount++;
var formData = new FormData();
formData.append("fileData",blob,uploadFileName);
formData.append('sid', globalUserInfo.sid);
formData.append('roomId', globalUserInfo.roomId);
if (joinCollaborationType == COLLABORATION_TYPE.VIDEO) {
formData.append('archiveType', 1);
} else {
formData.append('archiveType', 2);
}
console.log(uploadFileName)
$.ajax({
type :'post',
url,
data : formData,
contentType: false,
processData: false,
success : function(res) {
recordFinished();
callback();
console.log(res)
}
,error : function(err){
recordFinished();
callback();
console.log(err);
}
});
}, 1000);
}
function screenLock(){
// ロック用のdivを生成
var element = document.createElement('div');
element.id = "screenLock";
// ロック用のスタイル
element.style.height = '100%';
element.style.left = '0px';
element.style.position = 'fixed';
element.style.top = '0px';
element.style.width = '100%';
element.style.zIndex = '9999';
element.style.opacity = '0';
var objBody = document.getElementsByTagName("body").item(0);
objBody.appendChild(element);
}
// div削除関数
function delete_dom_obj(id_name) {
var dom_obj = document.getElementById(id_name);
var dom_obj_parent = dom_obj.parentNode;
dom_obj_parent.removeChild(dom_obj);
}
function recordFinished() {
$('#recordBtn').addClass('bg_gray');
$('#recordBtn').removeClass('bg_red');
// ロック画面の削除
delete_dom_obj('screenLock');
}
$(function () {
// メニューオーバーレイ表示
$(".menu_btn").click(function () {
......@@ -189,15 +103,6 @@ $(function () {
$('#coviewEraserCtrBtn').click();
})
$('#micBtn').click(function () {
$('#coviewMicCtrBtn').click();
if ($('#micBtn').hasClass('bg_red')) {
micOn();
} else {
micOff();
}
})
$('#captureBtn').click(function () {
if ($('#recordBtn').hasClass('bg_red')) {
screenLock();
......@@ -213,14 +118,6 @@ $(function () {
$('#captureRequestBtn').click(function () {
fw.sendToMsg('others', 'CAPTURE_REQUEST', {"name": CHAT.globalLoginParameter.loginId});
})
$('#recordBtn').click(function () {
if ($('#recordBtn').hasClass('bg_gray')) {
recordStart();
} else {
recordStop(null);
}
})
});
function penOff() {
......@@ -230,15 +127,3 @@ function penOff() {
$('#penBtn').removeClass('bg_blue');
}
};
function micOn() {
coview_api.MicMuteControl('off');
$('#micBtn').addClass('bg_blue');
$('#micBtn').removeClass('bg_red');
};
function micOff() {
coview_api.MicMuteControl('on');
$('#micBtn').removeClass('bg_blue');
$('#micBtn').addClass('bg_red');
};
......@@ -188,7 +188,13 @@ $(function () {
}
} else if (data.type === "API_SEND_OWNER_CHANGE_COMPLETE") {
if ($('#recordBtn').hasClass('bg_red')) {
recordStop(penOff);
console.log("レコードを終了処理開始");
screenLock();
recordStop(function() {
penOff();
$('#screenLock').remove();
console.log("レコードを終了しました");
});
} else {
penOff();
}
......@@ -434,7 +440,9 @@ function changeCollaboration(changeCollaborationType) {
}
joinCollaborationType = changeCollaborationType;
if ($('#recordBtn').hasClass('bg_red')) {
recordStop(null);
recordStop(function() {
console.log("レコードを終了しました");
});
}
initCollaborationUI(changeCollaborationType);
switch (changeCollaborationType) {
......@@ -800,3 +808,120 @@ function captureAndShareImage(urls, changeHostName) {
});
});
}
function micOn() {
coview_api.MicMuteControl('off');
$('#micBtn').addClass('bg_blue');
$('#micBtn').removeClass('bg_red');
};
function micOff() {
coview_api.MicMuteControl('on');
$('#micBtn').removeClass('bg_blue');
$('#micBtn').addClass('bg_red');
};
function micTogle() {
$('#coviewMicCtrBtn').click();
if ($('#micBtn').hasClass('bg_red')) {
micOn();
} else {
micOff();
}
};
function recordStart() {
MainManRecord('on');
$('#recordBtn').removeClass('bg_gray');
$('#recordBtn').addClass('bg_red');
};
function recordFinished() {
$('#recordBtn').addClass('bg_gray');
$('#recordBtn').removeClass('bg_red');
// ロック画面の削除
delete_dom_obj('screenLock');
};
function recordTogle() {
if ($('#recordBtn').hasClass('bg_gray')) {
recordStart();
} else {
recordStop(function() {
console.log("レコードを終了しました");
});
}
};
function recordStop(callback) {
// アーカイブ保存中は画面操作不可(協業終了,協業切り替え防止)
screenLock();
// アーカイブ保存処理
MainManRecordWithCollaboration('stop', CMS_SERVER_URL + '/chatapi/file/uploadArchive', callback);
}
function MainManRecordWithCollaboration(action, url, callback) {
mediaRecorder.stop();
console.log('Recorded Blobs: ', recordedBlobs);
setTimeout(function() {
console.log("Recoding File upload..");
const blob = new Blob(recordedBlobs, {type: 'video/webm'});
console.log(blob)
var uploadFileName = "record_" + g_webroom + "_" + g_shareCount + ".webm";
g_shareCount++;
var formData = new FormData();
formData.append("fileData",blob,uploadFileName);
formData.append('sid', globalUserInfo.sid);
formData.append('roomId', globalUserInfo.roomId);
if (joinCollaborationType == COLLABORATION_TYPE.VIDEO) {
formData.append('archiveType', 1);
} else {
formData.append('archiveType', 2);
}
console.log(uploadFileName)
$.ajax({
type :'post',
url,
data : formData,
contentType: false,
processData: false,
success : function(res) {
recordFinished();
console.log(res);
callback();
}
,error : function(err){
recordFinished();
console.log(err);
callback();
}
});
}, 1000);
}
function screenLock(){
// ロック用のdivを生成
var element = document.createElement('div');
element.id = "screenLock";
// ロック用のスタイル
element.style.height = '100%';
element.style.left = '0px';
element.style.position = 'fixed';
element.style.top = '0px';
element.style.width = '100%';
element.style.zIndex = '9999';
element.style.opacity = '0';
var objBody = document.getElementsByTagName("body").item(0);
objBody.appendChild(element);
}
// div削除関数
function delete_dom_obj(id_name) {
var dom_obj = document.getElementById(id_name);
var dom_obj_parent = dom_obj.parentNode;
dom_obj_parent.removeChild(dom_obj);
}
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