videocontext
Advanced tools
Comparing version 0.14.1 to 0.15.0
{ | ||
"name": "videocontext", | ||
"version": "0.14.1", | ||
"version": "0.15.0", | ||
"description": "A WebGL & HTML5 graph based video composition library", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -28,2 +28,3 @@ //Matthew Shotton, R&D User Experience,© BBC 2015 | ||
this._loadCalled = false; | ||
this._stretchPaused = false; | ||
this._texture = createElementTexutre(gl); | ||
@@ -109,2 +110,10 @@ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0])); | ||
set stretchPaused(stretchPaused){ | ||
this._stretchPaused = stretchPaused; | ||
} | ||
get stretchPaused(){ | ||
return this._stretchPaused; | ||
} | ||
_load(){ | ||
@@ -235,2 +244,3 @@ if (!this._loadCalled){ | ||
this._stopTime = this._currentTime + time; | ||
this._stretchPaused = false; | ||
this._triggerCallbacks("durationchange", this.duration); | ||
@@ -259,2 +269,3 @@ return true; | ||
this._stopTime = time; | ||
this._stretchPaused = false; | ||
this._triggerCallbacks("durationchange", this.duration); | ||
@@ -308,2 +319,3 @@ return true; | ||
this._rendered = true; | ||
let timeDelta = currentTime - this._currentTime; | ||
@@ -340,2 +352,5 @@ //update the current time | ||
updateTexture(this._gl, this._texture, this._element); | ||
if(this._stretchPaused){ | ||
this._stopTime += timeDelta; | ||
} | ||
} | ||
@@ -342,0 +357,0 @@ |
@@ -14,2 +14,3 @@ //Matthew Shotton, R&D User Experience,© BBC 2015 | ||
this._loopElement = false; | ||
this._isElementPlaying = false; | ||
if (this._attributes.loop){ | ||
@@ -25,2 +26,13 @@ this._loopElement = this._attributes.loop; | ||
set stretchPaused(stretchPaused){ | ||
super.stretchPaused = stretchPaused; | ||
if (this._stretchPaused){ | ||
this._element.pause(); | ||
} else{ | ||
if(this._state === SOURCENODESTATE.playing){ | ||
this._element.play(); | ||
} | ||
} | ||
} | ||
get playbackRate(){ | ||
@@ -110,6 +122,10 @@ return this._playbackRate; | ||
} | ||
this._element.play(); | ||
if (!this._isElementPlaying){ | ||
this._element.play(); | ||
this._isElementPlaying = true; | ||
} | ||
return true; | ||
} else if (this._state === SOURCENODESTATE.paused){ | ||
this._element.pause(); | ||
this._isElementPlaying = false; | ||
return true; | ||
@@ -119,2 +135,3 @@ } | ||
this._element.pause(); | ||
this._isElementPlaying = false; | ||
this._destroy(); | ||
@@ -127,3 +144,6 @@ return false; | ||
super.clearTimelineState(); | ||
if (this._element !== undefined) this._element.pause(); | ||
if (this._element !== undefined) { | ||
this._element.pause(); | ||
this._isElementPlaying = false; | ||
} | ||
this._destroy(); | ||
@@ -130,0 +150,0 @@ } |
@@ -396,3 +396,3 @@ //Matthew Shotton, R&D User Experience,© BBC 2015 | ||
createImageSourceNode(src, sourceOffset=0, preloadTime=4){ | ||
let imageNode = new ImageNode(src, this._gl, this._renderGraph, this._currentTime, this._playbackRate, sourceOffset, preloadTime); | ||
let imageNode = new ImageNode(src, this._gl, this._renderGraph, this._currentTime, preloadTime); | ||
this._sourceNodes.push(imageNode); | ||
@@ -408,3 +408,3 @@ return imageNode; | ||
createCanvasSourceNode(canvas, sourceOffset=0, preloadTime=4){ | ||
let canvasNode = new CanvasNode(canvas, this._gl, this._renderGraph, this._currentTime, this._playbackRate, sourceOffset, preloadTime); | ||
let canvasNode = new CanvasNode(canvas, this._gl, this._renderGraph, this._currentTime, preloadTime); | ||
this._sourceNodes.push(canvasNode); | ||
@@ -411,0 +411,0 @@ return canvasNode; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
193111
8710342
95