etro 0.8.0 → 0.8.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/.github/workflows/nodejs.yml +3 -1
- package/CHANGELOG.md +9 -1
- package/CODE_OF_CONDUCT.md +5 -5
- package/CONTRIBUTING.md +22 -72
- package/README.md +1 -1
- package/dist/effect/base.d.ts +14 -1
- package/dist/etro-cjs.js +156 -213
- package/dist/etro-iife.js +156 -213
- package/dist/layer/base.d.ts +13 -0
- package/eslint.conf.js +2 -1
- package/eslint.test-conf.js +1 -0
- package/examples/application/readme-screenshot.html +4 -8
- package/examples/application/video-player.html +3 -4
- package/examples/introduction/effects.html +23 -4
- package/karma.conf.js +4 -2
- package/package.json +4 -1
- package/scripts/gen-effect-samples.html +0 -3
- package/src/effect/base.ts +29 -10
- package/src/effect/gaussian-blur.ts +10 -10
- package/src/effect/pixelate.ts +1 -2
- package/src/effect/shader.ts +18 -22
- package/src/effect/stack.ts +5 -2
- package/src/effect/transform.ts +13 -14
- package/src/event.ts +8 -14
- package/src/layer/audio-source.ts +16 -14
- package/src/layer/audio.ts +1 -2
- package/src/layer/base.ts +26 -7
- package/src/layer/visual.ts +5 -6
- package/src/movie.ts +41 -49
- package/src/util.ts +50 -57
- package/docs/effect.js.html +0 -1215
- package/docs/event.js.html +0 -145
- package/docs/index.html +0 -81
- package/docs/index.js.html +0 -92
- package/docs/layer.js.html +0 -888
- package/docs/module-effect-GaussianBlurComponent.html +0 -345
- package/docs/module-effect.Brightness.html +0 -339
- package/docs/module-effect.Channels.html +0 -319
- package/docs/module-effect.ChromaKey.html +0 -611
- package/docs/module-effect.Contrast.html +0 -339
- package/docs/module-effect.EllipticalMask.html +0 -200
- package/docs/module-effect.GaussianBlur.html +0 -202
- package/docs/module-effect.GaussianBlurHorizontal.html +0 -242
- package/docs/module-effect.GaussianBlurVertical.html +0 -242
- package/docs/module-effect.Pixelate.html +0 -330
- package/docs/module-effect.Shader.html +0 -1227
- package/docs/module-effect.Stack.html +0 -406
- package/docs/module-effect.Transform.Matrix.html +0 -193
- package/docs/module-effect.Transform.html +0 -1174
- package/docs/module-effect.html +0 -148
- package/docs/module-event.html +0 -473
- package/docs/module-index.html +0 -186
- package/docs/module-layer-Media.html +0 -1116
- package/docs/module-layer-MediaMixin.html +0 -164
- package/docs/module-layer.Audio.html +0 -1188
- package/docs/module-layer.Base.html +0 -629
- package/docs/module-layer.Image.html +0 -1421
- package/docs/module-layer.Text.html +0 -1731
- package/docs/module-layer.Video.html +0 -1938
- package/docs/module-layer.Visual.html +0 -1698
- package/docs/module-layer.html +0 -137
- package/docs/module-movie.html +0 -3118
- package/docs/module-util.Color.html +0 -702
- package/docs/module-util.Font.html +0 -395
- package/docs/module-util.html +0 -845
- package/docs/movie.js.html +0 -689
- package/docs/scripts/collapse.js +0 -20
- package/docs/scripts/linenumber.js +0 -25
- package/docs/scripts/nav.js +0 -12
- package/docs/scripts/polyfill.js +0 -4
- package/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/docs/scripts/prettify/lang-css.js +0 -2
- package/docs/scripts/prettify/prettify.js +0 -28
- package/docs/scripts/search.js +0 -83
- package/docs/styles/jsdoc.css +0 -671
- package/docs/styles/prettify.css +0 -79
- package/docs/util.js.html +0 -503
- package/spec/assets/effect/gaussian-blur-horizontal.png +0 -0
- package/spec/assets/effect/gaussian-blur-vertical.png +0 -0
- package/spec/assets/effect/grayscale.png +0 -0
- package/spec/assets/effect/original.png +0 -0
- package/spec/assets/effect/pixelate.png +0 -0
- package/spec/assets/effect/transform/multiply.png +0 -0
- package/spec/assets/effect/transform/rotate.png +0 -0
- package/spec/assets/effect/transform/scale-fraction.png +0 -0
- package/spec/assets/effect/transform/scale.png +0 -0
- package/spec/assets/effect/transform/translate-fraction.png +0 -0
- package/spec/assets/effect/transform/translate.png +0 -0
- package/spec/assets/layer/audio.wav +0 -0
- package/spec/assets/layer/image.jpg +0 -0
- package/spec/effect.spec.js +0 -421
- package/spec/event.spec.js +0 -39
- package/spec/layer.spec.js +0 -307
- package/spec/movie.spec.js +0 -346
- package/spec/util.spec.js +0 -294
|
@@ -4,7 +4,6 @@ on: [push]
|
|
|
4
4
|
|
|
5
5
|
jobs:
|
|
6
6
|
build:
|
|
7
|
-
|
|
8
7
|
runs-on: ubuntu-latest
|
|
9
8
|
|
|
10
9
|
strategy:
|
|
@@ -17,6 +16,9 @@ jobs:
|
|
|
17
16
|
uses: actions/setup-node@v1
|
|
18
17
|
with:
|
|
19
18
|
node-version: ${{ matrix.node-version }}
|
|
19
|
+
- name: Update npm
|
|
20
|
+
run: |
|
|
21
|
+
npm i -g npm@^7.x
|
|
20
22
|
- name: npm install, lint, build, and test
|
|
21
23
|
run: |
|
|
22
24
|
npm ci
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.1] - 2021-04-20
|
|
4
|
+
### Fixed
|
|
5
|
+
- `sourceStartTime` getting ignored on `'movie.seek'`.
|
|
6
|
+
- Calling methods like `unshift` on `Movie#layers` and `Movie#effects`.
|
|
7
|
+
- `GaussianBlur` effect throwing a `TypeError` when applied to a movie or layer.
|
|
8
|
+
- Issues with audio and video layers re-attaching to a movie.
|
|
9
|
+
|
|
3
10
|
## [0.8.0] - 2021-04-11
|
|
4
11
|
### Added
|
|
5
12
|
- Type declarations.
|
|
@@ -171,7 +178,8 @@
|
|
|
171
178
|
- Gaussian blur
|
|
172
179
|
- Transform
|
|
173
180
|
|
|
174
|
-
[Unreleased]: https://github.com/etro-js/etro/compare/v0.8...HEAD
|
|
181
|
+
[Unreleased]: https://github.com/etro-js/etro/compare/v0.8.1...HEAD
|
|
182
|
+
[0.8.1]: https://github.com/etro-js/etro/compare/v0.8...v0.8.1
|
|
175
183
|
[0.8.0]: https://github.com/etro-js/etro/compare/v0.7...v0.8
|
|
176
184
|
[0.7.0]: https://github.com/etro-js/etro/compare/v0.6...v0.7
|
|
177
185
|
[0.6.0]: https://github.com/etro-js/etro/compare/v0.5...v0.6
|
package/CODE_OF_CONDUCT.md
CHANGED
|
@@ -55,11 +55,11 @@ further defined and clarified by project maintainers.
|
|
|
55
55
|
## Enforcement
|
|
56
56
|
|
|
57
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
-
reported by contacting me at **\@etro-js**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
reported by contacting me at **\@etro-js** on Twitter. All complaints will be
|
|
59
|
+
reviewed and investigated and will result in a response that is deemed necessary
|
|
60
|
+
and appropriate to the circumstances. The project team is obligated to maintain
|
|
61
|
+
confidentiality with regard to the reporter of an incident. Further details of
|
|
62
|
+
specific enforcement policies may be posted separately.
|
|
63
63
|
|
|
64
64
|
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
65
|
faith may face temporary or permanent repercussions as determined by other
|
package/CONTRIBUTING.md
CHANGED
|
@@ -10,7 +10,7 @@ Thank you for considering contributing to Etro! There are many ways you can cont
|
|
|
10
10
|
|
|
11
11
|
#### Step 0: Dependencies
|
|
12
12
|
|
|
13
|
-
- You will need Git, Node, NPM and Chrome (for headless unit testing) installed
|
|
13
|
+
- You will need Git, Node, NPM (at least 7.x) and Chrome (for headless unit testing) installed
|
|
14
14
|
|
|
15
15
|
#### Step 1: Fork
|
|
16
16
|
|
|
@@ -22,35 +22,13 @@ Thank you for considering contributing to Etro! There are many ways you can cont
|
|
|
22
22
|
npm install
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
#### Step 2: Branch
|
|
26
|
-
|
|
27
|
-
- To help organize your work, create a branch for your topic. Avoid working directly off the `master` branch
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
git checkout -b topic-branch
|
|
31
|
-
```
|
|
32
|
-
|
|
33
25
|
## Making your changes
|
|
34
26
|
|
|
35
|
-
#### Step
|
|
36
|
-
|
|
37
|
-
- If you are writing code, please follow the style guide [StandardJS](https://standardjs.com/rules.html)
|
|
38
|
-
|
|
39
|
-
- To download the example assets run
|
|
27
|
+
#### Step 2: Code
|
|
40
28
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- Then, start the development server with
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
npm start
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Now you can see your changes by running some [examples](examples).
|
|
52
|
-
|
|
53
|
-
- When you're ready to submit a piece of work, first run
|
|
29
|
+
- Make some changes.
|
|
30
|
+
- If you are writing code, the linter uses [StandardJS](https://standardjs.com/rules.html) for style conventions.
|
|
31
|
+
- When you're ready to submit a piece of code, first run
|
|
54
32
|
|
|
55
33
|
```
|
|
56
34
|
npm run lint
|
|
@@ -61,13 +39,12 @@ Thank you for considering contributing to Etro! There are many ways you can cont
|
|
|
61
39
|
to lint the code, generate the [dist](dist) files and run unit tests on them. It may be helpful to put these commands in a pre-commit hook.
|
|
62
40
|
|
|
63
41
|
- Commit your changes
|
|
64
|
-
- Please avoid squashing all your commits into one; we try to keep
|
|
42
|
+
- Please avoid squashing all your commits into one; we try to keep atomic commits.
|
|
65
43
|
- Please follow these commit message guidelines:
|
|
66
|
-
- Optionally,
|
|
67
|
-
- Then, write a concise summary of your changes. If you feel you need to, bullet the main idea of your changes in the description and/or explain why you made the changes.
|
|
44
|
+
- Optionally, prefix each commit message with [an appropriate emoji](https://gitmoji.dev)
|
|
68
45
|
- Write in the imperative tense
|
|
69
|
-
-
|
|
70
|
-
-
|
|
46
|
+
- Wrap lines after 72 characters (for Vim add `filetype indent plugin on` to ~/.vimrc, it's enabled by default in Atom).
|
|
47
|
+
- Example:
|
|
71
48
|
|
|
72
49
|
```
|
|
73
50
|
:emoji: One-liner
|
|
@@ -86,55 +63,32 @@ Thank you for considering contributing to Etro! There are many ways you can cont
|
|
|
86
63
|
git rebase upstream/master
|
|
87
64
|
```
|
|
88
65
|
|
|
89
|
-
- Push
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
git push origin topic-branch
|
|
93
|
-
```
|
|
66
|
+
- Push to your fork
|
|
94
67
|
|
|
95
68
|
#### Step 4: Pull request
|
|
96
69
|
|
|
97
|
-
- Open a pull request from your
|
|
70
|
+
- Open a pull request from your the branch in your fork to the main repository
|
|
98
71
|
- In the PR title, include **fixes ###** for bugs and **resolves ###** for feature requests
|
|
99
72
|
- If you changed any core functionality, make sure you explain your motives for those changes
|
|
100
73
|
|
|
101
74
|
#### Step 5: Feedback
|
|
102
75
|
|
|
103
|
-
- A large part of the submission process is receiving feedback on how you can improve you pull request. If you need change your pull request,
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
git add path/to/changes
|
|
107
|
-
git commit
|
|
108
|
-
git push origin topic-branch
|
|
109
|
-
```
|
|
76
|
+
- A large part of the submission process is receiving feedback on how you can improve you pull request. If you need to change your pull request, feel free to push more commits.
|
|
110
77
|
|
|
111
78
|
## Code overview
|
|
112
79
|
|
|
113
|
-
|
|
80
|
+
### Etro Overview
|
|
114
81
|
|
|
115
|
-
|
|
82
|
+
If you are new to the core elements of etro, you should probably read [the overview guide](https://etrojs.dev/docs/overview).
|
|
116
83
|
|
|
117
|
-
|
|
84
|
+
### API Structure
|
|
118
85
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
| [**index.js**](src/index.js) | the entry module |
|
|
126
|
-
| [**layer.js**](src/layer.js) | all layer classes |
|
|
127
|
-
| [**movie.js**](src/movie.js) | the `Movie` class |
|
|
128
|
-
| [**util.js**](src/util.js) | general utility |
|
|
129
|
-
|
|
130
|
-
Note that most of the above files will (hopefully soon) be broken down into multiple files each.
|
|
131
|
-
|
|
132
|
-
### Etro Objects
|
|
133
|
-
|
|
134
|
-
The base etro objects are the following:
|
|
135
|
-
* `Movie` - the movie (or entire user project)
|
|
136
|
-
* `layer.Base` - the root type of layer
|
|
137
|
-
* `effect.Base` - the root type of visual effect
|
|
86
|
+
* `etro.Movie` - the movie
|
|
87
|
+
* `etro.layer.*` - all layers
|
|
88
|
+
* `etro.effect.*` - all (visual) effects
|
|
89
|
+
- `etro.event.publish` - emit an event
|
|
90
|
+
- `etro.event.subscribe` - add an event listener
|
|
91
|
+
- `etro.*` - other utility classes and methods (see **src/util.ts**)
|
|
138
92
|
|
|
139
93
|
### Etro concepts
|
|
140
94
|
|
|
@@ -151,9 +105,5 @@ That will notify all listeners of `movie` for event types `'movie'`, `'movie.typ
|
|
|
151
105
|
```js
|
|
152
106
|
event.subscribe(movie, 'movie.type', event => {
|
|
153
107
|
console.log(event.target, event.type, event.additionalData) // should print the movie, 'movie.type.of.event', 'foo'
|
|
154
|
-
}
|
|
108
|
+
})
|
|
155
109
|
```
|
|
156
|
-
|
|
157
|
-
#### Values vs. Properties
|
|
158
|
-
|
|
159
|
-
In Etro objects, almost any property can be a [keyframe](https://github.com/etro-js/etro/wiki/Keyframes), [function](https://github.com/etro-js/etro/wiki/Functions), or just a constant value. To access the current value of the property at a given time, use `util.val(property, element, time)`; where `property` is the keyframe set, function or constant value, `element` is the object to which `property` belongs, and `time` is the current time relative to the element.
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
> Check out [this guide](https://etrojs.dev/docs/migrating-v0-8-0)
|
|
8
8
|
> for migrating.
|
|
9
9
|
|
|
10
|
-
Etro is a
|
|
10
|
+
Etro is a typescript framework for programmatically editing videos. Similar
|
|
11
11
|
to GUI-based video-editing software, it lets you layer media and other
|
|
12
12
|
content on a timeline. Audio, image, video and other tracks are supported,
|
|
13
13
|
along with powerful video effectts for existing tracks. Being very flexible
|
package/dist/effect/base.d.ts
CHANGED
|
@@ -17,7 +17,20 @@ export declare class Base implements BaseObject {
|
|
|
17
17
|
*/
|
|
18
18
|
private _occurrenceCount;
|
|
19
19
|
constructor();
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Attaches this effect to `target` if not already attached.
|
|
22
|
+
* @ignore
|
|
23
|
+
*/
|
|
24
|
+
tryAttach(target: Movie | Visual): void;
|
|
25
|
+
attach(movie: Movie | Visual): void;
|
|
26
|
+
/**
|
|
27
|
+
* Dettaches this effect from its target if the number of times `tryDetach`
|
|
28
|
+
* has been called (including this call) equals the number of times
|
|
29
|
+
* `tryAttach` has been called.
|
|
30
|
+
*
|
|
31
|
+
* @ignore
|
|
32
|
+
*/
|
|
33
|
+
tryDetach(): void;
|
|
21
34
|
detach(): void;
|
|
22
35
|
/**
|
|
23
36
|
* Apply this effect to a target at the given time
|