-
-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c61c99e
commit 23747fa
Showing
4 changed files
with
65 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ dependencies: { | |
* @license For commercial or closed source, contact us at [email protected] or purchase directly via CodeCanyon | ||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 | ||
* @author Miroslav Pejic - [email protected] | ||
* @version 1.4.85 | ||
* @version 1.4.86 | ||
* | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ if (location.href.substr(0, 5) !== 'https') location.href = 'https' + location.h | |
* @license For commercial or closed source, contact us at [email protected] or purchase directly via CodeCanyon | ||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 | ||
* @author Miroslav Pejic - [email protected] | ||
* @version 1.4.85 | ||
* @version 1.4.86 | ||
* | ||
*/ | ||
|
||
|
@@ -4092,7 +4092,7 @@ function showAbout() { | |
imageUrl: image.about, | ||
customClass: { image: 'img-about' }, | ||
position: 'center', | ||
title: 'WebRTC SFU v1.4.85', | ||
title: 'WebRTC SFU v1.4.86', | ||
html: ` | ||
<br /> | ||
<div id="about"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
* @license For commercial or closed source, contact us at [email protected] or purchase directly via CodeCanyon | ||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 | ||
* @author Miroslav Pejic - [email protected] | ||
* @version 1.4.85 | ||
* @version 1.4.86 | ||
* | ||
*/ | ||
|
||
|
@@ -7336,6 +7336,14 @@ class RoomClient { | |
|
||
this.startRendering(); | ||
|
||
if (!this.isMobileDevice) { | ||
// Handle desktop or non-mobile device | ||
this.handleDesktopChat(); | ||
} else { | ||
// Handle mobile device | ||
this.handleMobileChat(); | ||
} | ||
|
||
VideoAI.active = true; | ||
|
||
this.userLog('info', 'Video AI streaming started', 'top-end'); | ||
|
@@ -7344,6 +7352,58 @@ class RoomClient { | |
} | ||
} | ||
|
||
// Method for handling desktop or non-mobile device chat logic | ||
handleDesktopChat() { | ||
if (!this.isChatOpen) { | ||
this.toggleChat(); | ||
} | ||
this.sendMessageToVideoAi(); | ||
} | ||
|
||
// Method for handling mobile device chat logic | ||
handleMobileChat() { | ||
if (this.videoMediaContainer.childElementCount <= 2) { | ||
isHideMeActive = !isHideMeActive; | ||
this.handleHideMe(); | ||
} | ||
setTimeout(() => { | ||
this.streamingTask( | ||
`Welcome to ${BRAND.app.name}! Please Open the Chat and navigate to the ChatGPT section. Feel free to ask me any questions you have.`, | ||
); | ||
}, 2000); | ||
} | ||
|
||
sendMessageToVideoAi() { | ||
const tasks = [ | ||
{ delay: 1000, action: () => this.chatPin() }, | ||
{ delay: 1200, action: () => this.toggleShowParticipants() }, | ||
{ delay: 1400, action: () => this.showPeerAboutAndMessages('ChatGPT', 'ChatGPT') }, | ||
{ delay: 1600, action: () => this.streamingTask(`Welcome to ${BRAND.app.name}!`) }, | ||
{ | ||
delay: 2000, | ||
action: () => { | ||
chatMessage.value = 'Hello!'; | ||
this.sendMessage(); | ||
}, | ||
}, | ||
]; | ||
this.executeTasksSequentially(tasks); | ||
} | ||
|
||
executeTasksSequentially(tasks) { | ||
tasks.reduce((promise, task) => { | ||
return promise.then( | ||
() => | ||
new Promise((resolve) => { | ||
setTimeout(() => { | ||
task.action(); | ||
resolve(); | ||
}, task.delay); | ||
}), | ||
); | ||
}, Promise.resolve()); | ||
} | ||
|
||
streamingTask(message) { | ||
if (VideoAI.enabled && VideoAI.active && message) { | ||
const response = this.socket.request('streamingTask', { | ||
|