-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
55 lines (43 loc) · 1.16 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import alfrid, { Scene, GLTexture, FrameBuffer } from './lib/alfrid'
import VideoScene from './lib/VideoScene'
import VideoKeyScene from './src/scenes/VideoKeyScene'
import Proxxy from './src/proxy'
const GL = alfrid.GL;
export default class VideoEffects{
constructor(glCanvas, targetCanvas, mediaSource,mediaSource2, options={}) {
GL.init(glCanvas)
//this._scene = new VideoScene(targetCanvas, mediaSource, options)
this._scene = new VideoKeyScene(targetCanvas, mediaSource,mediaSource2, options)
}
setUniforms(uniforms){
this._scene.view.setUniforms(uniforms)
return new Proxxy(uniforms, (prop, val) => { this._onPropertyChanged(prop, val) }).p
}
_onPropertyChanged(prop, val) {
this._scene.view.updateUniform(prop, val)
}
get view(){
return this._scene.view
}
set paused(v) {
this._paused = v
this._scene.paused = this._paused
}
set width(w) {
this._scene.width = w
}
set height(h) {
this._scene.height = w
}
get texture() {
return this._scene.fbo.getTexture()
}
get pixels() {
return this._scene._pixels
}
get ctx(){
return this._scene.targetCanvasCtx
}
render(){
}
}