[call-me] - #13 - fix video on outgoing call from device without camera
This commit is contained in:
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "call-me",
|
"name": "call-me",
|
||||||
"version": "1.2.72",
|
"version": "1.2.73",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "call-me",
|
"name": "call-me",
|
||||||
"version": "1.2.72",
|
"version": "1.2.73",
|
||||||
"license": "AGPLv3",
|
"license": "AGPLv3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ngrok/ngrok": "1.5.2",
|
"@ngrok/ngrok": "1.5.2",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "call-me",
|
"name": "call-me",
|
||||||
"version": "1.2.72",
|
"version": "1.2.73",
|
||||||
"description": "Your Go-To for Instant Video Calls",
|
"description": "Your Go-To for Instant Video Calls",
|
||||||
"author": "Miroslav Pejic - miroslav.pejic.85@gmail.com",
|
"author": "Miroslav Pejic - miroslav.pejic.85@gmail.com",
|
||||||
"license": "AGPLv3",
|
"license": "AGPLv3",
|
||||||
|
|||||||
@@ -1173,8 +1173,26 @@ function handleMediaStreamError(error) {
|
|||||||
function initializeConnection() {
|
function initializeConnection() {
|
||||||
thisConnection = new RTCPeerConnection(config);
|
thisConnection = new RTCPeerConnection(config);
|
||||||
|
|
||||||
|
// Add existing tracks from local stream
|
||||||
stream.getTracks().forEach((track) => thisConnection.addTrack(track, stream));
|
stream.getTracks().forEach((track) => thisConnection.addTrack(track, stream));
|
||||||
|
|
||||||
|
// Ensure we have transceivers for both audio and video, even if we don't have those tracks
|
||||||
|
// This allows us to receive video/audio from remote peer even if we don't have camera/mic
|
||||||
|
const hasVideo = stream.getVideoTracks().length > 0;
|
||||||
|
const hasAudio = stream.getAudioTracks().length > 0;
|
||||||
|
|
||||||
|
if (!hasVideo) {
|
||||||
|
// Add video transceiver to receive video from remote peer
|
||||||
|
thisConnection.addTransceiver('video', { direction: 'recvonly' });
|
||||||
|
console.log('Added recvonly video transceiver (no local camera)');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasAudio) {
|
||||||
|
// Add audio transceiver to receive audio from remote peer
|
||||||
|
thisConnection.addTransceiver('audio', { direction: 'recvonly' });
|
||||||
|
console.log('Added recvonly audio transceiver (no local microphone)');
|
||||||
|
}
|
||||||
|
|
||||||
thisConnection.ontrack = (e) => {
|
thisConnection.ontrack = (e) => {
|
||||||
if (e.streams && e.streams[0]) {
|
if (e.streams && e.streams[0]) {
|
||||||
const remoteStream = e.streams[0];
|
const remoteStream = e.streams[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user