videocontext
Advanced tools
Comparing version 0.8.0 to 0.9.0
@@ -33,3 +33,3 @@ { | ||
"undocumentLines": [ | ||
713, | ||
719, | ||
39 | ||
@@ -36,0 +36,0 @@ ] |
{ | ||
"name": "videocontext", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "A WebGL & HTML5 graph based video composition library", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
{ | ||
"name": "videocontext", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"description": "A WebGL & HTML5 graph based video composition library", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -13,3 +13,2 @@ //Matthew Shotton, R&D User Experience,© BBC 2015 | ||
if (this._element !== undefined){ | ||
this._triggerCallbacks("loaded"); | ||
return; | ||
@@ -16,0 +15,0 @@ } |
@@ -25,3 +25,3 @@ //Matthew Shotton, R&D User Experience,© BBC 2015 | ||
_load(){ | ||
super._load(); | ||
//super._load(); | ||
if (this._element !== undefined){ | ||
@@ -36,5 +36,5 @@ this._element.loop = this._loopElement; | ||
} | ||
if(this._ready !== true) this._triggerCallbacks("loaded"); | ||
this._ready = true; | ||
this._playbackRateUpdated = true; | ||
this._triggerCallbacks("loaded"); | ||
@@ -52,3 +52,3 @@ } else{ | ||
this._playbackRateUpdated = true; | ||
this._triggerCallbacks("load"); | ||
} | ||
@@ -55,0 +55,0 @@ this._element.currentTime = this._sourceOffset; |
@@ -41,7 +41,7 @@ //Matthew Shotton, R&D User Experience,© BBC 2015 | ||
/** | ||
* Initialise the VideoContext and render to the specific canvas. | ||
* Initialise the VideoContext and render to the specific canvas. A 2nd parameter can be passed to the constructor which is a function that get's called if the VideoContext fails to initialise. | ||
* | ||
* @example | ||
* var canvasElement = document.getElemenyById("canvas"); | ||
* var ctx = new VideoContext(canvasElement); | ||
* var ctx = new VideoContext(canvasElement, function(){console.error("Sorry, your browser dosen\'t support WebGL");}); | ||
* var videoNode = ctx.createVideoSourceNode("video.mp4"); | ||
@@ -54,5 +54,11 @@ * videoNode.connect(ctx.destination); | ||
*/ | ||
constructor(canvas){ | ||
constructor(canvas, initErrorCallback){ | ||
this._canvas = canvas; | ||
this._gl = canvas.getContext("experimental-webgl", { preserveDrawingBuffer: true, alpha: false }); | ||
if(this._gl === null){ | ||
console.error("Failed to intialise WebGL."); | ||
if(initErrorCallback)initErrorCallback(); | ||
return; | ||
} | ||
this._renderGraph = new RenderGraph(); | ||
@@ -59,0 +65,0 @@ this._sourceNodes = []; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
8701036
192782