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
5903e9b8
Commit
5903e9b8
authored
Mar 10, 2021
by
Takatoshi Miura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fermi製コード追加
parent
7cc4d958
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
200 additions
and
0 deletions
+200
-0
public/index.html
+2
-0
public/js/share.js
+198
-0
No files found.
public/index.html
View file @
5903e9b8
...
...
@@ -530,6 +530,8 @@
<script
src=
"./js/chat-util.js"
></script>
<script
src=
"./js/chat-db.js"
></script>
<script
src=
"./js/chat-websocket.js"
></script>
<script
src=
"https://app.coview.co.kr:7443/coview_api.js"
></script>
<script
src=
"./js/share.js"
></script>
</body>
<script>
jQuery
(
'#homeButton'
).
on
(
'click'
,
function
()
{
...
...
public/js/share.js
0 → 100644
View file @
5903e9b8
/* --------------------------------------------------- */
/* Functions */
/* --------------------------------------------------- */
let
coview_api
=
new
CoviewApi
();
$
(
function
(){
var
coviewApiActive
=
coview_api
.
Init
(
{
testSTRParam
:
"param1"
,
testNUMParam
:
77
,
testBOOLParam
:
false
,
coview_api_srv_addr
:
"https://app.coview.co.kr:7443"
,
coview_wrap_id
:
"coviewShare"
,
}
);
// special button IN Chat ui
$
(
"#coviewShareMainBtn"
).
on
(
"click"
,
function
(
e
){
e
.
stopPropagation
();
if
(
$
(
".coview_share_dropdown_bar"
).
is
(
':visible'
)
==
true
){
Coview_shareDropdownHide
();
if
(
$
(
".coview_share_photo_select_bubble"
).
is
(
':visible'
)
==
true
){
$
(
".coview_share_photo_select_bubble"
).
slideUp
();
}
}
else
{
$
(
".coview_share_dropdown_bar"
).
slideDown
();
}
});
$
(
"#coviewShareCloseButton"
).
on
(
"click"
,
function
(
e
){
coview_api
.
LeaveRoom
();
$
(
".coview_share_area"
).
hide
();
});
$
(
"body"
).
on
(
"click"
,
function
(){
Coview_shareDropdownHide
();
});
$
(
document
).
on
(
"click"
,
".coview_share_request"
,
function
(){
console
.
log
(
"globalUserInfo"
,
globalUserInfo
);
if
(
$
(
this
).
hasClass
(
"video"
)
==
true
){
globalUserInfo
.
coWorkType
=
"video"
;
$
(
".coview_share_title_name"
).
text
(
"LIVE"
);
}
else
{
globalUserInfo
.
coWorkType
=
"image"
;
$
(
".coview_share_title_name"
).
text
(
"IMAGE"
);
}
coview_api
.
JoinRoom
(
globalUserInfo
.
roomId
,
globalUserInfo
.
coWorkType
);
Coview_moveToVideoShareArea
();
});
// $('#coviewShareRequestVideo').bind('click', function()
// console.log("globalUserInfo", globalUserInfo);
// globalUserInfo.coWorkType = "video";
// coview_api.JoinRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
// });
/* --------------------------------------------------- */
/* Video, photo, chat, doc */
/* --------------------------------------------------- */
$
(
"#coviewShareChat"
).
on
(
"click"
,
function
(){
console
.
log
(
"ON click coviewShareChat"
);
});
$
(
"#coviewSharePhoto"
).
on
(
"click"
,
function
(
e
){
e
.
stopPropagation
();
console
.
log
(
"ON click coviewSharePhoto"
);
if
(
$
(
".coview_share_photo_select_bubble"
).
is
(
':visible'
)
==
true
){
$
(
".coview_share_photo_select_bubble"
).
slideUp
();
}
else
{
$
(
".coview_share_photo_select_bubble"
).
slideDown
();
}
});
$
(
"#coviewSharePhotoCamera"
).
on
(
"click"
,
function
(){
$
(
".coview_share_photo_select_bubble"
).
hide
();
globalUserInfo
.
coWorkType
=
"camera"
;
coview_api
.
CreateRoom
(
globalUserInfo
.
roomId
,
globalUserInfo
.
coWorkType
);
Coview_moveToVideoShareArea
();
$
(
".coview_share_title_name"
).
text
(
"カメラ"
);
});
$
(
"#coviewSharePhotoGalary"
).
on
(
"click"
,
function
(){
$
(
".coview_share_photo_select_bubble"
).
hide
();
globalUserInfo
.
coWorkType
=
"galary"
;
coview_api
.
CreateRoom
(
globalUserInfo
.
roomId
,
globalUserInfo
.
coWorkType
);
Coview_moveToVideoShareArea
();
$
(
".coview_share_title_name"
).
text
(
"ライブラリ"
);
});
$
(
"#coviewShareLive"
).
on
(
"click"
,
function
(){
console
.
log
(
"ON click coviewShareLive"
);
globalUserInfo
.
coWorkType
=
"video"
;
console
.
log
(
"globalUserInfo"
,
globalUserInfo
);
// var chars = "0123456789";
// var string_length = 6;
// var randomstring = '';
// for (var i=0; i<string_length; i++) {
// var rnum = Math.floor(Math.random() * chars.length);
// randomstring += chars.substring(rnum,rnum+1);
// }
// coview_api.CreateRoom(randomstring, globalUserInfo.coWorkType);
coview_api
.
CreateRoom
(
globalUserInfo
.
roomId
,
globalUserInfo
.
coWorkType
);
Coview_moveToVideoShareArea
();
$
(
".coview_share_title_name"
).
text
(
"LIVE"
);
});
$
(
"#coviewShareDoc"
).
on
(
"click"
,
function
(){
console
.
log
(
"ON click coviewShareDoc"
);
alert
(
"INTO a document share mode (only audio)"
);
globalUserInfo
.
coWorkType
=
"audio"
;
});
coview_api
.
addEventListener
(
"ready"
,
function
()
{
console
.
log
(
"=============> READY : ready for coview api"
);
coview_api
.
Login
(
globalUserInfo
.
loginId
);
});
coview_api
.
addEventListener
(
"start"
,
function
()
{
console
.
log
(
"=============> START : share start"
);
$
(
"#loadingIndicator"
).
removeClass
(
"full_active"
);
});
coview_api
.
addEventListener
(
"destroy"
,
function
()
{
console
.
log
(
"=============> START : share start"
);
coview_api
.
LeaveRoom
();
$
(
".coview_share_area"
).
hide
();
$
(
"#loadingIndicator"
).
removeClass
(
"full_active"
);
});
coview_api
.
addEventListener
(
"message"
,
async
function
(
event
,
json
)
{
console
.
log
(
"+++ addEventListener"
,
json
);
console
.
log
(
"processMessage api = "
,
json
.
api
);
switch
(
json
.
api
){
case
"LoginResponse"
:
break
;
case
"CreateRoomResponse"
:
if
(
json
.
resultCode
==
200
){
var
coviewInviteMessage
=
"coviewsharerequest:"
+
globalUserInfo
.
coWorkType
;
socket
.
emit
(
'createMessage'
,
{
text
:
coviewInviteMessage
},
0
);
}
else
{
}
break
;
case
"joinRoomInfoResponse"
:
if
(
json
.
resultCode
==
200
){
}
else
{
// alert(json.resultMsg + "(" + json.resultCode + ")" );
alert
(
"Not exist sharing call ("
+
json
.
resultCode
+
")
\
nPlease using share menu."
);
coview_api
.
LeaveRoom
();
$
(
".coview_share_area"
).
hide
();
$
(
"#loadingIndicator"
).
removeClass
(
"full_active"
);
}
break
;
default
:
// console.log('Unrecognized api', json);
break
;
}
});
});
function
Coview_shareDropdownHide
(){
$
(
".coview_share_dropdown_bar"
).
slideUp
();
$
(
".coview_share_photo_select_bubble"
).
slideUp
();
}
function
Coview_moveToVideoShareArea
(){
$
(
"#loadingIndicator"
).
addClass
(
"full_active"
);
$
(
".coview_share_area"
).
show
();
}
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