Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chat_webview
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abookCommunication
chat_webview
Commits
3cb4cff1
Commit
3cb4cff1
authored
May 20, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
キャプチャー機能実装
parent
7857f5fa
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
144 additions
and
12 deletions
+144
-12
public_new/css/collaboration.css
+7
-0
public_new/js/language_en.js
+2
-1
public_new/js/language_ja.js
+4
-2
public_new/js/language_ko.js
+2
-1
public_new/js/share.js
+124
-8
public_new/template/template_open_collaboration_message.html
+5
-0
No files found.
public_new/css/collaboration.css
View file @
3cb4cff1
...
@@ -397,6 +397,13 @@
...
@@ -397,6 +397,13 @@
text-align
:
center
;
text-align
:
center
;
margin
:
0
5px
;
margin
:
0
5px
;
}
}
#captureRequestBtn
{
width
:
fit-content
!important
;
padding-left
:
10px
;
padding-right
:
10px
;
}
#collabo_footer_menu
.footer_menu_item
.img_wrap.wide
{
#collabo_footer_menu
.footer_menu_item
.img_wrap.wide
{
width
:
140px
;
width
:
140px
;
height
:
48px
;
height
:
48px
;
...
...
public_new/js/language_en.js
View file @
3cb4cff1
...
@@ -94,5 +94,6 @@ $.lang.en = {
...
@@ -94,5 +94,6 @@ $.lang.en = {
"notify_not_released"
:
"It will be released later."
,
"notify_not_released"
:
"It will be released later."
,
"error_empty_room_name"
:
"Please input room name."
,
"error_empty_room_name"
:
"Please input room name."
,
"inform_exit_host_collaboration"
:
"The host has terminated the collaboration."
,
"inform_exit_host_collaboration"
:
"The host has terminated the collaboration."
,
"request_capture"
:
" request Screen capture.(if you confirm this request, capture the screen and change the host)"
"request_capture"
:
" request Screen capture.(if you confirm this request, capture the screen and change the host)"
,
"host_change_notify"
:
"host changed to %@"
}
}
public_new/js/language_ja.js
View file @
3cb4cff1
...
@@ -94,5 +94,6 @@ $.lang.ja = {
...
@@ -94,5 +94,6 @@ $.lang.ja = {
"notify_not_released"
:
"今後リリース予定です。"
,
"notify_not_released"
:
"今後リリース予定です。"
,
"error_empty_room_name"
:
"ルーム名を入力してください。"
,
"error_empty_room_name"
:
"ルーム名を入力してください。"
,
"inform_exit_host_collaboration"
:
"ホストが協業を終了しました。"
,
"inform_exit_host_collaboration"
:
"ホストが協業を終了しました。"
,
"request_capture"
:
"様がキャプチャーをリクエストしました。(確認時画面をキャプチャーし、ホストを変更します。)"
"request_capture"
:
"様がキャプチャーをリクエストしました。(確認時画面をキャプチャーし、ホストを変更します。)"
,
}
"host_change_notify"
:
"ホストが%@様に変更されました。"
}
\ No newline at end of file
public_new/js/language_ko.js
View file @
3cb4cff1
...
@@ -94,5 +94,6 @@ $.lang.ko = {
...
@@ -94,5 +94,6 @@ $.lang.ko = {
"notify_not_released"
:
"추후 공개예정입니다."
,
"notify_not_released"
:
"추후 공개예정입니다."
,
"error_empty_room_name"
:
"룸명을 입력해주세요."
,
"error_empty_room_name"
:
"룸명을 입력해주세요."
,
"inform_exit_host_collaboration"
:
"호스트가 협업을 종료하였습니다."
,
"inform_exit_host_collaboration"
:
"호스트가 협업을 종료하였습니다."
,
"request_capture"
:
"님이 화면캡처를 요청하셨습니다.(확인시 화면을캡처하고 호스트를 변경합니다.)"
"request_capture"
:
"님이 화면캡처를 요청하셨습니다.(확인시 화면을캡처하고 호스트를 변경합니다.)"
,
"host_change_notify"
:
"호스트가 %@님으로 변경되었습니다."
}
}
public_new/js/share.js
View file @
3cb4cff1
...
@@ -138,25 +138,59 @@ $(function () {
...
@@ -138,25 +138,59 @@ $(function () {
}
}
joinMeetingId
=
data
.
payload
.
newMeetingId
;
joinMeetingId
=
data
.
payload
.
newMeetingId
;
}
}
}
}
else
if
(
data
.
type
===
"SHARE_FILE"
)
{
if
(
data
.
type
===
"SHARE_FILE"
)
{
if
(
joinCollaborationType
!=
collaborationType
.
CAMERA
)
{
if
(
joinCollaborationType
!=
collaborationType
.
CAMERA
)
{
initCollaborationUI
(
collaborationType
.
CAMERA
);
initCollaborationUI
(
collaborationType
.
CAMERA
);
joinCollaborationType
=
collaborationType
.
CAMERA
;
joinCollaborationType
=
collaborationType
.
CAMERA
;
fw
.
sendToMsg
(
'others'
,
'SHARE_FILE_HOST'
,
{
"collaborationType"
:
collaborationType
.
CAMERA
});
fw
.
sendToMsg
(
'others'
,
'SHARE_FILE_HOST'
,
{
"collaborationType"
:
collaborationType
.
CAMERA
});
}
}
}
}
else
if
(
data
.
type
===
"SHARE_FILE_HOST"
)
{
if
(
data
.
type
===
"SHARE_FILE_HOST"
)
{
if
(
joinCollaborationType
!=
collaborationType
.
CAMERA
&&
g_isMainMan
)
{
if
(
joinCollaborationType
!=
collaborationType
.
CAMERA
&&
g_isMainMan
)
{
initCollaborationUI
(
collaborationType
.
CAMERA
);
initCollaborationUI
(
collaborationType
.
CAMERA
);
joinCollaborationType
=
collaborationType
.
CAMERA
;
joinCollaborationType
=
collaborationType
.
CAMERA
;
}
}
}
}
else
if
(
data
.
type
===
"CAPTURE_REQUEST"
&&
g_isMainMan
)
{
if
(
data
.
type
===
"CAPTURE_REQUEST"
&&
g_isMainMan
)
{
if
(
confirm
(
data
.
payload
.
name
+
getLocalizedString
(
"request_capture"
)))
{
if
(
confirm
(
data
.
payload
.
name
+
getLocalizedString
(
"request_capture"
)))
{
c
oview_api
.
Capture
(
CMS_SERVER_URL
+
'/chatapi/file/uploadArchive'
);
c
aptureAndShareImage
(
CMS_SERVER_URL
+
'/chatapi/file/uploadArchive'
,
data
.
payload
.
name
);
}
}
}
else
if
(
data
.
type
===
"SEND_HOST_CHANGE_SIGNAL"
)
{
if
(
g_username
==
data
.
payload
.
name
){
fw
.
sendToMsg
(
'others'
,
'SEND_HOST_CHANGE_DONE_SIGNAL'
,
{
host
:
g_username
});
$
(
".coview_on_media_image_crown"
).
show
();
$
(
".coview_on_screen_btn.owner"
).
show
();
$
(
"#coviewShareMoreButton"
).
show
();
$
(
".coview_share_title_right_area"
).
show
();
g_isMainMan
=
true
;
g_isMainManUsername
=
g_username
;
//g_agentID = g_username;
options
.
constraints
=
{
audio
:
true
,
video
:
true
};
g_localStream
=
await
createLocalVideo
(
options
.
constraints
);
ChangeAgentStream
(
g_localStream
);
$
(
'[id^="video-"]'
).
css
(
'display'
,
'none'
);
SwitchMainVideoPosition
(
"agent"
);
$
(
"#localVideo"
).
show
();
$
(
"#remotes"
).
css
(
"z-index"
,
"0"
);
alert
(
getLocalizedString
(
'host_change_notify'
,
data
.
payload
.
name
));
}
}
else
if
(
data
.
type
===
"SEND_HOST_CHANGE_DONE_SIGNAL"
)
{
alert
(
getLocalizedString
(
'host_change_notify'
,
data
.
payload
.
host
));
$
(
".coview_on_media_image_crown"
).
hide
();
$
(
".coview_on_screen_btn.owner"
).
hide
();
$
(
".coview_share_title_right_area"
).
hide
();
$
(
"#localVideo"
).
hide
();
g_isMainMan
=
false
;
g_isMainManUsername
=
data
.
payload
.
host
;
var
remoteVideoElID
=
"video-"
+
g_isMainManUsername
;
$
(
'[id^="video-"]'
).
css
(
'display'
,
'none'
);
$
(
"#"
+
remoteVideoElID
).
removeAttr
(
'style'
);
$
(
"#"
+
remoteVideoElID
).
css
(
"width"
,
"100%"
);
$
(
"#"
+
remoteVideoElID
).
css
(
"height"
,
"100%"
);
$
(
"#"
+
remoteVideoElID
).
css
(
"position"
,
"absolute"
);
$
(
"#"
+
remoteVideoElID
).
css
(
"bottom"
,
"0px"
);
$
(
"#"
+
remoteVideoElID
).
css
(
"left"
,
"0px"
);
$
(
"#"
+
remoteVideoElID
).
css
(
"display"
,
""
);
$
(
".coview_memberList"
).
removeClass
(
"on"
);
$
(
".overlay"
).
removeClass
(
"active"
);
}
}
});
});
});
});
...
@@ -559,4 +593,85 @@ function hostSearchInterval() {
...
@@ -559,4 +593,85 @@ function hostSearchInterval() {
}
}
}
}
timeInterval
=
setInterval
(
hostSearch
,
2000
);
timeInterval
=
setInterval
(
hostSearch
,
2000
);
}
function
captureAndShareImage
(
urls
,
changeHostName
)
{
addCaptureEffect
();
$
(
this
).
removeClass
(
"on"
);
var
w
,
h
;
var
video
=
document
.
getElementById
(
"localVideo"
);
var
canvas
=
document
.
createElement
(
'canvas'
);
if
(
clientOrientaionState
==
1
){
canvas
.
width
=
w
=
680
;
canvas
.
height
=
h
=
515
;
}
else
{
canvas
.
width
=
w
=
386
;
canvas
.
height
=
h
=
515
;
}
if
(
canvas
.
getContext
)
{
var
ctx
=
canvas
.
getContext
(
'2d'
);
ctx
.
drawImage
(
video
,
0
,
0
,
w
,
h
);
ctx
.
drawImage
(
document
.
getElementById
(
"canvasRemote"
),
0
,
0
,
w
,
h
);
}
canvas
.
toBlob
(
function
(
blob
)
{
var
newImg
=
document
.
createElement
(
'img'
)
var
url
=
URL
.
createObjectURL
(
blob
);
canvasRemote
.
style
.
backgroundImage
=
"url('"
+
URL
.
createObjectURL
(
blob
)
+
"')"
;
canvasRemote
.
style
.
backgroundSize
=
"contain"
;
$
(
canvasRemote
).
attr
(
"height"
,
$
(
snapshots
[
cpatureViewIndex
]).
attr
(
"height"
));
$
(
canvasRemote
).
attr
(
"width"
,
$
(
snapshots
[
cpatureViewIndex
]).
attr
(
"width"
));
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"
)
)
{
var
h
=
$
(
".canvas_wrap"
).
css
(
"width"
).
replace
(
"px"
,
""
)
*
(
$
(
canvas
).
attr
(
"height"
)
/
$
(
canvas
).
attr
(
"width"
));
var
w
=
$
(
".canvas_wrap"
).
css
(
"width"
).
replace
(
"px"
,
""
);
$
(
canvasRemote
).
css
(
"height"
,
h
);
$
(
canvasRemote
).
css
(
"width"
,
w
);
$
(
canvasRemote
).
css
(
"margin-top"
,
(
-
h
/
2
));
$
(
canvasRemote
).
css
(
"margin-left"
,
(
-
w
/
2
));
}
else
{
var
h
=
$
(
".canvas_wrap"
).
css
(
"height"
).
replace
(
"px"
,
""
);
var
w
=
$
(
".canvas_wrap"
).
css
(
"height"
).
replace
(
"px"
,
""
)
/
(
$
(
canvas
).
attr
(
"height"
)
/
$
(
canvas
).
attr
(
"width"
));
$
(
canvasRemote
).
css
(
"height"
,
h
);
$
(
canvasRemote
).
css
(
"width"
,
w
);
$
(
canvasRemote
).
css
(
"margin-top"
,
(
-
h
/
2
));
$
(
canvasRemote
).
css
(
"margin-left"
,
(
-
w
/
2
));
}
$
(
".canvas_wrap"
).
css
(
"background-color"
,
"#000"
);
$
(
".clear_img"
).
show
();
SetShareMenuState
(
"on"
);
WithImageShareBtnState
(
"on"
);
//Fermi側にイメージ保存。
var
formData
=
new
FormData
();
var
uploadFileName
=
"capture_share_"
+
g_webroom
+
"_"
+
g_shareCount
+
".png"
g_shareCount
++
;
formData
.
append
(
"imgFile"
,
blob
,
uploadFileName
);
var
uploadUrl
=
location
.
protocol
+
"//"
+
location
.
hostname
+
":"
+
location
.
port
+
"/upload/create"
;
if
(
!
location
.
port
){
uploadUrl
=
location
.
protocol
+
"//"
+
location
.
hostname
+
"/upload/create"
;
}
$
.
ajax
({
type
:
'post'
,
url
:
g_coviewapiserverADDR
+
"/upload/create"
,
data
:
formData
,
processData
:
false
,
contentType
:
false
,
success
:
function
(
res
)
{
setTimeout
(
function
(){
SendFileShare
(
uploadFileName
);
$
(
"#coviewCaptureCtrBtn"
).
hide
();
$
(
"#coviewRecCtrBtn"
).
hide
();
$
(
".coview_share_title_name"
).
text
(
"LIVE(CAPTURE IMAGE)"
);
$
(
".coview_on_media_btn_back"
).
show
();
//アーカイブ保存。
ArchiveFileManage
(
blob
,
uploadFileName
,
urls
);
fw
.
sendToMsg
(
'others'
,
'SEND_HOST_CHANGE_SIGNAL'
,
{
"name"
:
changeHostName
});
},
1500
);
},
error
:
function
(
err
)
{
console
.
log
(
err
);
}
});
});
}
}
\ No newline at end of file
public_new/template/template_open_collaboration_message.html
View file @
3cb4cff1
...
@@ -29,7 +29,12 @@
...
@@ -29,7 +29,12 @@
<div
class=
"collabo_btn"
>
<div
class=
"collabo_btn"
>
<button
type=
"button"
name=
"button"
onclick=
"CHAT_UI.joinCollaboration({{collaborationType}}, {{meetingId}})"
{{#
isEnded
}}
disabled
{{/
isEnded
}}
>
<button
type=
"button"
name=
"button"
onclick=
"CHAT_UI.joinCollaboration({{collaborationType}}, {{meetingId}})"
{{#
isEnded
}}
disabled
{{/
isEnded
}}
>
<img
src=
"icon/icon_profile_phone.png"
alt=
"通話"
>
<img
src=
"icon/icon_profile_phone.png"
alt=
"通話"
>
{{#isEnded}}
<span>
終了しました
</span>
{{/isEnded}}
{{^isEnded}}
<span>
参加する
</span>
<span>
参加する
</span>
{{/isEnded}}
</button>
</button>
</div>
</div>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment