IVS Real Time Streaming: System Audio while screen sharing

0

We are unable hear the system audio while sharing the screen in IVS Real Time Streaming (Stage). I am using below code to get the screenshare.

export async function getScreenshare() { const screenShareStream = await navigator.mediaDevices.getDisplayMedia({audio: true, video: true}); return screenShareStream; }

export async function getMic(deviceId) { let media; const audioConstraints = { deviceId: deviceId ? { exact: deviceId } : null, }; media = await navigator.mediaDevices.getUserMedia({ video: false, audio: audioConstraints, });

activeAudioStream = media;

return media.getTracks()[0]; }

Is there any solution for this problem?

Ramesh
已提問 4 個月前檢視次數 120 次
1 個回答
1
已接受的答案

Please see the following demo which will illustrates sharing desktop audio:

https://codepen.io/amazon-ivs/pen/PoLYGBw

Also note the comments on that page:

This sample is used to demonstrate basic HTML / JS usage and broadcast audio from a screenshare a stage and broadcast. Reminder that Screenshare audio can only be captured in Chrome, Edge, and Opera. Additionally, on Linux and MacOS only the audio of a tab can be captured, no system audio. MDN Screenshare Audio Support

profile picture
已回答 4 個月前
profile picture
專家
已審閱 2 個月前
  • Thank you sir

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南