Commit 6f3fe281 by Lee Munkyeong

コードレビュー対応。

parent 3cb4cff1
...@@ -154,7 +154,7 @@ $(function () { ...@@ -154,7 +154,7 @@ $(function () {
captureAndShareImage(CMS_SERVER_URL + '/chatapi/file/uploadArchive', data.payload.name); captureAndShareImage(CMS_SERVER_URL + '/chatapi/file/uploadArchive', data.payload.name);
} }
} else if (data.type === "SEND_HOST_CHANGE_SIGNAL") { } else if (data.type === "SEND_HOST_CHANGE_SIGNAL") {
if(g_username == data.payload.name){ if (g_username == data.payload.name) {
fw.sendToMsg('others', 'SEND_HOST_CHANGE_DONE_SIGNAL', {host: g_username}); fw.sendToMsg('others', 'SEND_HOST_CHANGE_DONE_SIGNAL', {host: g_username});
$(".coview_on_media_image_crown").show(); $(".coview_on_media_image_crown").show();
$(".coview_on_screen_btn.owner").show(); $(".coview_on_screen_btn.owner").show();
...@@ -162,12 +162,11 @@ $(function () { ...@@ -162,12 +162,11 @@ $(function () {
$(".coview_share_title_right_area").show(); $(".coview_share_title_right_area").show();
g_isMainMan = true; g_isMainMan = true;
g_isMainManUsername = g_username; g_isMainManUsername = g_username;
//g_agentID = g_username;
options.constraints = { audio: true, video: true }; options.constraints = { audio: true, video: true };
g_localStream = await createLocalVideo (options.constraints); g_localStream = await createLocalVideo (options.constraints);
ChangeAgentStream(g_localStream); ChangeAgentStream(g_localStream);
$('[id^="video-"]').css('display','none'); $('[id^="video-"]').css('display','none');
SwitchMainVideoPosition("agent"); SwitchMainVideoPosition("agent");
$("#localVideo").show(); $("#localVideo").show();
$("#remotes").css("z-index", "0"); $("#remotes").css("z-index", "0");
alert(getLocalizedString('host_change_notify', data.payload.name)); alert(getLocalizedString('host_change_notify', data.payload.name));
...@@ -601,7 +600,7 @@ function captureAndShareImage(urls, changeHostName) { ...@@ -601,7 +600,7 @@ function captureAndShareImage(urls, changeHostName) {
var w,h; var w,h;
var video = document.getElementById("localVideo"); var video = document.getElementById("localVideo");
var canvas = document.createElement('canvas'); var canvas = document.createElement('canvas');
if(clientOrientaionState == 1){ if (clientOrientaionState == 1) {
canvas.width = w = 680; canvas.width = w = 680;
canvas.height = h = 515; canvas.height = h = 515;
} else { } else {
...@@ -621,7 +620,7 @@ function captureAndShareImage(urls, changeHostName) { ...@@ -621,7 +620,7 @@ function captureAndShareImage(urls, changeHostName) {
$(canvasRemote).attr("height", $(snapshots[cpatureViewIndex]).attr("height")); $(canvasRemote).attr("height", $(snapshots[cpatureViewIndex]).attr("height"));
$(canvasRemote).attr("width", $(snapshots[cpatureViewIndex]).attr("width")); $(canvasRemote).attr("width", $(snapshots[cpatureViewIndex]).attr("width"));
console.log ('url', URL.createObjectURL(blob)); console.log ('url', URL.createObjectURL(blob));
if ( $(".canvas_wrap").css("width").replace("px","") / $(".canvas_wrap").css("height").replace("px","") < $(canvas).attr("width") / $(canvas).attr("height") ) { if ($(".canvas_wrap").css("width").replace("px","") / $(".canvas_wrap").css("height").replace("px","") < $(canvas).attr("width") / $(canvas).attr("height")) {
var h = $(".canvas_wrap").css("width").replace("px","") * ($(canvas).attr("height") / $(canvas).attr("width")); var h = $(".canvas_wrap").css("width").replace("px","") * ($(canvas).attr("height") / $(canvas).attr("width"));
var w = $(".canvas_wrap").css("width").replace("px",""); var w = $(".canvas_wrap").css("width").replace("px","");
$(canvasRemote).css("height", h); $(canvasRemote).css("height", h);
...@@ -648,7 +647,7 @@ function captureAndShareImage(urls, changeHostName) { ...@@ -648,7 +647,7 @@ function captureAndShareImage(urls, changeHostName) {
formData.append("imgFile", blob, uploadFileName); formData.append("imgFile", blob, uploadFileName);
var uploadUrl = location.protocol + "//" + location.hostname + ":" + location.port + "/upload/create"; var uploadUrl = location.protocol + "//" + location.hostname + ":" + location.port + "/upload/create";
if(!location.port){ if (!location.port) {
uploadUrl = location.protocol + "//" + location.hostname + "/upload/create"; uploadUrl = location.protocol + "//" + location.hostname + "/upload/create";
} }
$.ajax({ $.ajax({
...@@ -657,8 +656,8 @@ function captureAndShareImage(urls, changeHostName) { ...@@ -657,8 +656,8 @@ function captureAndShareImage(urls, changeHostName) {
data: formData, data: formData,
processData: false, processData: false,
contentType: false, contentType: false,
success: function (res) { success: function(res) {
setTimeout(function(){ setTimeout(function() {
SendFileShare(uploadFileName); SendFileShare(uploadFileName);
$("#coviewCaptureCtrBtn").hide(); $("#coviewCaptureCtrBtn").hide();
$("#coviewRecCtrBtn").hide(); $("#coviewRecCtrBtn").hide();
...@@ -669,7 +668,7 @@ function captureAndShareImage(urls, changeHostName) { ...@@ -669,7 +668,7 @@ function captureAndShareImage(urls, changeHostName) {
fw.sendToMsg('others', 'SEND_HOST_CHANGE_SIGNAL', {"name": changeHostName}); fw.sendToMsg('others', 'SEND_HOST_CHANGE_SIGNAL', {"name": changeHostName});
}, 1500); }, 1500);
}, },
error: function (err) { error: function(err) {
console.log(err); console.log(err);
} }
}); });
......
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