-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mirotalkwebrtc] - add QR room sharing
- Loading branch information
1 parent
a698250
commit 8001b48
Showing
4 changed files
with
43 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 |
---|---|---|
|
@@ -29,6 +29,8 @@ | |
<script type="text/javascript" src="https://cdn.datatables.net/1.13.1/js/dataTables.bootstrap5.min.js"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/qrious.min.js"></script> | ||
|
||
<!-- <script type="text/javascript" src="https://unpkg.com/@popperjs/core@2"></script> | ||
<script type="text/javascript" src="https://unpkg.com/tippy.js@6"></script> --> | ||
<script | ||
|
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 private project or commercial purposes contact us at: [email protected] or purchase it directly via Code Canyon: | ||
* @license https://codecanyon.net/item/a-selfhosted-mirotalks-webrtc-rooms-scheduler-server/42643313 | ||
* @author Miroslav Pejic - [email protected] | ||
* @version 1.0.79 | ||
* @version 1.0.80 | ||
*/ | ||
|
||
const isMobile = !!/Android|webOS|iPhone|iPad|iPod|BB10|BlackBerry|IEMobile|Opera Mini|Mobile|mobile/i.test( | ||
|
@@ -590,17 +590,41 @@ function setRandomRoom(id) { | |
} | ||
|
||
function copyRoom(id) { | ||
const room = document.getElementById(id + '_room').value; | ||
navigator.clipboard.writeText(room).then( | ||
const data = getRowValues(id); | ||
const roomURL = getRoomURL(data); | ||
|
||
navigator.clipboard.writeText(roomURL).then( | ||
() => { | ||
popupMessage('toast', `The room: ${room} \n has been successfully copied to the clipboard 👍`); | ||
console.log(`The roomURL: ${roomURL} \n has been successfully copied to the clipboard 👍`); | ||
popupMessage( | ||
'copyRoom', | ||
`<br/> | ||
<div id="qrRoomContainer"> | ||
<canvas id="qrRoom"></canvas> | ||
</div> | ||
<br/> | ||
<p style="color:rgb(8, 189, 89);">Join from your mobile device</p> | ||
<p style="background:transparent; color:white; font-family: Arial, Helvetica, sans-serif;">No need for apps, simply capture the QR code with your mobile camera Or Invite someone else to join by sending them the following URL</p> | ||
<p style="color:rgb(8, 189, 89);">${roomURL}</p>`, | ||
); | ||
makeRoomQR(roomURL); | ||
}, | ||
(err) => { | ||
console.error('Could not copy text: ', err); | ||
}, | ||
); | ||
} | ||
|
||
function makeRoomQR(room) { | ||
const qr = new QRious({ | ||
element: document.getElementById('qrRoom'), | ||
value: room, | ||
}); | ||
qr.set({ | ||
size: 256, | ||
}); | ||
} | ||
|
||
async function shareRoom(id) { | ||
const data = getRowValues(id); | ||
const roomURL = getRoomURL(data, false); | ||
|
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