Changeset View
Changeset View
Standalone View
Standalone View
src/resources/js/meet/app.js
Show First 20 Lines • Show All 465 Lines • ▼ Show 20 Lines | function replaceTrack(track) { | ||||
const replaceMediaStreamTrack = () => { | const replaceMediaStreamTrack = () => { | ||||
stream.mediaStream.addTrack(track); | stream.mediaStream.addTrack(track); | ||||
if (session) { | if (session) { | ||||
session.sendVideoData(publisher.stream.streamManager, 5, true, 5); | session.sendVideoData(publisher.stream.streamManager, 5, true, 5); | ||||
} | } | ||||
} | } | ||||
// Fix a bug in Chrome where you would start hearing yourself after audio device change | |||||
// https://github.com/OpenVidu/openvidu/issues/449 | |||||
publisher.videoReference.muted = true | |||||
return new Promise((resolve, reject) => { | return new Promise((resolve, reject) => { | ||||
if (stream.isLocalStreamPublished) { | if (stream.isLocalStreamPublished) { | ||||
// Only if the Publisher has been published it is necessary to call the native | // Only if the Publisher has been published it is necessary to call the native | ||||
// Web API RTCRtpSender.replaceTrack() | // Web API RTCRtpSender.replaceTrack() | ||||
const senders = stream.getRTCPeerConnection().getSenders() | const senders = stream.getRTCPeerConnection().getSenders() | ||||
let sender | let sender | ||||
if (track.kind === 'video') { | if (track.kind === 'video') { | ||||
▲ Show 20 Lines • Show All 930 Lines • Show Last 20 Lines |