Skip to content

Commit

Permalink
Merge pull request #6 from Metrological/smooth-behavior-from-videotex…
Browse files Browse the repository at this point in the history
…ture

Remove opinionated smooth behavior from VideoTexture
  • Loading branch information
Thomvl authored Nov 28, 2022
2 parents d5ea7eb + 9e53fef commit 33ee729
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/VideoPlayer/VideoTexture.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* limitations under the License.
*/


import { Log, Lightning } from '../LightningSdkPlugins'

export default () => {
Expand Down Expand Up @@ -67,7 +66,11 @@ export default () => {
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE)
this.videoTexture.options = { source: glTexture, w: this.videoEl.width, h: this.videoEl.height }
this.videoTexture.options = {
source: glTexture,
w: this.videoEl.width,
h: this.videoEl.height,
}

this.videoView.w = this.videoEl.width / this.stage.getRenderPrecision()
this.videoView.h = this.videoEl.height / this.stage.getRenderPrecision()
Expand Down Expand Up @@ -148,29 +151,24 @@ export default () => {

position(top, left) {
this.videoView.patch({
smooth: {
x: left,
y: top,
},
x: left,
y: top,
})
}

size(width, height) {
this.videoView.patch({
smooth: {
w: width,
h: height,
},
w: width,
h: height,
})
}

show() {
this.videoView.setSmooth('alpha', 1)
this.videoView.alpha = 1
}

hide() {
this.videoView.setSmooth('alpha', 0)
this.videoView.alpha = 0
}
}
}

0 comments on commit 33ee729

Please sign in to comment.