mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: Reapplied background on video replace track
parent
f5fc739ea1
commit
42279d557d
|
@ -83,13 +83,15 @@ export class VideoDevicesComponent implements OnInit, OnDestroy {
|
||||||
const mirror = this.deviceSrv.cameraNeedsMirror(videoSource);
|
const mirror = this.deviceSrv.cameraNeedsMirror(videoSource);
|
||||||
// Reapply Virtual Background to new Publisher if necessary
|
// Reapply Virtual Background to new Publisher if necessary
|
||||||
const backgroundSelected = this.backgroundService.backgroundSelected.getValue();
|
const backgroundSelected = this.backgroundService.backgroundSelected.getValue();
|
||||||
if (this.backgroundService.isBackgroundApplied()) {
|
const isBackgroundApplied = this.backgroundService.isBackgroundApplied()
|
||||||
|
|
||||||
|
if (isBackgroundApplied) {
|
||||||
await this.backgroundService.removeBackground();
|
await this.backgroundService.removeBackground();
|
||||||
}
|
}
|
||||||
const pp: PublisherProperties = { videoSource, audioSource: false, mirror };
|
const pp: PublisherProperties = { videoSource, audioSource: false, mirror };
|
||||||
await this.openviduService.replaceTrack(VideoType.CAMERA, pp);
|
await this.openviduService.replaceTrack(VideoType.CAMERA, pp);
|
||||||
|
|
||||||
if (this.backgroundService.isBackgroundApplied()) {
|
if (isBackgroundApplied) {
|
||||||
const bgSelected = this.backgroundService.backgrounds.find((b) => b.id === backgroundSelected);
|
const bgSelected = this.backgroundService.backgrounds.find((b) => b.id === backgroundSelected);
|
||||||
if (bgSelected) {
|
if (bgSelected) {
|
||||||
await this.backgroundService.applyBackground(bgSelected);
|
await this.backgroundService.applyBackground(bgSelected);
|
||||||
|
|
Loading…
Reference in New Issue