1.1.7 • Published 3 months ago

@dytesdk/video-background-transformer v1.1.7

Weekly downloads
-
License
-
Repository
-
Last release
3 months ago

Table of Contents

About The Project

The goal of Video Background Transformer is to create Dyte Meetings' VideoMiddlewares with ease and make it fun to play around with.

Built With

Getting Started

Prerequisites

  • npm

Installation

npm install @dytesdk/video-background-transformer

Usage

A videoBackgroundTransformer object can be created using the DyteVideoBackgroundTransformer.init() method.

const videoBackgroundTransformer = await DyteVideoBackgroundTransformer.init();

Types of middlewares exposed by videoBackgroundTransformer: 1. createStaticBackgroundVideoMiddleware expects an imageUrl as a parameter and then creates the image the background for the current user.

meeting.self.addVideoMiddleware(
    await videoBackgroundTransformer.createStaticBackgroundVideoMiddleware(imageUrl)
);
  1. createBackgroundBlurVideoMiddleware expects blurLength as a parameter (4px by default) and blurs the background of the user by the given blurLength.
meeting.self.addVideoMiddleware(await dyteVideoBackgroundTransformer.createBackgroundBlurVideoMiddleware(10))

Note: Some browsers or their old versions might not have support for WebGL or the browser APIs that this package uses. We would recommend checking the support beforehand using:

if(DyteVideoBackgroundTransformer.isSupported()){
  const videoBackgroundTransformer = await DyteVideoBackgroundTransformer.init();
  meeting.self.addVideoMiddleware(
    await videoBackgroundTransformer.createStaticBackgroundVideoMiddleware(`REPLACE_THIS_WITH_IMAGE_URL`)
  );
}

Note: Image URLs must allow CORS to avoid tainting the canvas. You can find such images on https://unsplash.com/ & https://imgur.com.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'feat: Add some AmazingFeature')
  4. Push to the Branch (git push -u origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

1.1.7

3 months ago

1.1.7-staging.1

3 months ago

1.1.6

4 months ago

1.1.5

8 months ago

1.1.5-staging.1

8 months ago

1.1.4-staging.1

1 year ago

1.1.3-staging.1

1 year ago

1.1.3-staging.2

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.2-staging.1

1 year ago

1.1.1

1 year ago

1.1.1-staging.1

1 year ago

1.0.2-staging.3

1 year ago

1.1.0

2 years ago

1.0.3

2 years ago

1.0.2-staging.2

2 years ago