Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
67 Views

4.2. version error while screen sharing

Hi,

while doing screen share reusult the following error 

Uncaught (in promise) Error: options.audio/video is inconsistent with tracks presented in the MediaStream.
    at t.value (owt.js:9)
    at n.ConferenceClient.publish (owt.js:9)
    at index.js?t=345dsfs8i:236

local stream showing but remote stream not showing at remote end

I have used following code 

function publishScreenStream() {

let audioConstraintsForMic = false;

let videoConstraintsForCamera = new Owt.Base.VideoTrackConstraints(Owt.Base.VideoSourceInfo.SCREENCAST);

let constraints = new Owt.Base.StreamConstraints(

audioConstraintsForMic, videoConstraintsForCamera);

//constraints.audio = 'screen-cast';

constraints.extensionId = 'onnmlangiddmngabfpbcegkbmelemcab';//'pdjlcifcbfpbpeaifobhhamknjmdilni';

Owt.Base.MediaStreamFactory.createMediaStream(constraints).then(stream => {

mediaScreenStream = stream;

var streamAttribute = {};

streamAttribute.userName = userName;

streamAttribute.room = room;

streamAttribute.isScreen = true;

localScreenStrm = new Owt.Base.LocalStream(

mediaScreenStream, new Owt.Base.StreamSourceInfo(

'screen-cast', 'screen-cast'), streamAttribute);

let $video = $(`<video autoplay id=${stream.id} style='display:block;width:100%;height:100%;object-fit: contain;'>this browser does not supported video tag</video>`);

$video.get(0).srcObject = stream;

let $testdiv = $('<div id="test'+stream.id+'"></div>');

$testdiv.append($video)

$('.videos-wrap').append($testdiv);

layout();

//$('.local video').get(0).srcObject = stream;

conference.publish(localScreenStrm).then(publication => {

// alert(1)

stream.getVideoTracks()[0].onended = function() {

stopScreenShare();

};

globalScreenPublication = publication;

screenShareEnable = true;

publication.addEventListener('error', (err) => {

console.log('Publication error: ' + err.error.message);

});

publication.addEventListener('ended', (err) => {

stopScreenShare();

});

});

}, err => {

if (err == 'Error: Could not establish connection. Receiving end does not exist.') {

$('#screenmodal').modal('show');

}

console.error('Failed to create MediaStream, ' + err);

});

}

Tags (2)
0 Kudos
1 Reply
Highlighted
New Contributor I
67 Views

any  update on the above issue ?

0 Kudos