Skip to content

Commit

Permalink
[mirotalksfu] - make video/audio IDs configurable via parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpejic85 committed Jul 2, 2024
1 parent 0f3676a commit 8ed2e9a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/src/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.78
* @version 1.4.79
*
*/

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mirotalksfu",
"version": "1.4.78",
"version": "1.4.79",
"description": "WebRTC SFU browser-based video calls",
"main": "Server.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions public/js/Room.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.78
* @version 1.4.79
*
*/

Expand Down Expand Up @@ -1728,7 +1728,7 @@ function handleButtons() {
rc.stopRTMP();
};
streamerRtmpButton.onclick = () => {
openURL('/rtmp', true);
openURL(`/rtmp?v=${videoSelect.value}&a=${microphoneSelect.value}`, true);
};
startRtmpURLButton.onclick = () => {
rc.startRTMPfromURL(rtmpStreamURL.value);
Expand Down Expand Up @@ -4071,7 +4071,7 @@ function showAbout() {
imageUrl: image.about,
customClass: { image: 'img-about' },
position: 'center',
title: 'WebRTC SFU v1.4.78',
title: 'WebRTC SFU v1.4.79',
html: `
<br />
<div id="about">
Expand Down
2 changes: 1 addition & 1 deletion public/js/RoomClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.78
* @version 1.4.79
*
*/

Expand Down
13 changes: 12 additions & 1 deletion public/js/RtmpStreamer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ const popup = document.getElementById('popup');
const popupMessage = document.getElementById('popupMessage');
const closePopup = document.getElementById('closePopup');

const qs = new URLSearchParams(window.location.search);
const videoId = qs.get('v');
const audioId = qs.get('a');

console.log('Video/Audio id', {
video: videoId,
audio: audioId,
});

/*
Low Latency: 1-2 seconds
Standard Use Case: 5 seconds
Expand Down Expand Up @@ -243,7 +252,9 @@ function stopTracks(stream) {
}

async function startCameraStreaming() {
const stream = await startCapture({ video: true, audio: true });
const videoConstraints = videoId ? { deviceId: videoId } : true;
const audioConstraints = audioId ? { deviceId: audioId } : true;
const stream = await startCapture({ video: videoConstraints, audio: audioConstraints });
await startStreaming(stream);
}

Expand Down

0 comments on commit 8ed2e9a

Please sign in to comment.