Commit 0e1d21de by Takatoshi Miura

#42990#43004_saveArchive_レコード中の協業終了時、長時間レコード時にアーカイブに保存されないバグを修正

parent 15ff2894
......@@ -4,10 +4,80 @@ function recordStart() {
$('#recordBtn').addClass('bg_red');
}
function recordStop() {
MainManRecord('stop', CMS_SERVER_URL + '/chatapi/file/uploadArchive');
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);
formData.append('archiveType', 1);
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 () {
......@@ -138,7 +208,7 @@ $(function () {
if ($('#recordBtn').hasClass('bg_gray')) {
recordStart();
} else {
recordStop();
recordStop(null);
}
})
});
......
......@@ -178,9 +178,10 @@ $(function () {
}
} else if (data.type === "API_SEND_OWNER_CHANGE_COMPLETE") {
if ($('#recordBtn').hasClass('bg_red')) {
recordStop();
}
recordStop(penOff);
} else {
penOff();
}
} else if (data.type === "CHANGE_HOST_APPLY") {
if (CHAT_UTIL.isAndroid()) {
android.setHostRequestFlg(HOST_REQUEST_FLG.DOING);
......@@ -412,7 +413,7 @@ function changeCollaboration(changeCollaborationType) {
}
joinCollaborationType = changeCollaborationType;
if ($('#recordBtn').hasClass('bg_red')) {
recordStop();
recordStop(null);
}
initCollaborationUI(changeCollaborationType);
switch (changeCollaborationType) {
......@@ -523,8 +524,13 @@ function Coview_exitCollaboration(isDocument = false) {
}
}
if ($('#recordBtn').hasClass('bg_red')) {
recordStop();
recordStop(Coview_finishCollaboration);
} else {
Coview_finishCollaboration();
}
}
function Coview_finishCollaboration() {
clearInterval(timeInterval);
coview_api.LeaveRoom();
if (coview_api.getRoomUsers()) {
......
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