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

Screen Share Error 4.1 MCU

Dear Team,

I am getting below error when we are using screen-cast, attached screen shot

audio/video is inconsistent with tracks presented in the media stream

image.jpg

Thanks

Naresh

Tags (2)
0 Kudos
5 Replies
Highlighted
69 Views

According to the error description, it may caused by publish audio/video option is not aligned with created stream track, like created local stream is video only but you publish with audio and video enabled, please check publish option and create stream option first.

0 Kudos
Highlighted
Beginner
69 Views

@Qiujiao W. (Intel) 您好:

 1.   点击浏览器里面的停止屏幕共享应该用什么事件监听呢,之前 3.5 应该用的  removestream,现在看文档使用  pub 的 ended事件,但是没有效果。

 2.  使用nwjs 直接调用 chrome navigator.webkitGetUserMedia 打开屏幕共享(共享预览已经打开了),应该怎么传入流参数到sdk中呢?因为 nwjs 貌似无法传入extension 扩展插件ID无法使用。

0 Kudos
Highlighted
69 Views

For share screen event, it is defined in mediastream of w3c https://www.w3.org/TR/mediacapture-streams/#mediastream , here is an example on how to use it:

function mediaStreamEvent(localStream) {
    localStream.mediaStream.getTracks().forEach(track => {
        track.onended = function () {
            console.log(`localStream ${localStream.id} ${track.kind} ended`);
        }
    })
}
 

0 Kudos
Highlighted
69 Views

Hi, Now you can share your screen using 'navigator.mediaDevices.getDisplayMedia(displayMediaOptions) '. Here is the link https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia. Capture the stream with "getDisplayMedia" method and publish the stream, it works.
 

Thank You.

0 Kudos
Highlighted
Beginner
69 Views

Have you solved it? I have the same question and I don't know how to solve it.

Below it's my code.

 

navigator.mediaDevices.getDisplayMedia().then(stream => {
 const publishStream = new Owt.Base.LocalStream(
          stream, new Owt.Base.StreamSourceInfo(Owt.Base.AudioSourceInfo.MIC, 
          Owt.Base.VideoSourceInfo.SCREENCAST), {
            username: this.username
          }
        );
this.conference.publish(publishStream).then();
})

 

0 Kudos