Intel® Collaboration Suite for WebRTC
Community support and discussions on the Intel® Collaboration Suite for WebRTC (Intel® CS for WebRTC).
1146 Discussions

4.2. version error while screen sharing

Nithin_P_
New Contributor I
436 Views

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);

});

}

0 Kudos
1 Reply
Nithin_P_
New Contributor I
436 Views

any  update on the above issue ?

0 Kudos
Reply