Skip to content
This repository was archived by the owner on Nov 25, 2022. It is now read-only.
This repository was archived by the owner on Nov 25, 2022. It is now read-only.

applyVideoFilter not working #233

@gustavostuff

Description

@gustavostuff

There's some code without context in here but still, this seems to work OK:

let publisherData = {
  resolution,
  audioSource: this.normalizeSource(config.audioSource),
  videoSource: this.normalizeSource(config.videoSource),
  name: id,
  showControls: false,
  frameRate: fps,
  insertDefaultUI: false,
  publishAudio: !isMuted,
  publishVideo: !isHidden,
  videoFilter: {
    type: 'backgroundBlur'  // <-- Sending filter here
  }
};

let pub = OT.initPublisher(
  undefined, {
    ...publisherData
  }, (error: OT.OTError) => {
    console.error('There was an error while initializing the publisher', error);
  }
);
this.publishers.set(id, pub);

Result:
blur.png

While this doesn't:

let publisherData = {
  resolution,
  audioSource: this.normalizeSource(config.audioSource),
  videoSource: this.normalizeSource(config.videoSource),
  name: id,
  showControls: false,
  frameRate: fps,
  insertDefaultUI: false,
  publishAudio: !isMuted,
  publishVideo: !isHidden,
};

let pub = OT.initPublisher(
  undefined, {
    ...publisherData
  }, (error: OT.OTError) => {
    console.error('There was an error while initializing the publisher', error);
  }
);
pub.applyVideoFilter({     //  <-- Doing it here instead
  type: 'backgroundBlur'
});
this.publishers.set(id, pub);

Result:
noblur.png

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions