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
3376f66b
Commit
3376f66b
authored
Sep 09, 2021
by
Kim Peace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed to use promise instead of callback parameter
parent
4d19a6c1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
24 deletions
+30
-24
public_new/js/views/collaboration/fermi-web-socket-message-handler.js
+2
-2
public_new/js/views/collaboration/share-bind-button-action.js
+24
-20
public_new/js/views/collaboration/share-event-listener.js
+3
-1
public_new/js/views/collaboration/share.js
+1
-1
No files found.
public_new/js/views/collaboration/fermi-web-socket-message-handler.js
View file @
3376f66b
...
@@ -171,7 +171,7 @@ FermiWebSocketMessageHandler.captureRequest = function (data) {
...
@@ -171,7 +171,7 @@ FermiWebSocketMessageHandler.captureRequest = function (data) {
if
(
$
(
"#recordBtn .record"
).
hasClass
(
"disable"
))
{
if
(
$
(
"#recordBtn .record"
).
hasClass
(
"disable"
))
{
screenLock
();
screenLock
();
recordStop
(
function
()
{
recordStop
(
).
then
(
function
()
{
$
(
"#screenLock"
).
remove
();
$
(
"#screenLock"
).
remove
();
captureAndShareImage
(
captureAndShareImage
(
serverInfo
.
cmsURL
+
"/chatapi/file/uploadArchive"
,
serverInfo
.
cmsURL
+
"/chatapi/file/uploadArchive"
,
...
@@ -222,7 +222,7 @@ FermiWebSocketMessageHandler.pipEndRequest = function () {
...
@@ -222,7 +222,7 @@ FermiWebSocketMessageHandler.pipEndRequest = function () {
FermiWebSocketMessageHandler
.
apiSendOwnerChangeComplete
=
function
(
data
)
{
FermiWebSocketMessageHandler
.
apiSendOwnerChangeComplete
=
function
(
data
)
{
penOff
();
penOff
();
if
(
$
(
"#recordBtn .record"
).
hasClass
(
"disable"
))
{
if
(
$
(
"#recordBtn .record"
).
hasClass
(
"disable"
))
{
recordStop
(
function
()
{}
);
recordStop
();
}
}
if
(
$
(
"#micBtn .voice"
).
hasClass
(
"disable"
))
{
if
(
$
(
"#micBtn .voice"
).
hasClass
(
"disable"
))
{
micOff
();
micOff
();
...
...
public_new/js/views/collaboration/share-bind-button-action.js
View file @
3376f66b
...
@@ -28,7 +28,7 @@ function toggleEraser() {
...
@@ -28,7 +28,7 @@ function toggleEraser() {
function
toggleCapture
()
{
function
toggleCapture
()
{
if
(
$
(
"#recordBtn"
).
hasClass
(
"bg_red"
))
{
if
(
$
(
"#recordBtn"
).
hasClass
(
"bg_red"
))
{
screenLock
();
screenLock
();
recordStop
(
function
()
{
recordStop
(
).
then
(
function
()
{
$
(
"#screenLock"
).
remove
();
$
(
"#screenLock"
).
remove
();
coview_api
.
Capture
(
serverInfo
.
cmsURL
+
"/chatapi/file/uploadArchive"
);
coview_api
.
Capture
(
serverInfo
.
cmsURL
+
"/chatapi/file/uploadArchive"
);
});
});
...
@@ -79,15 +79,16 @@ function toggleRecord() {
...
@@ -79,15 +79,16 @@ function toggleRecord() {
if
(
!
$
(
"#recordBtn .record"
).
hasClass
(
"disable"
))
{
if
(
!
$
(
"#recordBtn .record"
).
hasClass
(
"disable"
))
{
recordStart
();
recordStart
();
}
else
{
}
else
{
recordStop
(
function
()
{
recordStop
(
).
then
(
function
()
{
console
.
info
(
"Did record stop"
);
console
.
info
(
"Did record stop"
);
});
});
}
}
}
}
function
recordStop
(
callback
)
{
function
recordStop
()
{
return
new
Promise
(
function
(
done
)
{
if
(
!
$
(
"#recordBtn .record"
).
hasClass
(
"disable"
))
{
if
(
!
$
(
"#recordBtn .record"
).
hasClass
(
"disable"
))
{
callback
();
done
();
return
;
return
;
}
}
Common
.
showLoadingIndicator
();
Common
.
showLoadingIndicator
();
...
@@ -95,14 +96,13 @@ function recordStop(callback) {
...
@@ -95,14 +96,13 @@ function recordStop(callback) {
screenLock
();
screenLock
();
// アーカイブ保存処理
// アーカイブ保存処理
mainManRecordWithCollaboration
(
mainManRecordStopWithCollaboration
().
then
(
function
()
{
"stop"
,
done
();
serverInfo
.
cmsURL
+
"/chatapi/file/uploadArchive"
,
});
callback
});
);
}
}
async
function
sendRecordedData
(
url
,
callback
)
{
async
function
sendRecordedData
()
{
return
new
Promise
(
function
(
done
)
{
return
new
Promise
(
function
(
done
)
{
// get lastest message id and update message from server via native
// get lastest message id and update message from server via native
const
blob
=
new
Blob
(
recordedBlobs
,
{
type
:
"video/webm"
});
const
blob
=
new
Blob
(
recordedBlobs
,
{
type
:
"video/webm"
});
...
@@ -118,41 +118,45 @@ async function sendRecordedData(url, callback) {
...
@@ -118,41 +118,45 @@ async function sendRecordedData(url, callback) {
:
ARCHIVE_TYPE
.
VOICE
;
:
ARCHIVE_TYPE
.
VOICE
;
formData
.
append
(
"archiveType"
,
collaborationType
);
formData
.
append
(
"archiveType"
,
collaborationType
);
postRecords
(
url
,
formData
,
function
()
{
postRecords
(
formData
).
then
(
function
()
{
done
();
done
();
callback
();
});
});
});
});
}
}
function
mainManRecordWithCollaboration
(
action
,
url
,
callback
)
{
function
mainManRecordStopWithCollaboration
()
{
return
new
Promise
(
function
(
done
)
{
try
{
try
{
mediaRecorder
.
stop
();
mediaRecorder
.
stop
();
}
catch
(
exeption
)
{
}
catch
(
exeption
)
{
console
.
error
(
"Record
failed"
);
console
.
error
(
"Record stop
failed"
);
callback
();
done
();
}
}
sendRecordedData
(
url
,
callback
);
sendRecordedData
().
then
(
function
()
{
done
();
});
});
}
}
function
postRecords
(
url
,
formData
,
callback
)
{
function
postRecords
(
formData
)
{
return
new
Promise
(
function
(
done
)
{
$
.
ajax
({
$
.
ajax
({
type
:
"post"
,
type
:
"post"
,
url
:
url
,
url
:
serverInfo
.
cmsURL
+
"/chatapi/file/uploadArchive"
,
data
:
formData
,
data
:
formData
,
contentType
:
false
,
contentType
:
false
,
processData
:
false
,
processData
:
false
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
recordFinished
();
recordFinished
();
Common
.
dismissLoadingIndicator
();
Common
.
dismissLoadingIndicator
();
callback
();
done
();
},
},
error
:
function
(
err
)
{
error
:
function
(
err
)
{
recordFinished
();
recordFinished
();
Common
.
dismissLoadingIndicator
();
Common
.
dismissLoadingIndicator
();
callback
();
},
},
});
});
});
}
}
// div削除関数
// div削除関数
...
...
public_new/js/views/collaboration/share-event-listener.js
View file @
3376f66b
...
@@ -510,7 +510,9 @@ CoviewBridge.exitCollaboration = function () {
...
@@ -510,7 +510,9 @@ CoviewBridge.exitCollaboration = function () {
}
}
if
(
$
(
"#recordBtn .record"
).
hasClass
(
"disable"
))
{
if
(
$
(
"#recordBtn .record"
).
hasClass
(
"disable"
))
{
recordStop
(
CoviewBridge
.
finishCollaboration
);
recordStop
().
then
(
function
()
{
CoviewBridge
.
finishCollaboration
();
});
}
else
{
}
else
{
CoviewBridge
.
finishCollaboration
();
CoviewBridge
.
finishCollaboration
();
}
}
...
...
public_new/js/views/collaboration/share.js
View file @
3376f66b
...
@@ -28,7 +28,7 @@ document.addEventListener("DOMContentLoaded", function () {
...
@@ -28,7 +28,7 @@ document.addEventListener("DOMContentLoaded", function () {
// call from collaboration_overlay_menu.html and collaboration.html
// call from collaboration_overlay_menu.html and collaboration.html
function
changeCollaboration
(
collaborationType
)
{
function
changeCollaboration
(
collaborationType
)
{
recordStop
(
function
()
{
recordStop
(
).
then
(
function
()
{
var
newMeetingID
=
0
;
var
newMeetingID
=
0
;
if
(
globalUserInfo
.
collaborationType
==
COLLABORATION_TYPE
.
DOCUMENT
)
{
if
(
globalUserInfo
.
collaborationType
==
COLLABORATION_TYPE
.
DOCUMENT
)
{
NativeBridgeDelegate
.
exitMeetingRoom
();
NativeBridgeDelegate
.
exitMeetingRoom
();
...
...
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