deepar 5.1.0 → 5.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -42,28 +42,6 @@ Using `yarn`:
42
42
  $ yarn add deepar
43
43
  ```
44
44
 
45
- ## Bundler setup
46
-
47
- We recommend using a bundler to correctly include assets like DeepAR effects files.
48
-
49
- For example, if using Webpack, add this to your `webpack.config.js`:
50
-
51
- ```javascript
52
- module.exports = {
53
- // ...
54
- module: {
55
- rules: [
56
- {
57
- include: [
58
- path.resolve(__dirname, 'effects/'),
59
- ],
60
- type: 'asset/resource',
61
- },
62
- ],
63
- },
64
- // ...
65
- ```
66
-
67
45
  ## Canvas
68
46
 
69
47
  DeepAR requires a [canvas](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API) element for the preview of camera, masks, filters and effects. You can add it directly in the HTML.
@@ -81,13 +59,9 @@ canvas.height = 720;
81
59
 
82
60
  > ⚠️ **Note:** Be sure to set `width` and `height` properties of the `canvas`!
83
61
 
84
-
85
- Or you can create it in Javascript.
86
- ```javascript
87
- let canvas = document.createElement("canvas");
88
- ```
89
-
90
- > **Note:** Be sure to set `width` and `height` properties of the `canvas`!
62
+ You can always change the canvas dimensions and they don't have to match the
63
+ input video resolution. DeepAR will fit the input camera/video stream correctly
64
+ to any canvas size.
91
65
 
92
66
  ## Getting started
93
67
  There are two main ways to get deepar.js in your JavaScript project:
@@ -124,6 +98,20 @@ Add the following code to an HTML file:
124
98
  </html>
125
99
  ```
126
100
 
101
+ Alternatively, you can import DeepAR as an ES6 module.
102
+
103
+ Via `<script type="module">`.
104
+ ```html
105
+ <script type="module">
106
+ import * as deepar from 'https://cdn.jsdelivr.net/npm/deepar/js/deepar.esm.js';
107
+ </script>
108
+ ```
109
+
110
+ Or via dynamic [import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import).
111
+ ```javascript
112
+ const deepar = await import('https://cdn.jsdelivr.net/npm/deepar/js/deepar.esm.js');
113
+ ```
114
+
127
115
  ### via NPM
128
116
  Add deepar.js to your project using [yarn](https://yarnpkg.com/en/) or
129
117
  [npm](https://docs.npmjs.com/cli/npm).
package/VERSION.txt CHANGED
@@ -1 +1 @@
1
- DeepAR SDK version: v5.1.0
1
+ DeepAR SDK version: v5.1.1