[mirotalk] - fix video PIP on exit

This commit is contained in:
Miroslav Pejic
2025-01-11 16:12:03 +01:00
parent d6f441bb9e
commit 6cce083c72
3 changed files with 16 additions and 4 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ dependencies: {
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.4.43
* @version 1.4.44
*
*/
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "mirotalk",
"version": "1.4.43",
"version": "1.4.44",
"description": "A free WebRTC browser-based video call",
"main": "server.js",
"scripts": {
+14 -2
View File
@@ -15,7 +15,7 @@
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.4.43
* @version 1.4.44
*
*/
@@ -4268,6 +4268,18 @@ function handlePictureInPicture(btnId, videoId, peerId) {
});
}
});
if (video) {
video.addEventListener('leavepictureinpicture', (event) => {
console.log('Exited PiP mode');
// Check if the video is paused
if (video.paused) {
// Play the video again
video.play().catch((error) => {
console.error('Error playing video after exit PIP mode:', error);
});
}
});
}
}
/**
@@ -10994,7 +11006,7 @@ function showAbout() {
Swal.fire({
background: swBg,
position: 'center',
title: '<strong>WebRTC P2P v1.4.43</strong>',
title: '<strong>WebRTC P2P v1.4.44</strong>',
imageAlt: 'mirotalk-about',
imageUrl: images.about,
customClass: { image: 'img-about' },