From 7c2bd10153a8c5e0e6bba59037405d4db9bc4648 Mon Sep 17 00:00:00 2001 From: Peter Taylour Date: Fri, 9 Mar 2018 11:00:14 +0000 Subject: [PATCH] build in prep for release --- dist/videocontext.js | 4 ++-- dist/videocontext.js.map | 2 +- docs/api/SourceNodes_canvasnode.js.html | 6 +++--- docs/api/SourceNodes_imagenode.js.html | 4 ++-- docs/dist/videocontext.js | 4 ++-- docs/dist/videocontext.js.map | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dist/videocontext.js b/dist/videocontext.js index ce45d505..b9aeaa08 100644 --- a/dist/videocontext.js +++ b/dist/videocontext.js @@ -4609,7 +4609,7 @@ return /******/ (function(modules) { // webpackBootstrap _get(Object.getPrototypeOf(ImageNode.prototype), "_update", this).call(this, currentTime); } - if (this._startTime - this._currentTime < this._preloadTime && this._state !== _sourcenode.SOURCENODESTATE.waiting && this._state !== _sourcenode.SOURCENODESTATE.ended) this._load(); + if (this._startTime - this._currentTime <= this._preloadTime && this._state !== _sourcenode.SOURCENODESTATE.waiting && this._state !== _sourcenode.SOURCENODESTATE.ended) this._load(); if (this._state === _sourcenode.SOURCENODESTATE.playing) { return true; @@ -4706,7 +4706,7 @@ return /******/ (function(modules) { // webpackBootstrap value: function _update(currentTime) { //if (!super._update(currentTime)) return false; _get(Object.getPrototypeOf(CanvasNode.prototype), "_update", this).call(this, currentTime); - if (this._startTime - this._currentTime < this._preloadTime && this._state !== _sourcenode.SOURCENODESTATE.waiting && this._state !== _sourcenode.SOURCENODESTATE.ended) this._load(); + if (this._startTime - this._currentTime <= this._preloadTime && this._state !== _sourcenode.SOURCENODESTATE.waiting && this._state !== _sourcenode.SOURCENODESTATE.ended) this._load(); if (this._state === _sourcenode.SOURCENODESTATE.playing) { return true; diff --git a/dist/videocontext.js.map b/dist/videocontext.js.map index 372e715b..919381d6 100644 --- a/dist/videocontext.js.map +++ b/dist/videocontext.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 6a234b9f0d7948648942","webpack:///./src/videocontext.js","webpack:///./src/SourceNodes/videonode.js","webpack:///./src/SourceNodes/sourcenode.js","webpack:///./src/utils.js","webpack:///./src/Definitions/definitions.js","webpack:///./src/Definitions/aaf_video_scale.js","webpack:///./src/Definitions/crossfade.js","webpack:///./src/Definitions/horizontalWipe.js","webpack:///./src/Definitions/verticalWipe.js","webpack:///./src/Definitions/randomDissolve.js","webpack:///./src/Definitions/toColorAndBackFade.js","webpack:///./src/Definitions/starWipe.js","webpack:///./src/Definitions/combine.js","webpack:///./src/Definitions/colorThreshold.js","webpack:///./src/Definitions/monochrome.js","webpack:///./src/Definitions/horizontalBlur.js","webpack:///./src/Definitions/verticalBlur.js","webpack:///./src/Definitions/aaf_video_flop.js","webpack:///./src/Definitions/aaf_video_flip.js","webpack:///./src/Definitions/aaf_video_position.js","webpack:///./src/Definitions/aaf_video_crop.js","webpack:///./src/Definitions/staticDissolve.js","webpack:///./src/Definitions/staticEffect.js","webpack:///./src/Definitions/dreamfade.js","webpack:///./src/Definitions/opacity.js","webpack:///./src/Definitions/crop.js","webpack:///./src/graphnode.js","webpack:///./src/SourceNodes/imagenode.js","webpack:///./src/SourceNodes/canvasnode.js","webpack:///./src/ProcessingNodes/compositingnode.js","webpack:///./src/ProcessingNodes/processingnode.js","webpack:///./src/exceptions.js","webpack:///./src/DestinationNode/destinationnode.js","webpack:///./src/ProcessingNodes/effectnode.js","webpack:///./src/ProcessingNodes/transitionnode.js","webpack:///./src/rendergraph.js","webpack:///./src/videoelementcache.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;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C,OAAO,CAAC,CAAC;AAC7B,iBAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;AAClC,oBAAO,OAAO,CAAC;UAClB;;;cAES,eAAE;AACR,oBAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;UAChC;;;cAES,eAAE;AACR,iBAAI,KAAK,GAAG,CAAC,CAAC;;;;;;AACd,uCAAoB,IAAI,CAAC,SAAS,mIAAE;yBAA3B,OAAO;;;AAEZ,yBAAI,CAAC,OAAO,CAAC,GAAG,KAAK,EAAE,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAM,OAAO,CAAC,SAAS,IAAI,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC;kBACjJ;;;;;;;;;;;;;;;;AACD,oBAAO,KAAK,CAAC;UAChB;;;YA9DC,iBAAiB;;;sBAkER,iBAAiB","file":"videocontext.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VideoContext\"] = factory();\n\telse\n\t\troot[\"VideoContext\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 6a234b9f0d7948648942","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport VideoNode from \"./SourceNodes/videonode.js\";\nimport ImageNode from \"./SourceNodes/imagenode.js\";\nimport CanvasNode from \"./SourceNodes/canvasnode.js\";\nimport { SOURCENODESTATE } from \"./SourceNodes/sourcenode.js\";\nimport CompositingNode from \"./ProcessingNodes/compositingnode.js\";\nimport DestinationNode from \"./DestinationNode/destinationnode.js\";\nimport EffectNode from \"./ProcessingNodes/effectnode.js\";\nimport TransitionNode from \"./ProcessingNodes/transitionnode.js\";\nimport RenderGraph from \"./rendergraph.js\";\nimport VideoElementCache from \"./videoelementcache.js\";\nimport { createSigmaGraphDataFromRenderGraph, visualiseVideoContextTimeline, visualiseVideoContextGraph, createControlFormForNode, UpdateablesManager, exportToJSON, importSimpleEDL, snapshot, generateRandomId } from \"./utils.js\";\nimport DEFINITIONS from \"./Definitions/definitions.js\";\n\nlet updateablesManager = new UpdateablesManager();\n\n/**\n * VideoContext.\n * @module VideoContext\n */\nexport default class VideoContext{\n /**\n * 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.\n *\n * @param {Canvas} canvas - the canvas element to render the output to.\n * @param {function} initErrorCallback - a callback for if initialising the canvas failed.\n * @param {Object} options - a nuber of custom options which can be set on the VideoContext, generally best left as default.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement, function(){console.error(\"Sorry, your browser dosen\\'t support WebGL\");});\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(10);\n * ctx.play();\n *\n */\n constructor(canvas, initErrorCallback, options={\"preserveDrawingBuffer\":true, \"manualUpdate\":false, \"endOnLastSourceEnd\":true, useVideoElementCache:true, videoElementCacheSize:6, webglContextAttributes: {preserveDrawingBuffer: true, alpha: false }}){\n this._canvas = canvas;\n let manualUpdate = false;\n this.endOnLastSourceEnd = true;\n let webglContextAttributes = {preserveDrawingBuffer: true, alpha: false };\n\n if (\"manualUpdate\" in options) manualUpdate = options.manualUpdate;\n if (\"endOnLastSourceEnd\" in options) this._endOnLastSourceEnd = options.endOnLastSourceEnd;\n if (\"webglContextAttributes\" in options) webglContextAttributes = options.webglContextAttributes;\n\n if (webglContextAttributes.alpha === undefined) webglContextAttributes.alpha = false;\n if (webglContextAttributes.alpha === true){\n console.error(\"webglContextAttributes.alpha must be false for correct opeation\");\n }\n\n\n this._gl = canvas.getContext(\"experimental-webgl\", webglContextAttributes);\n if(this._gl === null){\n console.error(\"Failed to intialise WebGL.\");\n if(initErrorCallback)initErrorCallback();\n return;\n }\n\n // Initialise the video element cache\n if(options.useVideoElementCache === undefined) options.useVideoElementCache = true;\n this._useVideoElementCache = options.useVideoElementCache;\n if (this._useVideoElementCache){\n if (!options.videoElementCacheSize) options.videoElementCacheSize = 5;\n this._videoElementCache = new VideoElementCache(options.videoElementCacheSize);\n }\n \n // Create a unique ID for this VideoContext which can be used in the debugger.\n if(this._canvas.id) {\n if (typeof this._canvas.id === \"string\" || this._canvas.id instanceof String){\n this._id = canvas.id;\n }\n }\n if(this._id === undefined) this._id = generateRandomId();\n if (window.__VIDEOCONTEXT_REFS__ === undefined) window.__VIDEOCONTEXT_REFS__ = {};\n window.__VIDEOCONTEXT_REFS__[this._id] = this;\n\n\n this._renderGraph = new RenderGraph();\n this._sourceNodes = [];\n this._processingNodes = [];\n this._timeline = [];\n this._currentTime = 0;\n this._state = VideoContext.STATE.PAUSED;\n this._playbackRate = 1.0;\n this._volume = 1.0;\n this._sourcesPlaying = undefined;\n this._destinationNode = new DestinationNode(this._gl, this._renderGraph);\n\n this._callbacks = new Map();\n this._callbacks.set(\"stalled\", []);\n this._callbacks.set(\"update\", []);\n this._callbacks.set(\"ended\", []);\n this._callbacks.set(\"content\", []);\n this._callbacks.set(\"nocontent\", []);\n\n this._timelineCallbacks = [];\n\n if(!manualUpdate){\n updateablesManager.register(this);\n }\n }\n\n /**\n * Reurns an ID assigned to the VideoContext instance. This will either be the same id as the underlying canvas element,\n * or a uniquley generated one.\n */\n get id(){\n return this._id;\n }\n\n /**\n * Set the ID of the VideoContext instance. This should be unique.\n */\n set id(newID){\n delete window.__VIDEOCONTEXT_REFS__[this._id];\n if (window.__VIDEOCONTEXT_REFS__[newID] !== undefined) console.warn(\"Warning; setting id to that of an existing VideoContext instance.\");\n window.__VIDEOCONTEXT_REFS__[newID] = this;\n this._id = newID;\n }\n\n /**\n * Register a callback to happen at a specific point in time.\n * @param {number} time - the time at which to trigger the callback.\n * @param {Function} func - the callback to register.\n * @param {number} ordering - the order in which to call the callback if more than one is registered for the same time.\n */\n registerTimelineCallback(time, func, ordering= 0){\n this._timelineCallbacks.push({\"time\":time, \"func\":func, \"ordering\":ordering});\n }\n\n\n /**\n * Unregister a callback which happens at a specific point in time.\n * @param {Function} func - the callback to unregister.\n */\n unregisterTimelineCallback(func){\n let toRemove = [];\n for(let callback of this._timelineCallbacks){\n if (callback.func === func){\n toRemove.push(callback);\n }\n }\n for (let callback of toRemove){\n let index = this._timelineCallbacks.indexOf(callback);\n this._timelineCallbacks.splice(index, 1);\n }\n }\n\n /**\n * Regsiter a callback to listen to one of the following events: \"stalled\", \"update\", \"ended\", \"content\", \"nocontent\"\n *\n * \"stalled\" happend anytime playback is stopped due to unavailbale data for playing assets (i.e video still loading)\n * . \"update\" is called any time a frame is rendered to the screen. \"ended\" is called once plackback has finished\n * (i.e ctx.currentTime == ctx.duration). \"content\" is called a the start of a time region where there is content\n * playing out of one or more sourceNodes. \"nocontent\" is called at the start of any time region where the\n * VideoContext is still playing, but there are currently no activly playing soureces.\n *\n * @param {String} type - the event to register against (\"stalled\", \"update\", or \"ended\").\n * @param {Function} func - the callback to register.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * ctx.registerCallback(\"stalled\", function(){console.log(\"Playback stalled\");});\n * ctx.registerCallback(\"update\", function(){console.log(\"new frame\");});\n * ctx.registerCallback(\"ended\", function(){console.log(\"Playback ended\");});\n */\n registerCallback(type, func){\n if (!this._callbacks.has(type)) return false;\n this._callbacks.get(type).push(func);\n }\n\n /**\n * Remove a previously registed callback\n *\n * @param {Function} func - the callback to remove.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n *\n * //the callback\n * var updateCallback = function(){console.log(\"new frame\")};\n *\n * //register the callback\n * ctx.registerCallback(\"update\", updateCallback);\n * //then unregister it\n * ctx.unregisterCallback(updateCallback);\n *\n */\n unregisterCallback(func){\n for(let funcArray of this._callbacks.values()){\n let index = funcArray.indexOf(func);\n if (index !== -1){\n funcArray.splice(index, 1);\n return true;\n }\n }\n return false;\n }\n\n _callCallbacks(type){\n let funcArray = this._callbacks.get(type);\n for (let func of funcArray){\n func(this._currentTime);\n }\n }\n\n /**\n * Get the canvas that the VideoContext is using.\n *\n * @return {HTMLElement} The canvas that the VideoContext is using.\n *\n */\n get element(){\n return this._canvas;\n }\n\n /**\n * Get the current state.\n *\n * This will be either\n * - VideoContext.STATE.PLAYING: current sources on timeline are active\n * - VideoContext.STATE.PAUSED: all sources are paused\n * - VideoContext.STATE.STALLED: one or more sources is unable to play\n * - VideoContext.STATE.ENDED: all sources have finished playing\n * - VideoContext.STATE.BROKEN: the render graph is in a broken state\n * @return {number} The number representing the state.\n *\n */\n get state(){\n return this._state;\n }\n\n /**\n * Set the progress through the internal timeline.\n * Setting this can be used as a way to implement a scrubaable timeline.\n *\n * @param {number} currentTime - this is the currentTime to set the context to.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(20);\n * ctx.currentTime = 10; // seek 10 seconds in\n * ctx.play();\n *\n */\n set currentTime(currentTime){\n if (currentTime < this.duration && this._state === VideoContext.STATE.ENDED) this._state = VideoContext.STATE.PAUSED;\n\n if (typeof currentTime === \"string\" || currentTime instanceof String){\n currentTime = parseFloat(currentTime);\n }\n\n for (let i = 0; i < this._sourceNodes.length; i++) {\n this._sourceNodes[i]._seek(currentTime);\n }\n for (let i = 0; i < this._processingNodes.length; i++) {\n this._processingNodes[i]._seek(currentTime);\n }\n this._currentTime = currentTime;\n }\n\n /**\n * Get how far through the internal timeline has been played.\n *\n * Getting this value will give the current playhead position. Can be used for updating timelines.\n * @return {number} The time in seconds through the current playlist.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(10);\n * ctx.play();\n * setTimeout(function(){console.log(ctx.currentTime);},1000); //should print roughly 1.0\n *\n */\n get currentTime(){\n return this._currentTime;\n }\n\n /**\n * Get the time at which the last node in the current internal timeline finishes playing.\n *\n * @return {number} The end time in seconds of the last video node to finish playing.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * console.log(ctx.duration); //prints 0\n *\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(10);\n *\n * console.log(ctx.duration); //prints 10\n *\n * ctx.play();\n */\n get duration(){\n let maxTime = 0;\n for (let i = 0; i < this._sourceNodes.length; i++) {\n if (this._sourceNodes[i].state !== SOURCENODESTATE.waiting &&this._sourceNodes[i]._stopTime > maxTime){\n maxTime = this._sourceNodes[i]._stopTime;\n }\n }\n return maxTime;\n }\n\n\n /**\n * Get the final node in the render graph which represents the canvas to display content on to.\n *\n * This proprety is read-only and there can only ever be one destination node. Other nodes can connect to this but you cannot connect this node to anything.\n *\n * @return {DestinationNode} A graph node represnting the canvas to display the content on.\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.start(0);\n * videoNode.stop(10);\n * videoNode.connect(ctx.destination);\n *\n */\n get destination(){\n return this._destinationNode;\n }\n\n /**\n * Set the playback rate of the VideoContext instance.\n * This will alter the playback speed of all media elements played through the VideoContext.\n *\n * @param {number} rate - this is the playback rate.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.start(0);\n * videoNode.stop(10);\n * videoNode.connect(ctx.destination);\n * ctx.playbackRate = 2;\n * ctx.play(); // Double playback rate means this will finish playing in 5 seconds.\n */\n set playbackRate(rate){\n if (rate <= 0){\n throw new RangeError(\"playbackRate must be greater than 0\");\n }\n for (let node of this._sourceNodes) {\n if (node.constructor.name === \"VideoNode\"){\n node._globalPlaybackRate = rate;\n node._playbackRateUpdated = true;\n }\n }\n this._playbackRate = rate;\n }\n\n\n /**\n * Return the current playbackRate of the video context.\n * @return {number} A value representing the playbackRate. 1.0 by default.\n */\n get playbackRate(){\n return this._playbackRate;\n }\n\n\n /**\n * Set the volume of all VideoNode's created in the VideoContext.\n * @param {number} volume - the volume to apply to the video nodes.\n */\n set volume(vol){\n for (let node of this._sourceNodes){\n if(node instanceof VideoNode){\n node.volume = vol;\n }\n }\n this._volume = vol;\n }\n\n /**\n * Return the current volume of the video context.\n * @return {number} A value representing the volume. 1.0 by default.\n */\n get volume(){\n return this._volume;\n }\n\n /**\n * Start the VideoContext playing\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(10);\n * ctx.play();\n */\n play(){\n console.debug(\"VideoContext - playing\");\n //Initialise the video elemnt cache\n if (this._videoElementCache)this._videoElementCache.init();\n // set the state.\n this._state = VideoContext.STATE.PLAYING;\n return true;\n }\n\n /**\n * Pause playback of the VideoContext\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(20);\n * ctx.currentTime = 10; // seek 10 seconds in\n * ctx.play();\n * setTimeout(function(){ctx.pause();}, 1000); //pause playback after roughly one second.\n */\n pause(){\n console.debug(\"VideoContext - pausing\");\n this._state = VideoContext.STATE.PAUSED;\n return true;\n }\n\n\n /**\n * Create a new node representing a video source\n *\n * @param {string|Video} - The URL or video element to create the video from.\n * @sourceOffset {number} - Offset into the start of the source video to start playing from.\n * @preloadTime {number} - How many seconds before the video is to be played to start loading it.\n * @videoElementAttributes {Object} - A dictionary of attributes to map onto the underlying video element.\n * @return {VideoNode} A new video node.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var videoElement = document.getElementById(\"video\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(videoElement);\n */\n video(src, sourceOffset=0, preloadTime=4, videoElementAttributes={}){\n let videoNode = new VideoNode(src, this._gl, this._renderGraph, this._currentTime, this._playbackRate, sourceOffset, preloadTime, this._videoElementCache, videoElementAttributes);\n this._sourceNodes.push(videoNode);\n return videoNode;\n }\n\n /**\n * @depricated\n */\n createVideoSourceNode(src, sourceOffset=0, preloadTime=4, videoElementAttributes={}){\n this._depricate(\"Warning: createVideoSourceNode will be depricated in v1.0, please switch to using VideoContext.video()\");\n return this.video(src, sourceOffset, preloadTime, videoElementAttributes);\n }\n\n\n /**\n * Create a new node representing an image source\n * @param {string|Image} src - The url or image element to create the image node from.\n * @param {number} [preloadTime] - How long before a node is to be displayed to attmept to load it.\n * @param {Object} [imageElementAttributes] - Any attributes to be given to the underlying image element.\n * @return {ImageNode} A new image node.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var imageNode = ctx.image(\"image.png\");\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var imageElement = document.getElementById(\"image\");\n * var ctx = new VideoContext(canvasElement);\n * var imageNode = ctx.image(imageElement);\n */\n image(src, preloadTime=4, imageElementAttributes={}){\n let imageNode = new ImageNode(src, this._gl, this._renderGraph, this._currentTime, preloadTime, imageElementAttributes);\n this._sourceNodes.push(imageNode);\n return imageNode;\n }\n\n /**\n * @depricated\n */\n createImageSourceNode(src, sourceOffset=0, preloadTime=4, imageElementAttributes={}){\n this._depricate(\"Warning: createImageSourceNode will be depricated in v1.0, please switch to using VideoContext.image()\");\n return this.image(src, sourceOffset, preloadTime, imageElementAttributes);\n }\n\n\n /**\n * Create a new node representing a canvas source\n * @param {Canvas} src - The canvas element to create the canvas node from.\n * @return {CanvasNode} A new canvas node.\n */\n canvas(canvas){\n let canvasNode = new CanvasNode(canvas, this._gl, this._renderGraph, this._currentTime);\n this._sourceNodes.push(canvasNode);\n return canvasNode;\n }\n\n /**\n * @depricated\n */\n createCanvasSourceNode(canvas, sourceOffset=0, preloadTime=4){\n this._depricate(\"Warning: createCanvasSourceNode will be depricated in v1.0, please switch to using VideoContext.canvas()\");\n return this.canvas(canvas, sourceOffset, preloadTime);\n }\n\n\n /**\n * Create a new effect node.\n * @param {Object} definition - this is an object defining the shaders, inputs, and properties of the compositing node to create. Builtin definitions can be found by accessing VideoContext.DEFINITIONS.\n * @return {EffectNode} A new effect node created from the passed definition\n */\n effect(definition){\n let effectNode = new EffectNode(this._gl, this._renderGraph, definition);\n this._processingNodes.push(effectNode);\n return effectNode;\n }\n\n /**\n * @depricated\n */\n createEffectNode(definition){\n this._depricate(\"Warning: createEffectNode will be depricated in v1.0, please switch to using VideoContext.effect()\");\n return this.effect(definition);\n }\n\n /**\n * Create a new compositiing node.\n *\n * Compositing nodes are used for operations such as combining multiple video sources into a single track/connection for further processing in the graph.\n *\n * A compositing node is slightly different to other processing nodes in that it only has one input in it's definition but can have unlimited connections made to it.\n * The shader in the definition is run for each input in turn, drawing them to the output buffer. This means there can be no interaction between the spearte inputs to a compositing node, as they are individually processed in seperate shader passes.\n *\n * @param {Object} definition - this is an object defining the shaders, inputs, and properties of the compositing node to create. Builtin definitions can be found by accessing VideoContext.DEFINITIONS\n *\n * @return {CompositingNode} A new compositing node created from the passed definition.\n *\n * @example\n *\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n *\n * //A simple compositing node definition which just renders all the inputs to the output buffer.\n * var combineDefinition = {\n * vertexShader : \"\\\n * attribute vec2 a_position;\\\n * attribute vec2 a_texCoord;\\\n * varying vec2 v_texCoord;\\\n * void main() {\\\n * gl_Position = vec4(vec2(2.0,2.0)*vec2(1.0, 1.0), 0.0, 1.0);\\\n * v_texCoord = a_texCoord;\\\n * }\",\n * fragmentShader : \"\\\n * precision mediump float;\\\n * uniform sampler2D u_image;\\\n * uniform float a;\\\n * varying vec2 v_texCoord;\\\n * varying float v_progress;\\\n * void main(){\\\n * vec4 color = texture2D(u_image, v_texCoord);\\\n * gl_FragColor = color;\\\n * }\",\n * properties:{\n * \"a\":{type:\"uniform\", value:0.0},\n * },\n * inputs:[\"u_image\"]\n * };\n * //Create the node, passing in the definition.\n * var trackNode = videoCtx.compositor(combineDefinition);\n *\n * //create two videos which will play at back to back\n * var videoNode1 = ctx.video(\"video1.mp4\");\n * videoNode1.play(0);\n * videoNode1.stop(10);\n * var videoNode2 = ctx.video(\"video2.mp4\");\n * videoNode2.play(10);\n * videoNode2.stop(20);\n *\n * //Connect the nodes to the combine node. This will give a single connection representing the two videos which can\n * //be connected to other effects such as LUTs, chromakeyers, etc.\n * videoNode1.connect(trackNode);\n * videoNode2.connect(trackNode);\n *\n * //Don't do anything exciting, just connect it to the output.\n * trackNode.connect(ctx.destination);\n *\n */\n compositor(definition){\n let compositingNode = new CompositingNode(this._gl, this._renderGraph, definition);\n this._processingNodes.push(compositingNode);\n return compositingNode;\n }\n\n /**\n * @depricated\n */\n createCompositingNode(definition){\n this._depricate(\"Warning: createCompositingNode will be depricated in v1.0, please switch to using VideoContext.compositor()\");\n return this.compositor(definition);\n }\n\n\n\n /**\n * Create a new transition node.\n *\n * Transistion nodes are a type of effect node which have parameters which can be changed as events on the timeline.\n *\n * For example a transition node which cross-fades between two videos could have a \"mix\" property which sets the\n * progress through the transistion. Rather than having to write your own code to adjust this property at specfic\n * points in time a transition node has a \"transition\" function which takes a startTime, stopTime, targetValue, and a\n * propertyName (which will be \"mix\"). This will linearly interpolate the property from the curernt value to\n * tragetValue between the startTime and stopTime.\n *\n * @param {Object} definition - this is an object defining the shaders, inputs, and properties of the transition node to create.\n * @return {TransitionNode} A new transition node created from the passed definition.\n * @example\n *\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n *\n * //A simple cross-fade node definition which cross-fades between two videos based on the mix property.\n * var crossfadeDefinition = {\n * vertexShader : \"\\\n * attribute vec2 a_position;\\\n * attribute vec2 a_texCoord;\\\n * varying vec2 v_texCoord;\\\n * void main() {\\\n * gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n * v_texCoord = a_texCoord;\\\n * }\",\n * fragmentShader : \"\\\n * precision mediump float;\\\n * uniform sampler2D u_image_a;\\\n * uniform sampler2D u_image_b;\\\n * uniform float mix;\\\n * varying vec2 v_texCoord;\\\n * varying float v_mix;\\\n * void main(){\\\n * vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n * vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n * color_a[0] *= mix;\\\n * color_a[1] *= mix;\\\n * color_a[2] *= mix;\\\n * color_a[3] *= mix;\\\n * color_b[0] *= (1.0 - mix);\\\n * color_b[1] *= (1.0 - mix);\\\n * color_b[2] *= (1.0 - mix);\\\n * color_b[3] *= (1.0 - mix);\\\n * gl_FragColor = color_a + color_b;\\\n * }\",\n * properties:{\n * \"mix\":{type:\"uniform\", value:0.0},\n * },\n * inputs:[\"u_image_a\",\"u_image_b\"]\n * };\n *\n * //Create the node, passing in the definition.\n * var transitionNode = videoCtx.transition(crossfadeDefinition);\n *\n * //create two videos which will overlap by two seconds\n * var videoNode1 = ctx.video(\"video1.mp4\");\n * videoNode1.play(0);\n * videoNode1.stop(10);\n * var videoNode2 = ctx.video(\"video2.mp4\");\n * videoNode2.play(8);\n * videoNode2.stop(18);\n *\n * //Connect the nodes to the transistion node.\n * videoNode1.connect(transitionNode);\n * videoNode2.connect(transitionNode);\n *\n * //Set-up a transition which happens at the crossover point of the playback of the two videos\n * transitionNode.transition(8,10,1.0,\"mix\");\n *\n * //Connect the transition node to the output\n * transitionNode.connect(ctx.destination);\n *\n * //start playback\n * ctx.play();\n */\n transition(definition){\n let transitionNode = new TransitionNode(this._gl, this._renderGraph, definition);\n this._processingNodes.push(transitionNode);\n return transitionNode;\n }\n\n /**\n * @depricated\n */\n createTransitionNode(definition){\n this._depricate(\"Warning: createTransitionNode will be depricated in v1.0, please switch to using VideoContext.transition()\");\n return this.transition(definition);\n }\n\n\n\n\n _isStalled(){\n for (let i = 0; i < this._sourceNodes.length; i++) {\n let sourceNode = this._sourceNodes[i];\n if (!sourceNode._isReady()){\n return true;\n }\n }\n return false;\n }\n\n\n /**\n * This allows manual calling of the update loop of the videoContext.\n *\n * @param {Number} dt - The difference in seconds between this and the previous calling of update.\n * @example\n *\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement, undefined, {\"manualUpdate\" : true});\n *\n * var previousTime;\n * function update(time){\n * if (previousTime === undefined) previousTime = time;\n * var dt = (time - previousTime)/1000;\n * ctx.update(dt);\n * previousTime = time;\n * requestAnimationFrame(update);\n * }\n * update();\n *\n */\n update(dt){\n this._update(dt);\n }\n\n\n _update(dt){\n //Remove any destroyed nodes\n this._sourceNodes = this._sourceNodes.filter(sourceNode=>{\n if (!sourceNode.destroyed) return sourceNode;\n });\n\n this._processingNodes = this._processingNodes.filter(processingNode=>{\n if (!processingNode.destroyed) return processingNode;\n });\n\n\n if (this._state === VideoContext.STATE.PLAYING || this._state === VideoContext.STATE.STALLED || this._state === VideoContext.STATE.PAUSED) {\n this._callCallbacks(\"update\");\n\n if (this._state !== VideoContext.STATE.PAUSED){\n if (this._isStalled()){\n this._callCallbacks(\"stalled\");\n this._state = VideoContext.STATE.STALLED;\n }else{\n this._state = VideoContext.STATE.PLAYING;\n }\n }\n\n if(this._state === VideoContext.STATE.PLAYING){\n //Handle timeline callbacks.\n let activeCallbacks = new Map();\n for(let callback of this._timelineCallbacks){\n if (callback.time >= this.currentTime && callback.time < (this._currentTime + dt * this._playbackRate)){\n //group the callbacks by time\n if(!activeCallbacks.has(callback.time)) activeCallbacks.set(callback.time, []);\n activeCallbacks.get(callback.time).push(callback);\n }\n }\n\n\n //Sort the groups of callbacks by the times of the groups\n let timeIntervals = Array.from(activeCallbacks.keys());\n timeIntervals.sort(function(a, b){\n return a - b;\n });\n\n for (let t of timeIntervals){\n let callbacks = activeCallbacks.get(t);\n callbacks.sort(function(a,b){\n return a.ordering - b.ordering;\n });\n for(let callback of callbacks){\n callback.func();\n }\n }\n\n this._currentTime += dt * this._playbackRate;\n if(this._currentTime > this.duration && this._endOnLastSourceEnd){\n //Do an update od the sourcenodes in case anything in the \"ended\" callbacks modifes currentTime and sources haven't had a chance to stop.\n for (let i = 0; i < this._sourceNodes.length; i++) {\n this._sourceNodes[i]._update(this._currentTime);\n }\n this._state = VideoContext.STATE.ENDED;\n this._callCallbacks(\"ended\");\n }\n }\n\n let sourcesPlaying = false;\n\n for (let i = 0; i < this._sourceNodes.length; i++) {\n let sourceNode = this._sourceNodes[i];\n\n if(this._state === VideoContext.STATE.STALLED){\n if (sourceNode._isReady() && sourceNode._state === SOURCENODESTATE.playing) sourceNode._pause();\n }\n if(this._state === VideoContext.STATE.PAUSED){\n sourceNode._pause();\n }\n if(this._state === VideoContext.STATE.PLAYING){\n sourceNode._play();\n }\n sourceNode._update(this._currentTime);\n if (sourceNode._state === SOURCENODESTATE.paused || sourceNode._state === SOURCENODESTATE.playing){\n sourcesPlaying = true;\n }\n }\n\n\n if (sourcesPlaying !== this._sourcesPlaying && this._state === VideoContext.STATE.PLAYING){\n if (sourcesPlaying === true){\n this._callCallbacks(\"content\");\n }else{\n this._callCallbacks(\"nocontent\");\n }\n this._sourcesPlaying = sourcesPlaying;\n }\n\n\n /*\n * Itterate the directed acyclic graph using Khan's algorithm (KHAAAAAN!).\n *\n * This has highlighted a bunch of ineffencies in the rendergraph class about how its stores connections.\n * Mainly the fact that to get inputs for a node you have to iterate the full list of connections rather than\n * a node owning it's connections.\n * The trade off with changing this is making/removing connections becomes more costly performance wise, but\n * this is deffinately worth while because getting the connnections is a much more common operation.\n *\n * TL;DR Future matt - refactor this.\n *\n */\n let sortedNodes = [];\n let connections = this._renderGraph.connections.slice();\n let nodes = RenderGraph.getInputlessNodes(connections);\n\n\n while (nodes.length > 0) {\n let node = nodes.pop();\n sortedNodes.push(node);\n for (let edge of RenderGraph.outputEdgesFor(node, connections)){\n let index = connections.indexOf(edge);\n if (index > -1) connections.splice(index, 1);\n if (RenderGraph.inputEdgesFor(edge.destination, connections).length === 0){\n nodes.push(edge.destination);\n }\n }\n }\n\n for (let node of sortedNodes){\n if (this._sourceNodes.indexOf(node) === -1){\n node._update(this._currentTime);\n node._render();\n }\n }\n }\n }\n\n /**\n * Destroy all nodes in the graph and reset the timeline. After calling this any created nodes will be unusable.\n */\n reset(){\n for (let callback of this._callbacks){\n this.unregisterCallback(callback);\n }\n for (let node of this._sourceNodes){\n node.destroy();\n }\n for (let node of this._processingNodes){\n node.destroy();\n }\n this._update(0);\n this._sourceNodes = [];\n this._processingNodes = [];\n this._timeline = [];\n this._currentTime = 0;\n this._state = VideoContext.STATE.PAUSED;\n this._playbackRate = 1.0;\n this._sourcesPlaying = undefined;\n this._callbacks.set(\"stalled\", []);\n this._callbacks.set(\"update\", []);\n this._callbacks.set(\"ended\", []);\n this._callbacks.set(\"content\", []);\n this._callbacks.set(\"nocontent\", []);\n this._timelineCallbacks = [];\n }\n\n _depricate(msg){\n console.log(msg);\n }\n\n static get DEFINITIONS() {\n return DEFINITIONS;\n }\n\n /**\n * Get a JS Object containing the state of the VideoContext instance and all the created nodes.\n */\n snapshot () {\n return snapshot(this);\n }\n}\n\n//playing - all sources are active\n//paused - all sources are paused\n//stalled - one or more sources is unable to play\n//ended - all sources have finished playing\n//broken - the render graph is in a broken state\nVideoContext.STATE = {};\nVideoContext.STATE.PLAYING = 0;\nVideoContext.STATE.PAUSED = 1;\nVideoContext.STATE.STALLED = 2;\nVideoContext.STATE.ENDED = 3;\nVideoContext.STATE.BROKEN = 4;\n\nVideoContext.visualiseVideoContextTimeline = visualiseVideoContextTimeline;\nVideoContext.visualiseVideoContextGraph = visualiseVideoContextGraph;\nVideoContext.createControlFormForNode = createControlFormForNode;\nVideoContext.createSigmaGraphDataFromRenderGraph = createSigmaGraphDataFromRenderGraph;\nVideoContext.exportToJSON = exportToJSON;\nVideoContext.updateablesManager = updateablesManager;\nVideoContext.importSimpleEDL = importSimpleEDL;\n\n\n\n// WEBPACK FOOTER //\n// ./src/videocontext.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport SourceNode, { SOURCENODESTATE } from \"./sourcenode\";\n\nclass VideoNode extends SourceNode {\n /**\n * Initialise an instance of a VideoNode.\n * This should not be called directly, but created through a call to videoContext.createVideoNode();\n */\n constructor(src, gl, renderGraph, currentTime, globalPlaybackRate=1.0, sourceOffset=0, preloadTime = 4, videoElementCache=undefined, attributes = {}){\n super(src, gl, renderGraph, currentTime);\n this._preloadTime = preloadTime;\n this._sourceOffset = sourceOffset;\n this._globalPlaybackRate = globalPlaybackRate;\n this._videoElementCache = videoElementCache;\n this._playbackRate = 1.0;\n this._volume = 1.0;\n this._playbackRateUpdated = true;\n this._attributes = attributes;\n this._loopElement = false;\n this._isElementPlaying = false;\n if (this._attributes.loop){\n this._loopElement = this._attributes.loop;\n }\n this._displayName = \"VideoNode\";\n }\n\n set playbackRate(playbackRate){\n this._playbackRate = playbackRate;\n this._playbackRateUpdated = true;\n }\n\n set stretchPaused(stretchPaused){\n super.stretchPaused = stretchPaused;\n if(this._element){\n if (this._stretchPaused){\n this._element.pause();\n } else{\n if(this._state === SOURCENODESTATE.playing){\n this._element.play();\n }\n }\n }\n }\n\n get stretchPaused(){\n return this._stretchPaused;\n }\n\n get playbackRate(){\n return this._playbackRate;\n }\n\n get elementURL(){\n return this._elementURL;\n }\n\n set volume(volume){\n this._volume = volume;\n if(this._element !== undefined) this._element.volume = this._volume;\n }\n\n _load(){\n super._load();\n if (this._element !== undefined){\n\n for (var key in this._attributes) {\n this._element[key] = this._attributes[key];\n }\n\n if (this._element.readyState > 3 && !this._element.seeking){\n if(this._loopElement === false){\n if (this._stopTime === Infinity || this._stopTime == undefined){\n this._stopTime = this._startTime + this._element.duration;\n this._triggerCallbacks(\"durationchange\", this.duration);\n }\n }\n if(this._ready !== true){\n this._triggerCallbacks(\"loaded\");\n this._playbackRateUpdated = true;\n\n }\n\n this._ready = true;\n\n } else{\n if(this._state !== SOURCENODESTATE.error){\n this._ready = false;\n }\n }\n return;\n }\n if (this._isResponsibleForElementLifeCycle){\n if (this._videoElementCache){\n this._element = this._videoElementCache.get();\n }else{\n this._element = document.createElement(\"video\");\n this._element.setAttribute(\"crossorigin\", \"anonymous\");\n this._element.setAttribute(\"webkit-playsinline\", \"\");\n this._element.setAttribute(\"playsinline\", \"\");\n this._playbackRateUpdated = true;\n }\n this._element.volume = this._volume;\n if (window.MediaStream !== undefined && this._elementURL instanceof MediaStream){\n this._element.srcObject = this._elementURL;\n } else {\n this._element.src = this._elementURL;\n }\n\n for (let key in this._attributes) {\n this._element[key] = this._attributes[key];\n }\n }\n if (this._element){\n let currentTimeOffset = 0;\n if (this._currentTime > this._startTime) currentTimeOffset = this._currentTime - this._startTime;\n this._element.currentTime = this._sourceOffset + currentTimeOffset;\n this._element.onerror = () => {\n if (this._element === undefined) return;\n console.debug(\"Error with element\", this._element);\n this._state = SOURCENODESTATE.error;\n //Event though there's an error ready should be set to true so the node can output transparenn\n this._ready = true;\n this._triggerCallbacks(\"error\");\n };\n }else{\n //If the element doesn't exist for whatever reason enter the error state.\n this._state = SOURCENODESTATE.error;\n this._ready = true;\n this._triggerCallbacks(\"error\");\n }\n }\n\n _unload(){\n super._unload();\n if (this._isResponsibleForElementLifeCycle && this._element !== undefined){\n this._element.src = \"\";\n this._element.srcObject = undefined;\n for (let key in this._attributes){\n this._element.removeAttribute(key);\n }\n this._element = undefined;\n if(!this._videoElementCache) delete this._element;\n }\n this._ready = false;\n this._isElementPlaying = false;\n }\n\n _seek(time){\n super._seek(time);\n if (this.state === SOURCENODESTATE.playing || this.state === SOURCENODESTATE.paused){\n if (this._element === undefined) this._load();\n let relativeTime = this._currentTime - this._startTime + this._sourceOffset;\n this._element.currentTime = relativeTime;\n this._ready = false;\n }\n if((this._state === SOURCENODESTATE.sequenced || this._state === SOURCENODESTATE.ended) && this._element !== undefined){\n this._unload();\n }\n }\n\n _update(currentTime){\n //if (!super._update(currentTime)) return false;\n super._update(currentTime);\n //check if the video has ended\n if(this._element !== undefined){\n if (this._element.ended){\n this._state = SOURCENODESTATE.ended;\n this._triggerCallbacks(\"ended\");\n }\n }\n\n if (this._startTime - this._currentTime <= this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();\n\n if (this._state === SOURCENODESTATE.playing){\n if (this._playbackRateUpdated)\n {\n this._element.playbackRate = this._globalPlaybackRate * this._playbackRate;\n this._playbackRateUpdated = false;\n }\n if (!this._isElementPlaying){\n this._element.play();\n if (this._stretchPaused){\n this._element.pause();\n }\n this._isElementPlaying = true;\n }\n return true;\n } else if (this._state === SOURCENODESTATE.paused){\n this._element.pause();\n this._isElementPlaying = false;\n return true;\n }\n else if (this._state === SOURCENODESTATE.ended && this._element !== undefined){\n this._element.pause();\n if (this._isElementPlaying){\n this._unload();\n }\n return false;\n }\n }\n\n clearTimelineState(){\n super.clearTimelineState();\n if (this._element !== undefined) {\n this._element.pause();\n this._isElementPlaying = false;\n }\n this._unload();\n }\n\n destroy(){\n if (this._element) this._element.pause();\n super.destroy();\n }\n\n}\n\nexport default VideoNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/SourceNodes/videonode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport { updateTexture, clearTexture, createElementTexutre } from \"../utils.js\";\nimport GraphNode from \"../graphnode\";\n\nlet STATE = {\"waiting\":0, \"sequenced\":1, \"playing\":2, \"paused\":3, \"ended\":4, \"error\":5};\n\nclass SourceNode extends GraphNode{\n /**\n * Initialise an instance of a SourceNode.\n * This is the base class for other Nodes which generate media to be passed into the processing pipeline.\n */\n constructor(src, gl, renderGraph, currentTime){\n super(gl,renderGraph, [], true);\n this._element = undefined;\n this._elementURL = undefined;\n this._isResponsibleForElementLifeCycle = true;\n\n if (typeof src === \"string\" || (window.MediaStream !== undefined && src instanceof MediaStream)){\n //create the node from the passed URL or MediaStream\n this._elementURL = src;\n }else{\n //use the passed element to create the SourceNode\n this._element = src;\n this._isResponsibleForElementLifeCycle = false;\n }\n\n this._state = STATE.waiting;\n this._currentTime = currentTime;\n this._startTime = NaN;\n this._stopTime = Infinity;\n this._ready = false;\n this._loadCalled = false;\n this._stretchPaused = false;\n this._texture = createElementTexutre(gl);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));\n this._callbacks = [];\n this._renderPaused = false;\n this._displayName = \"SourceNode\";\n\n }\n\n /**\n * Returns the state of the node.\n * 0 - Waiting, start() has not been called on it yet.\n * 1 - Sequenced, start() has been called but it is not playing yet.\n * 2 - Playing, the node is playing.\n * 3 - Paused, the node is paused.\n * 4 - Ended, playback of the node has finished.\n *\n * @example\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n * console.log(videoNode.state); //will output 0 (for waiting)\n * videoNode.start(5);\n * console.log(videoNode.state); //will output 1 (for sequenced)\n * videoNode.stop(10);\n * ctx.play();\n * console.log(videoNode.state); //will output 2 (for playing)\n * ctx.paused();\n * console.log(videoNode.state); //will output 3 (for paused)\n */\n get state(){\n return this._state;\n }\n\n\n /**\n * Returns the underlying DOM element which represents this source node.\n * Note: If a source node is created with a url rather than passing in an existing element then this will return undefined until the source node preloads the element.\n *\n * @return {Element} The underlying DOM element representing the media for the node. If the lifecycle of the video is owned UNSIGNED_BYTE the node itself, this can return undefined if the element hasn't been loaded yet.\n *\n * @example\n * //Accessing the Element on a VideoNode created via a URL\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n * videoNode.start(0);\n * videoNode.stop(5);\n * //When the node starts playing the element should exist so set it's volume to 0\n * videoNode.regsiterCallback(\"play\", function(){videoNode.element.volume = 0;});\n *\n *\n * @example\n * //Accessing the Element on a VideoNode created via an already existing element\n * var ctx = new VideoContext();\n * var videoElement = document.createElement(\"video\");\n * var videoNode = ctx.createVideoSourceNode(videoElement);\n * videoNode.start(0);\n * videoNode.stop(5);\n * //The elemnt can be accessed any time because it's lifecycle is managed outside of the VideoContext\n * videoNode.element.volume = 0;\n *\n */\n get element(){\n return this._element;\n }\n\n\n /**\n * Returns the duration of the node on a timeline. If no start time is set will return undefiend, if no stop time is set will return Infinity.\n *\n * @return {number} The duration of the node in seconds.\n *\n * @example\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n * videoNode.start(5);\n * videoNode.stop(10);\n * console.log(videoNode.duration); //will output 10\n */\n get duration(){\n if (isNaN(this._startTime)) return undefined;\n if (this._stopTime === Infinity) return Infinity;\n return this._stopTime - this._startTime;\n }\n\n set stretchPaused(stretchPaused){\n this._stretchPaused = stretchPaused;\n }\n\n get stretchPaused(){\n return this._stretchPaused;\n }\n\n _load(){\n if (!this._loadCalled){\n this._triggerCallbacks(\"load\");\n this._loadCalled = true;\n }\n }\n\n _unload (){\n this._triggerCallbacks(\"destroy\");\n this._loadCalled = false;\n }\n\n /**\n * Register callbacks against one of these events: \"load\", \"destroy\", \"seek\", \"pause\", \"play\", \"ended\", \"durationchange\", \"loaded\", \"error\"\n *\n * @param {String} type - the type of event to register the callback against.\n * @param {function} func - the function to call.\n *\n * @example\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n *\n * videoNode.registerCallback(\"load\", function(){\"video is loading\"});\n * videoNode.registerCallback(\"play\", function(){\"video is playing\"});\n * videoNode.registerCallback(\"ended\", function(){\"video has eneded\"});\n *\n */\n registerCallback(type, func){\n this._callbacks.push({type:type, func:func});\n }\n\n /**\n * Remove callback.\n *\n * @param {function} [func] - the callback to remove, if undefined will remove all callbacks for this node.\n *\n * @example\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n *\n * videoNode.registerCallback(\"load\", function(){\"video is loading\"});\n * videoNode.registerCallback(\"play\", function(){\"video is playing\"});\n * videoNode.registerCallback(\"ended\", function(){\"video has eneded\"});\n * videoNode.unregisterCallback(); //remove all of the three callbacks.\n *\n */\n unregisterCallback(func){\n let toRemove = [];\n for(let callback of this._callbacks){\n if (func === undefined){\n toRemove.push(callback);\n } else if (callback.func === func){\n toRemove.push(callback);\n }\n }\n for(let callback of toRemove){\n let index = this._callbacks.indexOf(callback);\n this._callbacks.splice(index, 1);\n }\n }\n\n _triggerCallbacks(type, data){\n for(let callback of this._callbacks){\n if (callback.type === type){\n if (data!== undefined){\n callback.func(this, data);\n }else{\n callback.func(this);\n }\n }\n }\n }\n\n /**\n * Start playback at VideoContext.currentTime plus passed time. If passed time is negative, will play as soon as possible.\n *\n * @param {number} time - the time from the currentTime of the VideoContext which to start playing, if negative will play as soon as possible.\n * @return {boolean} Will return true is seqeuncing has succeded, or false if it is already sequenced.\n */\n start(time){\n if (this._state !== STATE.waiting){\n console.debug(\"SourceNode is has already been sequenced. Can't sequence twice.\");\n return false;\n }\n\n this._startTime = this._currentTime + time;\n this._state = STATE.sequenced;\n return true;\n }\n\n /**\n * Start playback at an absolute time ont the VideoContext's timeline.\n *\n * @param {number} time - the time on the VideoContexts timeline to start playing.\n * @return {boolean} Will return true is seqeuncing has succeded, or false if it is already sequenced.\n */\n startAt(time){\n if (this._state !== STATE.waiting){\n console.debug(\"SourceNode is has already been sequenced. Can't sequence twice.\");\n return false;\n }\n this._startTime = time;\n this._state = STATE.sequenced;\n return true;\n }\n\n\n get startTime(){\n return this._startTime;\n }\n\n\n /**\n * Stop playback at VideoContext.currentTime plus passed time. If passed time is negative, will play as soon as possible.\n *\n * @param {number} time - the time from the currentTime of the video context which to stop playback.\n * @return {boolean} Will return true is seqeuncing has succeded, or false if the playback has already ended or if start hasn't been called yet, or if time is less than the start time.\n */\n stop(time){\n if (this._state === STATE.ended){\n console.debug(\"SourceNode has already ended. Cannot call stop.\");\n return false;\n } else if (this._state === STATE.waiting){\n console.debug(\"SourceNode must have start called before stop is called\");\n return false;\n }\n if (this._currentTime + time <= this._startTime){\n console.debug(\"SourceNode must have a stop time after it's start time, not before.\");\n return false;\n }\n this._stopTime = this._currentTime + time;\n this._stretchPaused = false;\n this._triggerCallbacks(\"durationchange\", this.duration);\n return true;\n }\n\n /**\n * Stop playback at an absolute time ont the VideoContext's timeline.\n *\n * @param {number} time - the time on the VideoContexts timeline to stop playing.\n * @return {boolean} Will return true is seqeuncing has succeded, or false if the playback has already ended or if start hasn't been called yet, or if time is less than the start time.\n */\n stopAt(time){\n if (this._state === STATE.ended){\n console.debug(\"SourceNode has already ended. Cannot call stop.\");\n return false;\n } else if (this._state === STATE.waiting){\n console.debug(\"SourceNode must have start called before stop is called\");\n return false;\n }\n if (time <= this._startTime){\n console.debug(\"SourceNode must have a stop time after it's start time, not before.\");\n return false;\n }\n this._stopTime = time;\n this._stretchPaused = false;\n this._triggerCallbacks(\"durationchange\", this.duration);\n return true;\n }\n\n\n get stopTime(){\n return this._stopTime;\n }\n\n\n _seek(time){\n this._renderPaused = false;\n\n this._triggerCallbacks(\"seek\", time);\n\n if (this._state === STATE.waiting) return;\n if (time < this._startTime){\n clearTexture(this._gl, this._texture);\n this._state = STATE.sequenced;\n }\n if (time >= this._startTime && this._state !== STATE.paused){\n this._state = STATE.playing;\n }\n if (time >= this._stopTime){\n clearTexture(this._gl, this._texture);\n this._triggerCallbacks(\"ended\");\n this._state = STATE.ended;\n }\n //update the current time\n this._currentTime = time;\n }\n\n _pause(){\n if(this._state === STATE.playing || (this._currentTime === 0 && this._startTime === 0)){\n this._triggerCallbacks(\"pause\");\n this._state = STATE.paused;\n this._renderPaused = false;\n }\n }\n _play(){\n\n if(this._state === STATE.paused){\n this._triggerCallbacks(\"play\");\n this._state = STATE.playing;\n }\n }\n\n _isReady(){\n if (this._state === STATE.playing || this._state === STATE.paused || this._state === STATE.error){\n return this._ready;\n }\n return true;\n }\n\n _update(currentTime, triggerTextureUpdate=true){\n this._rendered = true;\n let timeDelta = currentTime - this._currentTime;\n\n //update the current time\n this._currentTime = currentTime;\n\n //update the state\n if (this._state === STATE.waiting || this._state === STATE.ended || this._state === STATE.error) return false;\n\n this._triggerCallbacks(\"render\", currentTime);\n\n\n if (currentTime < this._startTime){\n clearTexture(this._gl, this._texture);\n this._state = STATE.sequenced;\n }\n\n\n if (currentTime >= this._startTime && this._state !== STATE.paused && this._state !== STATE.error){\n if (this._state !== STATE.playing) this._triggerCallbacks(\"play\");\n this._state = STATE.playing;\n }\n\n if (currentTime >= this._stopTime){\n clearTexture(this._gl, this._texture);\n this._triggerCallbacks(\"ended\");\n this._state = STATE.ended;\n }\n\n //update this source nodes texture\n if (this._element === undefined || this._ready === false) return true;\n\n if (!this._renderPaused && this._state === STATE.paused) {\n if(triggerTextureUpdate)updateTexture(this._gl, this._texture, this._element);\n this._renderPaused = true;\n }\n if(this._state === STATE.playing){\n if(triggerTextureUpdate)updateTexture(this._gl, this._texture, this._element);\n if(this._stretchPaused){\n this._stopTime += timeDelta;\n }\n }\n\n return true;\n }\n\n /**\n * Clear any timeline state the node currently has, this puts the node in the \"waiting\" state, as if neither start nor stop had been called.\n */\n clearTimelineState(){\n this._startTime = NaN;\n this._stopTime = Infinity;\n this._state = STATE.waiting;\n }\n\n /**\n * Destroy and clean-up the node.\n */\n destroy(){\n this._unload();\n super.destroy();\n this.unregisterCallback();\n delete this._element;\n this._elementURL = undefined;\n this._state = STATE.waiting;\n this._currentTime = 0;\n this._startTime = NaN;\n this._stopTime = Infinity;\n this._ready = false;\n this._loadCalled = false;\n this._gl.deleteTexture(this._texture);\n this._texture = undefined;\n }\n}\n\nexport {STATE as SOURCENODESTATE};\n\nexport default SourceNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/SourceNodes/sourcenode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport DEFINITIONS from \"./Definitions/definitions.js\";\nimport { SOURCENODESTATE } from \"./SourceNodes/sourcenode.js\";\n\n/*\n* Utility function to compile a WebGL Vertex or Fragment shader.\n*\n* @param {WebGLRenderingContext} gl - the webgl context fo which to build the shader.\n* @param {String} shaderSource - A string of shader code to compile.\n* @param {number} shaderType - Shader type, either WebGLRenderingContext.VERTEX_SHADER or WebGLRenderingContext.FRAGMENT_SHADER.\n*\n* @return {WebGLShader} A compiled shader.\n*\n*/\nexport function compileShader(gl, shaderSource, shaderType) {\n let shader = gl.createShader(shaderType);\n gl.shaderSource(shader, shaderSource);\n gl.compileShader(shader);\n let success = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if (!success) {\n throw \"could not compile shader:\" + gl.getShaderInfoLog(shader);\n }\n return shader;\n}\n\n/*\n* Create a shader program from a passed vertex and fragment shader source string.\n*\n* @param {WebGLRenderingContext} gl - the webgl context fo which to build the shader.\n* @param {WebGLShader} vertexShader - A compiled vertex shader.\n* @param {WebGLShader} fragmentShader - A compiled fragment shader.\n*\n* @return {WebGLProgram} A compiled & linkde shader program.\n*/\nexport function createShaderProgram(gl, vertexShader, fragmentShader){\n let program = gl.createProgram();\n\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n gl.linkProgram(program);\n\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)){\n throw {\"error\":4,\"msg\":\"Can't link shader program for track\", toString:function(){return this.msg;}};\n }\n return program;\n}\n\nexport function createElementTexutre(gl){\n let texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n // Set the parameters so we can render any size image.\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n //Initialise the texture untit to clear.\n //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, type);\n\n return texture;\n}\n\nexport function updateTexture(gl, texture, element){\n if(element.readyState !== undefined && element.readyState === 0) return;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, element);\n}\n\nexport function clearTexture(gl, texture){\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));\n}\n\n\nexport function generateRandomId(){\n const appearanceAdjective = [\"adorable\", \"alert\", \"average\", \"beautiful\", \"blonde\", \"bloody\", \"blushing\", \"bright\", \"clean\", \"clear\", \"cloudy\", \"colourful\", \"concerned\",\"crowded\", \"curious\", \"cute\", \"dark\", \"dirty\", \"drab\", \"distinct\", \"dull\", \"elegant\", \"fancy\", \"filthy\", \"glamorous\", \"gleaming\", \"graceful\", \"grotesque\", \"homely\", \"light\", \"misty\", \"motionless\", \"muddy\", \"plain\", \"poised\", \"quaint\", \"scary\", \"shiny\", \"smoggy\", \"sparkling\", \"spotless\", \"stormy\", \"strange\", \"ugly\", \"unsightly\", \"unusual\"];\n const conditionAdjective = [\"alive\", \"brainy\", \"broken\", \"busy\", \"careful\",\"cautious\", \"clever\", \"crazy\", \"damaged\", \"dead\", \"difficult\",\"easy\",\"fake\", \"false\",\"famous\", \"forward\", \"fragile\",\"guilty\", \"helpful\",\"helpless\",\"important\", \"impossible\",\"infamous\",\"innocent\", \"inquisitive\", \"mad\", \"modern\", \"open\", \"outgoing\", \"outstanding\",\"poor\", \"powerful\",\"puzzled\", \"real\", \"rich\", \"right\", \"robust\",\"sane\", \"scary\", \"shy\", \"sleepy\",\"stupid\", \"super\", \"tame\", \"thick\",\"tired\",\"wild\", \"wrong\"];\n const nounAnimal = [\"manatee\", \"gila monster\", \"nematode\", \"seahorse\", \"slug\", \"koala bear\", \"giant tortoise\",\"garden snail\", \"starfish\", \"sloth\", \"american woodcock\", \"coral\", \"swallowtail butterfly\", \"house sparrow\", \"sea anemone\"];\n\n function randomChoice(array){\n return array[Math.floor(Math.random() * array.length)];\n }\n\n function capitalize(word){\n word = word.replace(/\\b\\w/g, l => l.toUpperCase());\n return word;\n }\n\n let name = randomChoice(appearanceAdjective) + \" \" + randomChoice(conditionAdjective) + \" \" + randomChoice(nounAnimal);\n name = capitalize(name);\n name = name.replace(/ /g, \"-\");\n return name;\n}\n\n\nexport function exportToJSON(vc) {\n console.warn(\"VideoContext.exportToJSON has been deprecated. Please use VideoContext.snapshot instead.\");\n return JSON.stringify(snapshotNodes(vc));\n}\n\nexport function snapshot(vc) {\n return {\n nodes: snapshotNodes(vc),\n videoContext: snapshotVideoContext(vc)\n };\n}\n\nfunction snapshotVideoContext(vc) {\n return {\n currentTime: vc.currentTime,\n duration: vc.duration,\n state: vc.state,\n playbackRate: vc.playbackRate,\n };\n}\n\nlet warningExportSourceLogged = false;\nfunction snapshotNodes(vc){\n\n function qualifyURL(url) {\n var a = document.createElement(\"a\");\n a.href = url;\n return a.href;\n }\n\n function getInputIDs(node, vc){\n let inputs = [];\n for (let input of node.inputs){\n if (input === undefined)continue;\n let inputID;\n let inputIndex = node.inputs.indexOf(input);\n let index = vc._processingNodes.indexOf(input);\n if (index > -1){\n inputID = \"processor\" + index;\n } else{\n let index = vc._sourceNodes.indexOf(input);\n if(index > -1){\n inputID = \"source\" + index;\n } else {\n console.log(\"Warning, can't find input\",input);\n }\n }\n inputs.push({id:inputID, index:inputIndex});\n }\n return inputs;\n }\n\n let result = {};\n\n\n let sourceNodeStateMapping = [];\n for (let state in SOURCENODESTATE){\n sourceNodeStateMapping[SOURCENODESTATE[state]] = state;\n }\n\n for(let index in vc._sourceNodes){\n let source = vc._sourceNodes[index];\n let id = \"source\" + index;\n let node_url = \"\";\n\n if(!source._isResponsibleForElementLifeCycle){\n if (!warningExportSourceLogged){\n console.debug(\"Warning - Trying to export source created from an element not a URL. URL of export will be set to the elements src attribute and may be incorrect\", source);\n warningExportSourceLogged = true;\n }\n node_url = source.element.src;\n } else {\n node_url = qualifyURL(source._elementURL);\n }\n\n let node = {\n type: source.displayName,\n url: node_url,\n start: source.startTime,\n stop: source.stopTime,\n state: sourceNodeStateMapping[source.state],\n };\n if (node.type === \"VideoNode\") {\n node.currentTime = null;\n if(source.element && source.element.currentTime) {\n node.currentTime = source.element.currentTime;\n }\n }\n\n if (source._sourceOffset){\n node.sourceOffset = source._sourceOffset;\n }\n result[id] = node;\n }\n\n for (let index in vc._processingNodes){\n let processor = vc._processingNodes[index];\n let id = \"processor\" + index;\n let node = {\n type: processor.displayName,\n definition: processor._definition,\n inputs: getInputIDs(processor, vc),\n properties:{}\n };\n\n for(let property in node.definition.properties){\n node.properties[property] = processor[property];\n }\n\n if (node.type === \"TransitionNode\"){\n node.transitions = processor._transitions;\n }\n\n result[id] = node;\n }\n\n result[\"destination\"] = {\n type:\"Destination\",\n inputs: getInputIDs(vc.destination, vc)\n };\n\n return result;\n}\n\nexport function createControlFormForNode(node, nodeName){\n let rootDiv = document.createElement(\"div\");\n\n if (nodeName !== undefined){\n var title = document.createElement(\"h2\");\n title.innerHTML = nodeName;\n rootDiv.appendChild(title);\n }\n\n for(let propertyName in node._properties){\n let propertyParagraph = document.createElement(\"p\");\n let propertyTitleHeader = document.createElement(\"h3\");\n propertyTitleHeader.innerHTML = propertyName;\n propertyParagraph.appendChild(propertyTitleHeader);\n\n let propertyValue = node._properties[propertyName].value;\n if (typeof propertyValue === \"number\"){\n let range = document.createElement(\"input\");\n range.setAttribute(\"type\", \"range\");\n range.setAttribute(\"min\", \"0\");\n range.setAttribute(\"max\", \"1\");\n range.setAttribute(\"step\", \"0.01\");\n range.setAttribute(\"value\", propertyValue,toString());\n\n let number = document.createElement(\"input\");\n number.setAttribute(\"type\", \"number\");\n number.setAttribute(\"min\", \"0\");\n number.setAttribute(\"max\", \"1\");\n number.setAttribute(\"step\", \"0.01\");\n number.setAttribute(\"value\", propertyValue,toString());\n\n let mouseDown = false;\n range.onmousedown =function(){mouseDown=true;};\n range.onmouseup =function(){mouseDown=false;};\n range.onmousemove = function(){\n if(mouseDown){\n node[propertyName] = parseFloat(range.value);\n number.value = range.value;\n }\n };\n range.onchange = function(){\n node[propertyName] = parseFloat(range.value);\n number.value = range.value;\n };\n number.onchange =function(){\n node[propertyName] = parseFloat(number.value);\n range.value = number.value;\n };\n propertyParagraph.appendChild(range);\n propertyParagraph.appendChild(number);\n }\n else if(Object.prototype.toString.call(propertyValue) === \"[object Array]\"){\n for (var i = 0; i < propertyValue.length; i++) {\n let range = document.createElement(\"input\");\n range.setAttribute(\"type\", \"range\");\n range.setAttribute(\"min\", \"0\");\n range.setAttribute(\"max\", \"1\");\n range.setAttribute(\"step\", \"0.01\");\n range.setAttribute(\"value\", propertyValue[i],toString());\n\n let number = document.createElement(\"input\");\n number.setAttribute(\"type\", \"number\");\n number.setAttribute(\"min\", \"0\");\n number.setAttribute(\"max\", \"1\");\n number.setAttribute(\"step\", \"0.01\");\n number.setAttribute(\"value\", propertyValue,toString());\n\n let index = i;\n let mouseDown = false;\n range.onmousedown =function(){mouseDown=true;};\n range.onmouseup =function(){mouseDown=false;};\n range.onmousemove = function(){\n if(mouseDown){\n node[propertyName][index] = parseFloat(range.value);\n number.value = range.value;\n }\n };\n range.onchange = function(){\n node[propertyName][index] = parseFloat(range.value);\n number.value = range.value;\n };\n\n number.onchange = function(){\n node[propertyName][index] = parseFloat(number.value);\n range.value = number.value;\n };\n propertyParagraph.appendChild(range);\n propertyParagraph.appendChild(number);\n }\n }\n\n rootDiv.appendChild(propertyParagraph);\n }\n return rootDiv;\n}\n\n\nfunction calculateNodeDepthFromDestination(videoContext){\n let destination = videoContext.destination;\n let depthMap= new Map();\n depthMap.set(destination, 0);\n\n function itterateBackwards(node, depth=0){\n for (let n of node.inputs){\n let d = depth + 1;\n if (depthMap.has(n)){\n if (d > depthMap.get(n)){\n depthMap.set(n, d);\n }\n } else{\n depthMap.set(n,d);\n }\n itterateBackwards(n, depthMap.get(n));\n }\n }\n\n itterateBackwards(destination);\n return depthMap;\n}\n\n\n\n\nexport function visualiseVideoContextGraph(videoContext, canvas){\n let ctx = canvas.getContext(\"2d\");\n let w = canvas.width;\n let h = canvas.height;\n ctx.clearRect(0,0,w,h);\n\n let nodeDepths = calculateNodeDepthFromDestination(videoContext);\n let depths = nodeDepths.values();\n depths = Array.from(depths).sort(function(a, b){return b-a;});\n let maxDepth = depths[0];\n\n let xStep = w / (maxDepth+1);\n\n let nodeHeight = (h / videoContext._sourceNodes.length)/3;\n let nodeWidth = nodeHeight * 1.618;\n\n\n function calculateNodePos(node, nodeDepths, xStep, nodeHeight){\n let depth = nodeDepths.get(node);\n nodeDepths.values();\n\n let count = 0;\n for(let nodeDepth of nodeDepths){\n if (nodeDepth[0] === node) break;\n if (nodeDepth[1] === depth) count += 1;\n }\n return {x:(xStep*nodeDepths.get(node)), y:nodeHeight*1.5*count + 50};\n }\n\n\n // \"video\":[\"#572A72\", \"#3C1255\"],\n // \"image\":[\"#7D9F35\", \"#577714\"],\n // \"canvas\":[\"#AA9639\", \"#806D15\"]\n\n for (let i = 0; i < videoContext._renderGraph.connections.length; i++) {\n let conn = videoContext._renderGraph.connections[i];\n let source = calculateNodePos(conn.source, nodeDepths, xStep, nodeHeight);\n let destination = calculateNodePos(conn.destination, nodeDepths, xStep, nodeHeight);\n if (source !== undefined && destination !== undefined){\n ctx.beginPath();\n //ctx.moveTo(source.x + nodeWidth/2, source.y + nodeHeight/2);\n let x1 = source.x + nodeWidth/2;\n let y1 = source.y + nodeHeight/2;\n let x2 = destination.x + nodeWidth/2;\n let y2 = destination.y + nodeHeight/2;\n let dx = x2 - x1;\n let dy = y2 - y1;\n\n let angle = Math.PI/2 - Math.atan2(dx,dy);\n\n let distance = Math.sqrt(Math.pow(x1-x2,2) + Math.pow(y1-y2,2));\n\n let midX = Math.min(x1, x2) + (Math.max(x1,x2) - Math.min(x1, x2))/2;\n let midY = Math.min(y1, y2) + (Math.max(y1,y2) - Math.min(y1, y2))/2;\n\n let testX = (Math.cos(angle + Math.PI/2))*distance/1.5 + midX;\n let testY = (Math.sin(angle + Math.PI/2))*distance/1.5 + midY;\n // console.log(testX, testY);\n\n ctx.arc(testX, testY, distance/1.2, angle-Math.PI+0.95, angle-0.95);\n\n //ctx.arcTo(source.x + nodeWidth/2 ,source.y + nodeHeight/2,destination.x + nodeWidth/2,destination.y + nodeHeight/2,100);\n //ctx.lineTo(midX, midY);\n ctx.stroke();\n //ctx.endPath();\n }\n }\n\n\n for(let node of nodeDepths.keys()){\n let pos = calculateNodePos(node, nodeDepths, xStep, nodeHeight);\n let color = \"#AA9639\";\n let text = \"\";\n if (node.displayName === \"CompositingNode\"){\n color = \"#000000\";\n }\n if (node.displayName === \"DestinationNode\"){\n color = \"#7D9F35\";\n text=\"Output\";\n }\n if (node.displayName === \"VideoNode\"){\n color = \"#572A72\";\n text = \"Video\";\n }\n if (node.displayName === \"CanvasNode\"){\n color = \"#572A72\";\n text = \"Canvas\";\n }\n if (node.displayName === \"ImageNode\"){\n color = \"#572A72\";\n text = \"Image\";\n }\n ctx.beginPath();\n ctx.fillStyle = color;\n ctx.fillRect(pos.x, pos.y, nodeWidth, nodeHeight);\n ctx.fill();\n\n\n ctx.fillStyle = \"#000\";\n ctx.textAlign = \"center\";\n ctx.font = \"10px Arial\";\n ctx.fillText(text,pos.x+nodeWidth/2, pos.y+nodeHeight/2+2.5);\n ctx.fill();\n }\n\n return;\n}\n\n\n\n\nexport function createSigmaGraphDataFromRenderGraph(videoContext){\n\n function idForNode(node){\n if (videoContext._sourceNodes.indexOf(node) !== -1){\n let id = \"source \" + node.displayName+ \" \"+videoContext._sourceNodes.indexOf(node);\n return id;\n }\n let id = \"processor \" + node.displayName + \" \"+videoContext._processingNodes.indexOf(node);\n return id;\n }\n\n let graph = {\n nodes:[\n {\n id: idForNode(videoContext.destination),\n label:\"Destination Node\",\n x:2.5,\n y:0.5,\n size:2,\n node: videoContext.destination\n }],\n edges:[]\n };\n\n for (let i = 0; i < videoContext._sourceNodes.length; i++) {\n let sourceNode = videoContext._sourceNodes[i];\n let y = i * (1.0 / videoContext._sourceNodes.length);\n graph.nodes.push({\n id: idForNode(sourceNode),\n label:\"Source \"+ i.toString(),\n x:0,\n y: y,\n size:2,\n color:\"#572A72\",\n node:sourceNode\n });\n }\n for (let i = 0; i < videoContext._processingNodes.length; i++) {\n let processingNode = videoContext._processingNodes[i];\n graph.nodes.push({\n id: idForNode(processingNode),\n x: Math.random() *2.5,\n y: Math.random(),\n size:2,\n node: processingNode\n });\n }\n\n for (let i = 0; i < videoContext._renderGraph.connections.length; i++) {\n let conn = videoContext._renderGraph.connections[i];\n graph.edges.push({\n \"id\":\"e\"+i.toString(),\n \"source\": idForNode(conn.source),\n \"target\": idForNode(conn.destination)\n });\n }\n\n\n\n return graph;\n}\n\n\nexport function importSimpleEDL(ctx, playlist){\n // Create a \"track\" node to connect all the clips to.\n let trackNode = ctx.compositor(DEFINITIONS.COMBINE);\n\n // Create a source node for each of the clips.\n for (let clip of playlist){\n let node;\n if (clip.type === \"video\"){\n node = ctx.video(clip.src, clip.sourceStart);\n } else if (clip.type === \"image\"){\n node = ctx.image(clip.src, clip.sourceStart);\n }else {\n console.debug(\"Clip type \\\"\" + clip.type + \"\\\" not recognised, skipping.\");\n continue;\n }\n node.startAt(clip.start);\n node.stopAt(clip.start + clip.duration);\n node.connect(trackNode);\n }\n return trackNode;\n}\n\nexport function visualiseVideoContextTimeline(videoContext, canvas, currentTime){\n let ctx = canvas.getContext(\"2d\");\n let w = canvas.width;\n let h = canvas.height;\n let trackHeight = h / videoContext._sourceNodes.length;\n let playlistDuration = videoContext.duration;\n\n if (currentTime > playlistDuration && !videoContext.endOnLastSourceEnd) playlistDuration = currentTime;\n\n if (videoContext.duration === Infinity){\n let total = 0;\n for (let i = 0; i < videoContext._sourceNodes.length; i++) {\n let sourceNode = videoContext._sourceNodes[i];\n if(sourceNode._stopTime !== Infinity) total += sourceNode._stopTime;\n }\n\n if (total > videoContext.currentTime){\n playlistDuration = total+5;\n }else{\n playlistDuration = videoContext.currentTime+5;\n }\n }\n let pixelsPerSecond = w / playlistDuration;\n let mediaSourceStyle = {\n \"video\":[\"#572A72\", \"#3C1255\"],\n \"image\":[\"#7D9F35\", \"#577714\"],\n \"canvas\":[\"#AA9639\", \"#806D15\"]\n };\n\n\n ctx.clearRect(0,0,w,h);\n ctx.fillStyle = \"#999\";\n\n for(let node of videoContext._processingNodes){\n if (node.displayName !== \"TransitionNode\") continue;\n for(let propertyName in node._transitions){\n for(let transition of node._transitions[propertyName]){\n let tW = (transition.end - transition.start) * pixelsPerSecond;\n let tH = h;\n let tX = transition.start * pixelsPerSecond;\n let tY = 0;\n ctx.fillStyle = \"rgba(0,0,0, 0.3)\";\n ctx.fillRect(tX, tY, tW, tH);\n ctx.fill();\n }\n }\n }\n\n\n for (let i = 0; i < videoContext._sourceNodes.length; i++) {\n let sourceNode = videoContext._sourceNodes[i];\n let duration = sourceNode._stopTime - sourceNode._startTime;\n if(duration=== Infinity) duration = videoContext.currentTime;\n let start = sourceNode._startTime;\n\n let msW = duration * pixelsPerSecond;\n let msH = trackHeight;\n let msX = start * pixelsPerSecond;\n let msY = trackHeight * i;\n ctx.fillStyle = mediaSourceStyle.video[i%mediaSourceStyle.video.length];\n\n\n ctx.fillRect(msX,msY,msW,msH);\n ctx.fill();\n }\n\n\n\n if (currentTime !== undefined){\n ctx.fillStyle = \"#000\";\n ctx.fillRect(currentTime*pixelsPerSecond, 0, 1, h);\n }\n}\n\n\n\n\nexport class UpdateablesManager{\n constructor(){\n this._updateables = [];\n this._useWebworker = false;\n this._active = false;\n this._previousRAFTime = undefined;\n this._previousWorkerTime = undefined;\n\n this._webWorkerString = \"\\\n var running = false;\\\n function tick(){\\\n postMessage(Date.now());\\\n if (running){\\\n setTimeout(tick, 1000/20);\\\n }\\\n }\\\n self.addEventListener('message',function(msg){\\\n var data = msg.data;\\\n if (data === 'start'){\\\n running = true;\\\n tick();\\\n }\\\n if (data === 'stop') running = false;\\\n });\";\n this._webWorker = undefined;\n }\n\n _initWebWorker(){\n window.URL = window.URL || window.webkitURL;\n let blob = new Blob([this._webWorkerString], {type: \"application/javascript\"});\n this._webWorker = new Worker(URL.createObjectURL(blob));\n this._webWorker.onmessage = (msg)=>{\n let time = msg.data;\n this._updateWorkerTime(time);\n };\n }\n\n _lostVisibility(){\n this._previousWorkerTime = Date.now();\n this._useWebworker = true;\n if (!this._webWorker){\n this._initWebWorker();\n }\n this._webWorker.postMessage(\"start\");\n }\n\n _gainedVisibility(){\n this._useWebworker = false;\n this._previousRAFTime = undefined;\n if(this._webWorker) this._webWorker.postMessage(\"stop\");\n requestAnimationFrame(this._updateRAFTime.bind(this));\n }\n\n _init(){\n if(!window.Worker)return;\n\n //If page visibility API not present fallback to using \"focus\" and \"blur\" event listeners.\n if (typeof document.hidden === \"undefined\") {\n window.addEventListener(\"focus\", this._gainedVisibility.bind(this));\n window.addEventListener(\"blur\", this._lostVisibility.bind(this));\n return;\n }\n //Otherwise we can use the visibility API to do the loose/gain focus properly\n document.addEventListener(\"visibilitychange\", ()=>{\n if (document.hidden === true) {\n this._lostVisibility();\n } else {\n this._gainedVisibility();\n }\n }, false);\n\n requestAnimationFrame(this._updateRAFTime.bind(this));\n }\n\n _updateWorkerTime(time){\n let dt = (time - this._previousWorkerTime) / 1000;\n if (dt !== 0) this._update(dt);\n this._previousWorkerTime = time;\n }\n\n _updateRAFTime(time){\n if (this._previousRAFTime === undefined)this._previousRAFTime = time;\n let dt = (time - this._previousRAFTime) / 1000;\n if (dt !== 0) this._update(dt);\n this._previousRAFTime = time;\n if(!this._useWebworker)requestAnimationFrame(this._updateRAFTime.bind(this));\n }\n\n _update(dt){\n for(let i = 0; i < this._updateables.length; i++){\n this._updateables[i]._update(parseFloat(dt));\n\n }\n }\n\n register(updateable){\n this._updateables.push(updateable);\n if (this._active === false){\n this._active = true;\n this._init();\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","import aaf_video_scale from \"./aaf_video_scale.js\";\nimport crossfade from \"./crossfade.js\";\nimport horizontalWipe from \"./horizontalWipe.js\";\nimport verticalWipe from \"./verticalWipe.js\";\nimport randomDissolve from \"./randomDissolve.js\";\nimport toColorAndBackFade from \"./toColorAndBackFade.js\";\nimport starWipe from \"./starWipe.js\";\nimport combine from \"./combine.js\";\nimport colorThreshold from \"./colorThreshold.js\";\nimport monochrome from \"./monochrome.js\";\nimport horizontalBlur from \"./horizontalBlur.js\";\nimport verticalBlur from \"./verticalBlur.js\";\nimport aaf_video_flop from \"./aaf_video_flop.js\";\nimport aaf_video_flip from \"./aaf_video_flip.js\";\nimport aaf_video_position from \"./aaf_video_position.js\";\nimport aaf_video_crop from \"./aaf_video_crop.js\";\nimport staticDissolve from \"./staticDissolve.js\";\nimport staticEffect from \"./staticEffect.js\";\nimport dreamfade from \"./dreamfade.js\";\nimport opacity from \"./opacity.js\";\nimport crop from \"./crop.js\";\n\nlet DEFINITIONS = {\n AAF_VIDEO_SCALE: aaf_video_scale,\n CROSSFADE: crossfade,\n DREAMFADE: dreamfade,\n HORIZONTAL_WIPE:horizontalWipe,\n VERTICAL_WIPE:verticalWipe,\n RANDOM_DISSOLVE:randomDissolve,\n STATIC_DISSOLVE:staticDissolve,\n STATIC_EFFECT:staticEffect,\n TO_COLOR_AND_BACK: toColorAndBackFade,\n STAR_WIPE:starWipe,\n COMBINE: combine,\n COLORTHRESHOLD: colorThreshold,\n MONOCHROME: monochrome,\n HORIZONTAL_BLUR:horizontalBlur,\n VERTICAL_BLUR:verticalBlur,\n AAF_VIDEO_CROP: aaf_video_crop,\n AAF_VIDEO_POSITION: aaf_video_position,\n AAF_VIDEO_FLIP: aaf_video_flip,\n AAF_VIDEO_FLOP: aaf_video_flop,\n OPACITY: opacity,\n CROP: crop\n};\n\nexport default DEFINITIONS;\n\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/definitions.js","let aaf_video_scale = {\n \"title\":\"AAF Video Scale Effect\",\n \"description\": \"A scale effect based on the AAF spec.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float scaleX;\\\n uniform float scaleY;\\\n varying vec2 v_texCoord;\\\n varying float v_progress;\\\n void main(){\\\n vec2 pos = vec2(v_texCoord[0]*1.0/scaleX - (1.0/scaleX/2.0 -0.5), v_texCoord[1]*1.0/scaleY - (1.0/scaleY/2.0 -0.5));\\\n vec4 color = texture2D(u_image, pos);\\\n if (pos[0] < 0.0 || pos[0] > 1.0 || pos[1] < 0.0 || pos[1] > 1.0){\\\n color = vec4(0.0,0.0,0.0,0.0);\\\n }\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"scaleX\":{\"type\":\"uniform\", \"value\":1.0},\n \"scaleY\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_scale;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_scale.js","let crossfade = {\n \"title\":\"Cross-Fade\",\n \"description\": \"A cross-fade effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n color_a[0] *= (1.0 - mix);\\\n color_a[1] *= (1.0 - mix);\\\n color_a[2] *= (1.0 - mix);\\\n color_a[3] *= (1.0 - mix);\\\n color_b[0] *= mix;\\\n color_b[1] *= mix;\\\n color_b[2] *= mix;\\\n color_b[3] *= mix;\\\n gl_FragColor = color_a + color_b;\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default crossfade;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/crossfade.js","let horizontal_wipe = {\n \"title\":\"Horizontal Wipe\",\n \"description\": \"A horizontal wipe effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n if (v_texCoord[0] > mix){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default horizontal_wipe;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/horizontalWipe.js","let verticalWipe = {\n \"title\":\"vertical Wipe\",\n \"description\": \"A vertical wipe effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n if (v_texCoord[1] > mix){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default verticalWipe;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/verticalWipe.js","let randomDissolve = {\n \"title\":\"Random Dissolve\",\n \"description\": \"A random dissolve effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n float rand(vec2 co){\\\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\\\n }\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n if (clamp(rand(v_texCoord), 0.01, 1.001) > mix){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default randomDissolve;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/randomDissolve.js","let toColorAndBackFade = {\n \"title\":\"To Color And Back Fade\",\n \"description\": \"A fade to black and back effect. Setting mix to 0.5 is a fully solid color frame. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n uniform vec4 color;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n float mix_amount = (mix *2.0) - 1.0;\\\n if(mix_amount < 0.0){\\\n gl_FragColor = abs(mix_amount) * color_a + (1.0 - abs(mix_amount)) * color;\\\n } else {\\\n gl_FragColor = mix_amount * color_b + (1.0 - mix_amount) * color;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0},\n \"color\":{\"type\":\"uniform\", \"value\":[0.0,0.0,0.0,0.0]}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\nexport default toColorAndBackFade;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/toColorAndBackFade.js","let starWipe = {\n \"title\":\"Star Wipe Fade\",\n \"description\": \"A classic star wipe transistion. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n float sign (vec2 p1, vec2 p2, vec2 p3){\\\n return (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]);\\\n }\\\n bool pointInTriangle(vec2 pt, vec2 v1, vec2 v2, vec2 v3){\\\n bool b1, b2, b3;\\\n b1 = sign(pt, v1, v2) < 0.0;\\\n b2 = sign(pt, v2, v3) < 0.0;\\\n b3 = sign(pt, v3, v1) < 0.0;\\\n return ((b1 == b2) && (b2 == b3));\\\n }\\\n vec2 rotatePointAboutPoint(vec2 point, vec2 pivot, float angle){\\\n float s = sin(angle);\\\n float c = cos(angle);\\\n float x = point[0] - pivot[0];\\\n float y = point[1] - pivot[1];\\\n float new_x = x * c - y * s;\\\n float new_y = x * s + y * c;\\\n return vec2(new_x + pivot[0], new_y+pivot[1]);\\\n }\\\n \\\n void main(){\\\n vec4 color_a = texture2D(u_image_b, v_texCoord);\\\n vec4 color_b = texture2D(u_image_a, v_texCoord);\\\n vec2 t0_p0,t0_p1,t0_p2,t1_p0,t1_p1,t1_p2,t2_p0,t2_p1,t2_p2,t3_p0,t3_p1,t3_p2;\\\n vec2 t4_p0,t4_p1,t4_p2,t5_p0,t5_p1,t5_p2,t6_p0,t6_p1,t6_p2,t7_p0,t7_p1,t7_p2;\\\n \\\n \\\n t0_p0 = vec2(0.0, 0.25) * clamp(mix,0.0,1.0) * 2.0 + vec2(0.5,0.5);\\\n t0_p1 = vec2(0.0, -0.25) * clamp(mix,0.0,1.0) * 2.0 + vec2(0.5,0.5);\\\n t0_p2 = vec2(1.0, 0.0) * clamp(mix,0.0,1.0) * 2.0 + vec2(0.5,0.5);\\\n \\\n t1_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854);\\\n t1_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854);\\\n t1_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854);\\\n \\\n t2_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 2.0);\\\n t2_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 2.0);\\\n t2_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 2.0);\\\n \\\n t3_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 3.0);\\\n t3_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 3.0);\\\n t3_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 3.0);\\\n \\\n t4_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 4.0);\\\n t4_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 4.0);\\\n t4_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 4.0);\\\n \\\n t5_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 5.0);\\\n t5_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 5.0);\\\n t5_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 5.0);\\\n \\\n t6_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 6.0);\\\n t6_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 6.0);\\\n t6_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 6.0);\\\n \\\n t7_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 7.0);\\\n t7_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 7.0);\\\n t7_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 7.0);\\\n \\\n if(mix > 0.99){\\\n gl_FragColor = color_a;\\\n return;\\\n }\\\n if(mix < 0.01){\\\n gl_FragColor = color_b;\\\n return;\\\n }\\\n if(pointInTriangle(v_texCoord, t0_p0, t0_p1, t0_p2) || pointInTriangle(v_texCoord, t1_p0, t1_p1, t1_p2) || pointInTriangle(v_texCoord, t2_p0, t2_p1, t2_p2) || pointInTriangle(v_texCoord, t3_p0, t3_p1, t3_p2) || pointInTriangle(v_texCoord, t4_p0, t4_p1, t4_p2) || pointInTriangle(v_texCoord, t5_p0, t5_p1, t5_p2) || pointInTriangle(v_texCoord, t6_p0, t6_p1, t6_p2) || pointInTriangle(v_texCoord, t7_p0, t7_p1, t7_p2)){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default starWipe;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/starWipe.js","let combine = {\n \"title\":\"Combine\",\n \"description\": \"A basic effect which renders the input to the output, Typically used as a combine node for layering up media with alpha transparency.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float a;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"a\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default combine;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/combine.js","let colorThreshold = {\n \"title\":\"Color Threshold\",\n \"description\": \"Turns all pixels with a greater value than the specified threshold transparent.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float a;\\\n uniform vec3 colorAlphaThreshold;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n if (color[0] > colorAlphaThreshold[0] && color[1]> colorAlphaThreshold[1] && color[2]> colorAlphaThreshold[2]){\\\n color = vec4(0.0,0.0,0.0,0.0);\\\n }\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"a\":{\"type\":\"uniform\", \"value\":0.0},\n \"colorAlphaThreshold\":{\"type\":\"uniform\", \"value\":[0.0,0.55,0.0]}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default colorThreshold;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/colorThreshold.js","let monochrome = {\n \"title\":\"Monochrome\",\n \"description\": \"Change images to a single chroma (e.g can be used to make a black & white filter). Input color mix and output color mix can be adjusted.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform vec3 inputMix;\\\n uniform vec3 outputMix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n float mono = color[0]*inputMix[0] + color[1]*inputMix[1] + color[2]*inputMix[2];\\\n color[0] = mono * outputMix[0];\\\n color[1] = mono * outputMix[1];\\\n color[2] = mono * outputMix[2];\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"inputMix\":{\"type\":\"uniform\", \"value\":[0.4,0.6,0.2]},\n \"outputMix\":{\"type\":\"uniform\", \"value\":[1.0,1.0,1.0]}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default monochrome;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/monochrome.js","let horizontal_blur = {\n \"title\":\"Horizontal Blur\",\n \"description\": \"A horizontal blur effect. Adpated from http://xissburg.com/faster-gaussian-blur-in-glsl/\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n uniform float blurAmount;\\\n varying vec2 v_texCoord;\\\n varying vec2 v_blurTexCoords[14];\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n v_blurTexCoords[ 0] = v_texCoord + vec2(-0.028 * blurAmount, 0.0);\\\n v_blurTexCoords[ 1] = v_texCoord + vec2(-0.024 * blurAmount, 0.0);\\\n v_blurTexCoords[ 2] = v_texCoord + vec2(-0.020 * blurAmount, 0.0);\\\n v_blurTexCoords[ 3] = v_texCoord + vec2(-0.016 * blurAmount, 0.0);\\\n v_blurTexCoords[ 4] = v_texCoord + vec2(-0.012 * blurAmount, 0.0);\\\n v_blurTexCoords[ 5] = v_texCoord + vec2(-0.008 * blurAmount, 0.0);\\\n v_blurTexCoords[ 6] = v_texCoord + vec2(-0.004 * blurAmount, 0.0);\\\n v_blurTexCoords[ 7] = v_texCoord + vec2( 0.004 * blurAmount, 0.0);\\\n v_blurTexCoords[ 8] = v_texCoord + vec2( 0.008 * blurAmount, 0.0);\\\n v_blurTexCoords[ 9] = v_texCoord + vec2( 0.012 * blurAmount, 0.0);\\\n v_blurTexCoords[10] = v_texCoord + vec2( 0.016 * blurAmount, 0.0);\\\n v_blurTexCoords[11] = v_texCoord + vec2( 0.020 * blurAmount, 0.0);\\\n v_blurTexCoords[12] = v_texCoord + vec2( 0.024 * blurAmount, 0.0);\\\n v_blurTexCoords[13] = v_texCoord + vec2( 0.028 * blurAmount, 0.0);\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n varying vec2 v_blurTexCoords[14];\\\n void main(){\\\n gl_FragColor = vec4(0.0);\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 0])*0.0044299121055113265;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 1])*0.00895781211794;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 2])*0.0215963866053;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 3])*0.0443683338718;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 4])*0.0776744219933;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 5])*0.115876621105;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 6])*0.147308056121;\\\n gl_FragColor += texture2D(u_image, v_texCoord )*0.159576912161;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 7])*0.147308056121;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 8])*0.115876621105;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 9])*0.0776744219933;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[10])*0.0443683338718;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[11])*0.0215963866053;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[12])*0.00895781211794;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[13])*0.0044299121055113265;\\\n }\",\n \"properties\":{\n \"blurAmount\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default horizontal_blur;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/horizontalBlur.js","let verticalBlur = {\n \"title\":\"Vertical Blur\",\n \"description\": \"A vertical blur effect. Adpated from http://xissburg.com/faster-gaussian-blur-in-glsl/\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n uniform float blurAmount;\\\n varying vec2 v_blurTexCoords[14];\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n v_blurTexCoords[ 0] = v_texCoord + vec2(0.0,-0.028 * blurAmount);\\\n v_blurTexCoords[ 1] = v_texCoord + vec2(0.0,-0.024 * blurAmount);\\\n v_blurTexCoords[ 2] = v_texCoord + vec2(0.0,-0.020 * blurAmount);\\\n v_blurTexCoords[ 3] = v_texCoord + vec2(0.0,-0.016 * blurAmount);\\\n v_blurTexCoords[ 4] = v_texCoord + vec2(0.0,-0.012 * blurAmount);\\\n v_blurTexCoords[ 5] = v_texCoord + vec2(0.0,-0.008 * blurAmount);\\\n v_blurTexCoords[ 6] = v_texCoord + vec2(0.0,-0.004 * blurAmount);\\\n v_blurTexCoords[ 7] = v_texCoord + vec2(0.0, 0.004 * blurAmount);\\\n v_blurTexCoords[ 8] = v_texCoord + vec2(0.0, 0.008 * blurAmount);\\\n v_blurTexCoords[ 9] = v_texCoord + vec2(0.0, 0.012 * blurAmount);\\\n v_blurTexCoords[10] = v_texCoord + vec2(0.0, 0.016 * blurAmount);\\\n v_blurTexCoords[11] = v_texCoord + vec2(0.0, 0.020 * blurAmount);\\\n v_blurTexCoords[12] = v_texCoord + vec2(0.0, 0.024 * blurAmount);\\\n v_blurTexCoords[13] = v_texCoord + vec2(0.0, 0.028 * blurAmount);\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n varying vec2 v_blurTexCoords[14];\\\n void main(){\\\n gl_FragColor = vec4(0.0);\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 0])*0.0044299121055113265;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 1])*0.00895781211794;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 2])*0.0215963866053;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 3])*0.0443683338718;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 4])*0.0776744219933;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 5])*0.115876621105;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 6])*0.147308056121;\\\n gl_FragColor += texture2D(u_image, v_texCoord )*0.159576912161;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 7])*0.147308056121;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 8])*0.115876621105;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 9])*0.0776744219933;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[10])*0.0443683338718;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[11])*0.0215963866053;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[12])*0.00895781211794;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[13])*0.0044299121055113265;\\\n }\",\n \"properties\":{\n \"blurAmount\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default verticalBlur;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/verticalBlur.js","let aaf_video_flop = {\n \"title\":\"AAF Video Flop Effect\",\n \"description\": \"A flop effect based on the AAF spec. Mirrors the image in the y-axis\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n void main(){\\\n vec2 coord = vec2(1.0 - v_texCoord[0] ,v_texCoord[1]);\\\n vec4 color = texture2D(u_image, coord);\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_flop;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_flop.js","let aaf_video_flip = {\n \"title\":\"AAF Video Scale Effect\",\n \"description\": \"A flip effect based on the AAF spec. Mirrors the image in the x-axis\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n void main(){\\\n vec2 coord = vec2(v_texCoord[0] ,1.0 - v_texCoord[1]);\\\n vec4 color = texture2D(u_image, coord);\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_flip;\n\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_flip.js","let aaf_video_position = {\n \"title\":\"AAF Video Position Effect\",\n \"description\": \"A position effect based on the AAF spec.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float positionOffsetX;\\\n uniform float positionOffsetY;\\\n varying vec2 v_texCoord;\\\n varying float v_progress;\\\n void main(){\\\n vec2 pos = vec2(v_texCoord[0] - positionOffsetX/2.0, v_texCoord[1] - positionOffsetY/2.0);\\\n vec4 color = texture2D(u_image, pos);\\\n if (pos[0] < 0.0 || pos[0] > 1.0 || pos[1] < 0.0 || pos[1] > 1.0){\\\n color = vec4(0.0,0.0,0.0,0.0);\\\n }\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"positionOffsetX\":{\"type\":\"uniform\", \"value\":0.0},\n \"positionOffsetY\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_position;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_position.js","let aaf_video_crop = {\n \"title\":\"AAF Video Crop Effect\",\n \"description\": \"A crop effect based on the AAF spec.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float cropLeft;\\\n uniform float cropRight;\\\n uniform float cropTop;\\\n uniform float cropBottom;\\\n varying vec2 v_texCoord;\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n if (v_texCoord[0] < (cropLeft+1.0)/2.0) color = vec4(0.0,0.0,0.0,0.0);\\\n if (v_texCoord[0] > (cropRight+1.0)/2.0) color = vec4(0.0,0.0,0.0,0.0);\\\n if (v_texCoord[1] < (-cropBottom+1.0)/2.0) color = vec4(0.0,0.0,0.0,0.0);\\\n if (v_texCoord[1] > (-cropTop+1.0)/2.0) color = vec4(0.0,0.0,0.0,0.0);\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"cropLeft\":{\"type\":\"uniform\", \"value\":-1.0},\n \"cropRight\":{\"type\":\"uniform\", \"value\":1.0},\n \"cropTop\":{\"type\":\"uniform\", \"value\": -1.0},\n \"cropBottom\":{\"type\":\"uniform\", \"value\": 1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_crop;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_crop.js","let staticDissolve = {\n \"title\":\"Static Dissolve\",\n \"description\": \"A static dissolve effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n uniform float currentTime;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n float rand(vec2 co, float currentTime){\\\n return fract(sin(dot(co.xy,vec2(12.9898,78.233))+currentTime) * 43758.5453);\\\n }\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n if (clamp(rand(v_texCoord, currentTime), 0.01, 1.001) > mix){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default staticDissolve;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/staticDissolve.js","let staticEffect = {\n \"title\":\"Static\",\n \"description\": \"A static effect to add pseudo random noise to a video\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float currentTime;\\\n uniform float amount;\\\n varying vec2 v_texCoord;\\\n uniform vec3 weight;\\\n float rand(vec2 co, float currentTime){\\\n return fract(sin(dot(co.xy,vec2(12.9898,78.233))+currentTime) * 43758.5453);\\\n }\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n color[0] = color[0] + (2.0*(clamp(rand(v_texCoord, currentTime), 0.01, 1.001)-0.5)) * weight[0] * amount;\\\n color[1] = color[1] + (2.0*(clamp(rand(v_texCoord, currentTime), 0.01, 1.001)-0.5)) * weight[1] * amount;\\\n color[2] = color[2] + (2.0*(clamp(rand(v_texCoord, currentTime), 0.01, 1.001)-0.5)) * weight[2] *amount;\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"weight\":{\"type\":\"uniform\", \"value\":[1.0,1.0,1.0]},\n \"amount\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default staticEffect;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/staticEffect.js","let dreamfade = {\n \"title\":\"Dream-Fade\",\n \"description\": \"A wobbly dream effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n float wobble = 1.0 - abs((mix*2.0)-1.0);\\\n vec2 pos = vec2(v_texCoord[0] + ((sin(v_texCoord[1]*(10.0*wobble*3.14) + wobble*10.0)/13.0)), v_texCoord[1]);\\\n vec4 color_a = texture2D(u_image_a, pos);\\\n vec4 color_b = texture2D(u_image_b, pos);\\\n color_a[0] *= (1.0 - mix);\\\n color_a[1] *= (1.0 - mix);\\\n color_a[2] *= (1.0 - mix);\\\n color_a[3] *= (1.0 - mix);\\\n color_b[0] *= mix;\\\n color_b[1] *= mix;\\\n color_b[2] *= mix;\\\n color_b[3] *= mix;\\\n gl_FragColor = color_a + color_b;\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default dreamfade;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/dreamfade.js","const opacity = {\n \"title\": \"Opacity\",\n \"description\": \"Sets the opacity of an input.\",\n \"vertexShader\": `\n attribute vec2 a_position;\n attribute vec2 a_texCoord;\n varying vec2 v_texCoord;\n void main() {\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\n v_texCoord = a_texCoord;\n }`,\n \"fragmentShader\": `\n precision mediump float;\n uniform sampler2D u_image;\n uniform float opacity;\n varying vec2 v_texCoord;\n varying float v_opacity;\n void main(){\n vec4 color = texture2D(u_image, v_texCoord);\n color[3] *= opacity;\n gl_FragColor = color;\n }`,\n \"properties\": {\n \"opacity\": {\"type\": \"uniform\", \"value\": 0.7},\n },\n \"inputs\": [\"u_image\"],\n};\n\nexport default opacity;\n\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/opacity.js","let crop = {\n \"title\":\"Primer Simple Crop\",\n \"description\": \"A simple crop processors for primer\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float x;\\\n uniform float y;\\\n uniform float width;\\\n uniform float height;\\\n varying vec2 v_texCoord;\\\n varying float v_progress;\\\n void main(){\\\n vec2 pos = (((v_texCoord)*vec2(width, height)) + vec2(0, 1.0-height)) +vec2(x,-y);\\\n vec4 color = texture2D(u_image, pos);\\\n if (pos[0] < 0.0 || pos[0] > 1.0 || pos[1] < 0.0 || pos[1] > 1.0){\\\n color = vec4(0.0,0.0,0.0,0.0);\\\n }\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"x\":{type:\"uniform\", value:0.0},\n \"y\":{type:\"uniform\", value:0.0},\n \"width\":{type:\"uniform\", value:1.0},\n \"height\":{type:\"uniform\", value:1.0},\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default crop;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/crop.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nclass GraphNode {\n /**\n * Base class from which all processing and source nodes are derrived.\n */\n constructor(gl, renderGraph, inputNames, limitConnections=false){\n this._renderGraph = renderGraph;\n this._limitConnections = limitConnections;\n this._inputNames = inputNames;\n this._destroyed = false;\n\n //Setup WebGL output texture\n this._gl = gl;\n this._renderGraph = renderGraph;\n this._rendered =false;\n this._displayName = \"GraphNode\";\n }\n\n /**\n * Get a string representation of the class name.\n *\n * @return String A string of the class name.\n */ \n get displayName(){\n return this._displayName;\n }\n\n /**\n * Get the names of the inputs to this node.\n *\n * @return {String[]} An array of the names of the inputs ot the node.\n */ \n get inputNames(){\n return this._inputNames.slice();\n }\n\n /**\n * The maximum number of connections that can be made to this node. If there is not limit this will return Infinity.\n *\n * @return {number} The number of connections which can be made to this node.\n */\n get maximumConnections(){\n if (this._limitConnections ===false) return Infinity;\n return this._inputNames.length;\n }\n\n /**\n * Get an array of all the nodes which connect to this node.\n *\n * @return {GraphNode[]} An array of nodes which connect to this node.\n */\n get inputs(){\n let result = this._renderGraph.getInputsForNode(this);\n result = result.filter(function(n){return n !== undefined;});\n return result;\n }\n \n /**\n * Get an array of all the nodes which this node outputs to.\n *\n * @return {GraphNode[]} An array of nodes which this node connects to.\n */\n get outputs(){\n return this._renderGraph.getOutputsForNode(this);\n }\n\n /**\n * Get whether the node has been destroyed or not.\n *\n * @return {boolean} A true/false value of whather the node has been destoryed or not.\n */\n get destroyed(){\n return this._destroyed;\n }\n\n\n /**\n * Connect this node to the targetNode\n * \n * @param {GraphNode} targetNode - the node to connect.\n * @param {(number| String)} [targetPort] - the port on the targetNode to connect to, this can be an index, a string identifier, or undefined (in which case the next available port will be connected to).\n * \n */\n connect(targetNode, targetPort){\n return (this._renderGraph.registerConnection(this, targetNode, targetPort));\n }\n \n /**\n * Disconnect this node from the targetNode. If targetNode is undefind remove all out-bound connections.\n *\n * @param {GraphNode} [targetNode] - the node to disconnect from. If undefined, disconnect from all nodes.\n *\n */\n disconnect(targetNode){\n if (targetNode === undefined){\n let toRemove = this._renderGraph.getOutputsForNode(this);\n toRemove.forEach((target) => this._renderGraph.unregisterConnection(this, target));\n if (toRemove.length > 0) return true;\n return false;\n }\n return this._renderGraph.unregisterConnection(this, targetNode);\n }\n\n /**\n * Destory this node, removing it from the graph.\n */\n destroy(){\n this.disconnect();\n for (let input of this.inputs){\n input.disconnect(this);\n }\n this._destroyed = true;\n }\n}\n\nexport default GraphNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/graphnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport SourceNode, { SOURCENODESTATE } from \"./sourcenode\";\n\nclass ImageNode extends SourceNode {\n /**\n * Initialise an instance of an ImageNode.\n * This should not be called directly, but created through a call to videoContext.createImageNode();\n */\n constructor(src, gl, renderGraph, currentTime, preloadTime = 4, attributes = {}){\n super(src, gl, renderGraph, currentTime);\n this._preloadTime = preloadTime;\n this._attributes = attributes;\n this._textureUploaded = false;\n this._displayName = \"ImageNode\";\n }\n\n get elementURL(){\n return this._elementURL;\n }\n\n _load(){\n\n if (this._element !== undefined){\n for (var key in this._attributes) {\n this._element[key] = this._attributes[key];\n }\n return;\n }\n if (this._isResponsibleForElementLifeCycle){\n super._load();\n this._element = new Image();\n this._element.setAttribute(\"crossorigin\", \"anonymous\");\n this._element.src = this._elementURL;\n this._element.onload = () => {\n this._ready = true;\n this._triggerCallbacks(\"loaded\");\n };\n this._element.onerror = () => {\n console.error(\"ImageNode failed to load. url:\", this._elementURL);\n };\n\n for (let key in this._attributes) {\n this._element[key] = this._attributes[key];\n }\n }\n this._element.onerror = () => {\n console.debug(\"Error with element\", this._element);\n this._state = SOURCENODESTATE.error;\n //Event though there's an error ready should be set to true so the node can output transparenn\n this._ready = true;\n this._triggerCallbacks(\"error\");\n };\n }\n\n _unload(){\n super._unload();\n if (this._isResponsibleForElementLifeCycle){\n this._element.src = \"\";\n this._element.onerror = undefined;\n this._element = undefined;\n delete this._element;\n }\n this._ready = false;\n }\n\n _seek(time){\n super._seek(time);\n if (this.state === SOURCENODESTATE.playing || this.state === SOURCENODESTATE.paused){\n if (this._element === undefined) this._load();\n }\n if((this._state === SOURCENODESTATE.sequenced || this._state === SOURCENODESTATE.ended) && this._element !== undefined){\n this._unload();\n }\n }\n\n _update(currentTime){\n //if (!super._update(currentTime)) return false;\n if (this._textureUploaded){\n super._update(currentTime, false);\n }else{\n super._update(currentTime);\n }\n \n if (this._startTime - this._currentTime < this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();\n\n if (this._state === SOURCENODESTATE.playing){\n return true;\n } else if (this._state === SOURCENODESTATE.paused){\n return true;\n }\n else if (this._state === SOURCENODESTATE.ended && this._element !== undefined){\n this._unload();\n return false;\n }\n\n }\n\n}\n\nexport default ImageNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/SourceNodes/imagenode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport SourceNode, { SOURCENODESTATE } from \"./sourcenode\";\n\nclass CanvasNode extends SourceNode {\n /**\n * Initialise an instance of a CanvasNode.\n * This should not be called directly, but created through a call to videoContext.createCanvasNode();\n */\n constructor(canvas, gl, renderGraph, currentTime, preloadTime = 4){\n super(canvas, gl, renderGraph, currentTime);\n this._preloadTime = preloadTime;\n this._displayName = \"CanvasNode\";\n }\n\n _load(){\n super._load();\n this._ready = true;\n this._triggerCallbacks(\"loaded\"); \n }\n\n _unload(){\n super._unload();\n this._ready = false;\n }\n\n _seek(time){\n super._seek(time);\n if (this.state === SOURCENODESTATE.playing || this.state === SOURCENODESTATE.paused){\n if (this._element === undefined) this._load();\n this._ready = false;\n }\n if((this._state === SOURCENODESTATE.sequenced || this._state === SOURCENODESTATE.ended) && this._element !== undefined){\n this._unload();\n }\n }\n \n _update(currentTime){\n //if (!super._update(currentTime)) return false;\n super._update(currentTime);\n if (this._startTime - this._currentTime < this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();\n\n if (this._state === SOURCENODESTATE.playing){\n return true;\n } else if (this._state === SOURCENODESTATE.paused){\n return true;\n }\n else if (this._state === SOURCENODESTATE.ended && this._element !== undefined){\n this._unload();\n return false;\n }\n\n }\n\n}\n\nexport default CanvasNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/SourceNodes/canvasnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport ProcessingNode from \"./processingnode\";\nimport { createElementTexutre } from \"../utils.js\";\n\nclass CompositingNode extends ProcessingNode{\n /**\n * Initialise an instance of a Compositing Node. You should not instantiate this directly, but use VideoContest.createCompositingNode().\n */\n constructor(gl, renderGraph, definition){\n let placeholderTexture = createElementTexutre(gl);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));\n super(gl, renderGraph, definition, definition.inputs, false);\n this._placeholderTexture = placeholderTexture;\n this._displayName = \"CompositingNode\";\n }\n\n _render(){\n let gl = this._gl; \n gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this._texture,0);\n gl.clearColor(0, 0, 0, 0); // green;\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\n this.inputs.forEach((node) => {\n if (node === undefined)return;\n super._render();\n\n //map the input textures input the node\n var texture = node._texture;\n let textureOffset = 0;\n\n for(let mapping of this._inputTextureUnitMapping ){\n gl.activeTexture(mapping.textureUnit);\n let textureLocation = gl.getUniformLocation(this._program, mapping.name);\n gl.uniform1i(textureLocation, this._parameterTextureCount + textureOffset);\n textureOffset += 1;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n }\n\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n });\n \n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n}\n\nexport default CompositingNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ProcessingNodes/compositingnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport GraphNode from \"../graphnode\";\nimport { compileShader, createShaderProgram, createElementTexutre, updateTexture } from \"../utils.js\";\nimport { RenderException } from \"../exceptions.js\";\n\nclass ProcessingNode extends GraphNode{\n /**\n * Initialise an instance of a ProcessingNode.\n *\n * This class is not used directly, but is extended to create CompositingNodes, TransitionNodes, and EffectNodes.\n */\n constructor(gl, renderGraph, definition, inputNames, limitConnections){\n super(gl, renderGraph, inputNames, limitConnections);\n this._vertexShader = compileShader(gl, definition.vertexShader, gl.VERTEX_SHADER);\n this._fragmentShader = compileShader(gl, definition.fragmentShader, gl.FRAGMENT_SHADER);\n this._definition = definition;\n this._properties = {};//definition.properties;\n //copy definition properties\n for(let propertyName in definition.properties){\n let propertyValue = definition.properties[propertyName].value;\n //if an array then shallow copy it\n if(Object.prototype.toString.call(propertyValue) === \"[object Array]\"){\n propertyValue = definition.properties[propertyName].value.slice();\n }\n let propertyType = definition.properties[propertyName].type;\n this._properties[propertyName] = {type:propertyType, value:propertyValue};\n }\n\n this._inputTextureUnitMapping =[];\n this._maxTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n this._boundTextureUnits = 0;\n this._parameterTextureCount = 0;\n this._inputTextureCount = 0;\n this._texture = createElementTexutre(gl);\n gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGBA, gl.canvas.width, gl.canvas.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n //compile the shader\n this._program = createShaderProgram(gl, this._vertexShader, this._fragmentShader);\n\n //create and setup the framebuffer\n this._framebuffer = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this._texture,0);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n //create properties on this object for the passed properties\n for (let propertyName in this._properties){\n Object.defineProperty(this, propertyName, {\n get:function(){return this._properties[propertyName].value;},\n set:function(passedValue){this._properties[propertyName].value = passedValue;}\n });\n }\n\n //create texutres for any texture properties\n for (let propertyName in this._properties){\n let propertyValue = this._properties[propertyName].value;\n if (propertyValue instanceof Image){\n this._properties[propertyName].texture = createElementTexutre(gl);\n this._properties[propertyName].texutreUnit = gl.TEXTURE0 + this._boundTextureUnits;\n this._boundTextureUnits += 1;\n this._parameterTextureCount +=1;\n if (this._boundTextureUnits > this._maxTextureUnits){\n throw new RenderException(\"Trying to bind more than available textures units to shader\");\n }\n }\n }\n\n //calculate texutre units for input textures\n for(let inputName of definition.inputs){\n this._inputTextureUnitMapping.push({name:inputName, textureUnit:gl.TEXTURE0 + this._boundTextureUnits});\n this._boundTextureUnits += 1;\n this._inputTextureCount += 1;\n if (this._boundTextureUnits > this._maxTextureUnits){\n throw new RenderException(\"Trying to bind more than available textures units to shader\");\n }\n }\n\n\n //find the locations of the properties in the compiled shader\n for (let propertyName in this._properties){\n if (this._properties[propertyName].type === \"uniform\"){\n this._properties[propertyName].location = this._gl.getUniformLocation(this._program, propertyName);\n }\n }\n this._currentTimeLocation = this._gl.getUniformLocation(this._program, \"currentTime\");\n this._currentTime = 0;\n\n\n //Other setup\n let positionLocation = gl.getAttribLocation(this._program, \"a_position\");\n let buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.enableVertexAttribArray(positionLocation);\n gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);\n gl.bufferData(\n gl.ARRAY_BUFFER,\n new Float32Array([\n 1.0, 1.0,\n 0.0, 1.0,\n 1.0, 0.0,\n 1.0, 0.0,\n 0.0, 1.0,\n 0.0, 0.0]),\n gl.STATIC_DRAW);\n let texCoordLocation = gl.getAttribLocation(this._program, \"a_texCoord\");\n gl.enableVertexAttribArray(texCoordLocation);\n gl.vertexAttribPointer(texCoordLocation, 2, gl.FLOAT, false, 0, 0);\n this._displayName = \"ProcessingNode\";\n\n }\n\n /**\n * Sets the passed processing node property to the passed value.\n * @param {string} name - The name of the processing node parameter to modify.\n * @param {Object} value - The value to set it to.\n *\n * @example \n * var ctx = new VideoContext();\n * var monoNode = ctx.effect(VideoContext.DEFINITIONS.MONOCHROME);\n * monoNode.setProperty(\"inputMix\", [1.0,0.0,0.0]); //Just use red channel\n */\n setProperty(name, value){\n this._properties[name].value = value;\n }\n\n /**\n * Sets the passed processing node property to the passed value.\n * @param {string} name - The name of the processing node parameter to get.\n *\n * @example \n * var ctx = new VideoContext();\n * var monoNode = ctx.effect(VideoContext.DEFINITIONS.MONOCHROME);\n * console.log(monoNode.getProperty(\"inputMix\")); //Will output [0.4,0.6,0.2], the default value from the effect definition.\n * \n */\n getProperty(name){\n return this._properties[name].value;\n }\n\n /**\n * Destroy and clean-up the node.\n */\n destroy(){\n super.destroy();\n //destrpy texutres for any texture properties\n for (let propertyName in this._properties){\n let propertyValue = this._properties[propertyName].value;\n if (propertyValue instanceof Image){\n this._gl.deleteTexture(this._properties[propertyName].texture);\n this._texture = undefined;\n }\n }\n //Destroy main\n this._gl.deleteTexture(this._texture);\n this._texture = undefined;\n //Detach shaders\n this._gl.detachShader(this._program, this._vertexShader);\n this._gl.detachShader(this._program, this._fragmentShader);\n //Delete shaders\n this._gl.deleteShader(this._vertexShader);\n this._gl.deleteShader(this._fragmentShader);\n //Delete program\n this._gl.deleteProgram(this._program);\n //Delete Framebuffer\n this._gl.deleteFramebuffer(this._framebuffer);\n }\n\n _update(currentTime){\n this._currentTime = currentTime;\n }\n\n _seek(currentTime){\n this._currentTime = currentTime;\n }\n\n _render(){\n this._rendered = true;\n let gl = this._gl;\n gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);\n\n gl.useProgram(this._program);\n\n //upload the default uniforms\n gl.uniform1f(this._currentTimeLocation, parseFloat(this._currentTime));\n\n //upload/update the custom uniforms\n let textureOffset = 0;\n\n for (let propertyName in this._properties){\n let propertyValue = this._properties[propertyName].value;\n let propertyType = this._properties[propertyName].type;\n let propertyLocation = this._properties[propertyName].location;\n if (propertyType !== \"uniform\") continue;\n\n if (typeof propertyValue === \"number\"){\n gl.uniform1f(propertyLocation, propertyValue);\n }\n else if( Object.prototype.toString.call(propertyValue) === \"[object Array]\"){\n if(propertyValue.length === 1){\n gl.uniform1fv(propertyLocation, propertyValue);\n } else if(propertyValue.length === 2){\n gl.uniform2fv(propertyLocation, propertyValue);\n } else if(propertyValue.length === 3){\n gl.uniform3fv(propertyLocation, propertyValue);\n } else if(propertyValue.length === 4){\n gl.uniform4fv(propertyLocation, propertyValue);\n } else{\n console.debug(\"Shader parameter\", propertyName, \"is too long an array:\", propertyValue);\n }\n } else if(propertyValue instanceof Image){\n let texture = this._properties[propertyName].texture;\n let textureUnit = this._properties[propertyName].texutreUnit;\n updateTexture(gl, texture, propertyValue);\n\n gl.activeTexture(textureUnit);\n gl.uniform1i(propertyLocation, textureOffset);\n textureOffset += 1;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n }\n else{\n //TODO - add tests for textures\n /*gl.activeTexture(gl.TEXTURE0 + textureOffset);\n gl.uniform1i(parameterLoctation, textureOffset);\n gl.bindTexture(gl.TEXTURE_2D, textures[textureOffset-1]);*/\n }\n }\n\n }\n}\n\nexport default ProcessingNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ProcessingNodes/processingnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nexport function ConnectException(message){\n this.message = message;\n this.name = \"ConnectionException\";\n}\n\nexport function RenderException(message){\n this.message = message;\n this.name = \"RenderException\";\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/exceptions.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport ProcessingNode from \"../ProcessingNodes/processingnode\";\n\nclass DestinationNode extends ProcessingNode {\n /**\n * Initialise an instance of a DestinationNode. \n *\n * There should only be a single instance of a DestinationNode per VideoContext instance. An VideoContext's destination can be accessed like so: videoContext.desitnation.\n * \n * You should not instantiate this directly.\n */\n constructor(gl, renderGraph){ \n \n let vertexShader = \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\";\n\n let fragmentShader = \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n varying float v_progress;\\\n void main(){\\\n gl_FragColor = texture2D(u_image, v_texCoord);\\\n }\";\n\n let deffinition = {fragmentShader:fragmentShader, vertexShader:vertexShader, properties:{}, inputs:[\"u_image\"]};\n\n super(gl, renderGraph, deffinition, deffinition.inputs, false);\n this._displayName = \"DestinationNode\";\n }\n\n _render(){\n let gl = this._gl; \n\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n gl.enable(gl.BLEND);\n gl.clearColor(0, 0, 0, 0.0); // green;\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n this.inputs.forEach((node)=>{\n super._render();\n //map the input textures input the node\n var texture = node._texture;\n let textureOffset = 0;\n\n for(let mapping of this._inputTextureUnitMapping ){\n gl.activeTexture(mapping.textureUnit);\n let textureLocation = gl.getUniformLocation(this._program, mapping.name);\n gl.uniform1i(textureLocation, this._parameterTextureCount + textureOffset);\n textureOffset += 1;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n }\n\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n });\n }\n}\n\nexport default DestinationNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/DestinationNode/destinationnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport ProcessingNode from \"./processingnode\";\nimport { createElementTexutre } from \"../utils.js\";\n\nclass EffectNode extends ProcessingNode{\n /**\n * Initialise an instance of an EffectNode. You should not instantiate this directly, but use VideoContest.createEffectNode().\n */\n constructor(gl, renderGraph, definition){\n let placeholderTexture = createElementTexutre(gl);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));\n\n super(gl, renderGraph, definition, definition.inputs, true);\n \n this._placeholderTexture = placeholderTexture;\n this._displayName = \"EffectNode\";\n }\n \n _render(){\n let gl = this._gl;\n gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this._texture,0);\n gl.clearColor(0, 0, 0, 0); // green;\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n super._render();\n\n let inputs = this._renderGraph.getInputsForNode(this);\n let textureOffset = 0;\n\n for (var i = 0; i < this._inputTextureUnitMapping.length; i++) {\n let inputTexture = this._placeholderTexture; \n let textureUnit = this._inputTextureUnitMapping[i].textureUnit;\n let textureName = this._inputTextureUnitMapping[i].name;\n if (i < inputs.length && inputs[i] !== undefined){\n inputTexture = inputs[i]._texture;\n }\n\n gl.activeTexture(textureUnit);\n let textureLocation = gl.getUniformLocation(this._program, textureName);\n gl.uniform1i(textureLocation, this._parameterTextureCount + textureOffset);\n textureOffset += 1;\n gl.bindTexture(gl.TEXTURE_2D, inputTexture);\n }\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n}\n\nexport default EffectNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ProcessingNodes/effectnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport EffectNode from \"./effectnode\";\n\nclass TransitionNode extends EffectNode{\n /**\n * Initialise an instance of a TransitionNode. You should not instantiate this directly, but use VideoContest.createTransitonNode().\n */\n constructor(gl, renderGraph, definition){\n super(gl, renderGraph, definition);\n this._transitions = {};\n \n //save a version of the original property values\n this._initialPropertyValues = {};\n for (let propertyName in this._properties){\n this._initialPropertyValues[propertyName] = this._properties[propertyName].value;\n }\n this._displayName = \"TransitionNode\";\n }\n\n _doesTransitionFitOnTimeline(testTransition){\n if (this._transitions[testTransition.property] === undefined) return true;\n for (let transition of this._transitions[testTransition.property]) {\n if (testTransition.start > transition.start && testTransition.start < transition.end)return false;\n if (testTransition.end > transition.start && testTransition.end < transition.end)return false;\n if(transition.start > testTransition.start && transition.start < testTransition.end) return false;\n if(transition.end > testTransition.start && transition.end < testTransition.end) return false;\n }\n return true;\n }\n\n _insertTransitionInTimeline(transition){\n if (this._transitions[transition.property] === undefined) this._transitions[transition.property] = [];\n this._transitions[transition.property].push(transition);\n\n this._transitions[transition.property].sort(function(a,b){\n return a.start - b.start;\n });\n }\n\n /**\n * Create a transition on the timeline.\n * \n * @param {number} startTime - The time at which the transition should start (relative to currentTime of video context).\n * @param {number} endTime - The time at which the transition should be completed by (relative to currentTime of video context).\n * @param {number} currentValue - The value to start the transition at.\n * @param {number} targetValue - The value to transition to by endTime.\n * @param {String} propertyName - The name of the property to clear transitions on, if undefined default to \"mix\".\n * \n * @return {Boolean} returns True if a transition is successfully added, false otherwise.\n */\n transition(startTime, endTime, currentValue, targetValue, propertyName=\"mix\"){\n let transition = {start:startTime + this._currentTime, end:endTime + this._currentTime, current:currentValue, target:targetValue, property:propertyName};\n if (!this._doesTransitionFitOnTimeline(transition))return false;\n this._insertTransitionInTimeline(transition);\n return true;\n }\n\n\n /**\n * Create a transition on the timeline at an absolute time.\n * \n * @param {number} startTime - The time at which the transition should start (relative to time 0).\n * @param {number} endTime - The time at which the transition should be completed by (relative to time 0).\n * @param {number} currentValue - The value to start the transition at.\n * @param {number} targetValue - The value to transition to by endTime.\n * @param {String} propertyName - The name of the property to clear transitions on, if undefined default to \"mix\".\n * \n * @return {Boolean} returns True if a transition is successfully added, false otherwise.\n */\n transitionAt(startTime, endTime, currentValue, targetValue, propertyName=\"mix\"){\n let transition = {start:startTime, end:endTime, current:currentValue, target:targetValue, property:propertyName};\n if (!this._doesTransitionFitOnTimeline(transition))return false;\n this._insertTransitionInTimeline(transition);\n return true;\n }\n\n /**\n * Clear all transistions on the passed property. If no property is defined clear all transitions on the node.\n * \n * @param {String} propertyName - The name of the property to clear transitions on, if undefined clear all transitions on the node.\n */\n clearTransitions(propertyName){\n if (propertyName === undefined){\n this._transitions = {};\n }else{\n this._transitions[propertyName] = [];\n }\n }\n \n /**\n * Clear a transistion on the passed property that the specified time lies within.\n * \n * @param {String} propertyName - The name of the property to clear a transition on.\n * @param {number} time - A time which lies within the property you're trying to clear.\n *\n * @return {Boolean} returns True if a transition is removed, false otherwise.\n */\n clearTransition(propertyName, time){\n let transitionIndex = undefined;\n for (var i = 0; i < this._transitions[propertyName].length; i++) {\n let transition = this._transitions[propertyName][i];\n if (time > transition.start && time < transition.end){\n transitionIndex = i;\n }\n }\n if(transitionIndex !== undefined){\n this._transitions[propertyName].splice(transitionIndex, 1);\n return true;\n }\n return false;\n }\n\n _update(currentTime){\n super._update(currentTime);\n for (let propertyName in this._transitions){\n let value = this[propertyName];\n if (this._transitions[propertyName].length > 0){\n value = this._transitions[propertyName][0].current;\n }\n let transitionActive = false;\n\n for (var i = 0; i < this._transitions[propertyName].length; i++) {\n let transition = this._transitions[propertyName][i];\n if (currentTime > transition.end){\n value = transition.target;\n continue;\n }\n\n if (currentTime > transition.start && currentTime < transition.end){\n let difference = transition.target - transition.current;\n let progress = (this._currentTime - transition.start)/(transition.end - transition.start);\n transitionActive = true;\n this[propertyName] = transition.current + (difference * progress);\n break;\n }\n }\n\n if(!transitionActive)this[propertyName] = value;\n }\n }\n}\n\nexport default TransitionNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ProcessingNodes/transitionnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport { ConnectException } from \"./exceptions.js\";\n\n\nclass RenderGraph {\n /**\n * Manages the rendering graph.\n */\n constructor(){\n this.connections = [];\n }\n\n /**\n * Get a list of nodes which are connected to the output of the passed node.\n * \n * @param {GraphNode} node - the node to get the outputs for.\n * @return {GraphNode[]} An array of the nodes which are connected to the output.\n */\n getOutputsForNode(node){\n let results = [];\n this.connections.forEach(function(connection){\n if (connection.source === node){\n results.push(connection.destination);\n }\n });\n return results;\n }\n \n /**\n * Get a list of nodes which are connected, by input name, to the given node. Array contains objects of the form: {\"source\":sourceNode, \"type\":\"name\", \"name\":inputName, \"destination\":destinationNode}.\n *\n * @param {GraphNode} node - the node to get the named inputs for.\n * @return {Object[]} An array of objects representing the nodes and connection type, which are connected to the named inputs for the node.\n */\n getNamedInputsForNode(node){\n let results = [];\n this.connections.forEach(function(connection){\n if (connection.destination === node && connection.type === \"name\"){\n results.push(connection);\n }\n });\n return results;\n }\n\n /**\n * Get a list of nodes which are connected, by z-index name, to the given node. Array contains objects of the form: {\"source\":sourceNode, \"type\":\"zIndex\", \"zIndex\":0, \"destination\":destinationNode}.\n * \n * @param {GraphNode} node - the node to get the z-index refernced inputs for.\n * @return {Object[]} An array of objects representing the nodes and connection type, which are connected by z-Index for the node.\n */\n getZIndexInputsForNode(node){\n let results = [];\n this.connections.forEach(function(connection){\n if (connection.destination === node && connection.type === \"zIndex\"){\n results.push(connection);\n }\n });\n results.sort(function(a,b){\n return a.zIndex - b.zIndex;\n });\n return results; \n }\n\n /**\n * Get a list of nodes which are connected as inputs to the given node. The length of the return array is always equal to the number of inputs for the node, with undefined taking the place of any inputs not connected.\n * \n * @param {GraphNode} node - the node to get the inputs for.\n * @return {GraphNode[]} An array of GraphNodes which are connected to the node.\n */\n getInputsForNode(node){\n let inputNames = node.inputNames; \n let results = [];\n let namedInputs = this.getNamedInputsForNode(node);\n let indexedInputs = this.getZIndexInputsForNode(node);\n\n if(node._limitConnections === true){\n for (let i = 0; i < inputNames.length; i++) {\n results[i] = undefined;\n }\n \n for(let connection of namedInputs){\n let index = inputNames.indexOf(connection.name);\n results[index] = connection.source;\n }\n let indexedInputsIndex = 0;\n for (let i = 0; i < results.length; i++) {\n if (results[i] === undefined && indexedInputs[indexedInputsIndex]!== undefined){\n results[i] = indexedInputs[indexedInputsIndex].source;\n indexedInputsIndex += 1;\n }\n }\n }else{\n for(let connection of namedInputs){\n results.push(connection.source);\n }\n for(let connection of indexedInputs){\n results.push(connection.source);\n }\n }\n return results;\n }\n\n /**\n * Check if a named input on a node is available to connect too.\n * @param {GraphNode} node - the node to check.\n * @param {String} inputName - the named input to check.\n */\n isInputAvailable(node, inputName){\n if (node._inputNames.indexOf(inputName) === -1) return false;\n for(let connection of this.connections){\n if (connection.type === \"name\"){\n if (connection.destination === node && connection.name === inputName){\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * Register a connection between two nodes.\n * \n * @param {GraphNode} sourceNode - the node to connect from.\n * @param {GraphNode} destinationNode - the node to connect to.\n * @param {(String | number)} [target] - the target port of the conenction, this could be a string to specfiy a specific named port, a number to specify a port by index, or undefined, in which case the next available port will be connected to.\n * @return {boolean} Will return true if connection succeeds otherwise will throw a ConnectException.\n */\n registerConnection(sourceNode, destinationNode, target){\n if (destinationNode.inputs.length >= destinationNode.inputNames.length && destinationNode._limitConnections === true){\n throw new ConnectException(\"Node has reached max number of inputs, can't connect\");\n }\n \n if (destinationNode._limitConnections === false){\n //check if connection is already made, if so raise a warning\n const inputs = this.getInputsForNode(destinationNode);\n if (inputs.includes(sourceNode)){\n console.debug(\"WARNING - node connected mutliple times, removing previous connection\");\n this.unregisterConnection(sourceNode, destinationNode);\n }\n }\n\n if (typeof target === \"number\"){\n //target is a specific\n this.connections.push({\"source\":sourceNode, \"type\":\"zIndex\", \"zIndex\":target, \"destination\":destinationNode});\n } else if (typeof target === \"string\" && destinationNode._limitConnections){\n //target is a named port\n\n //make sure named port is free\n if (this.isInputAvailable(destinationNode, target)){\n this.connections.push({\"source\":sourceNode, \"type\":\"name\", \"name\":target, \"destination\":destinationNode});\n }else{\n throw new ConnectException(\"Port \"+target+\" is already connected to\");\n }\n\n } else{\n //target is undefined so just make it a high zIndex\n let indexedConns = this.getZIndexInputsForNode(destinationNode);\n let index = 0;\n if (indexedConns.length > 0)index = indexedConns[indexedConns.length-1].zIndex +1;\n this.connections.push({\"source\":sourceNode, \"type\":\"zIndex\", \"zIndex\":index, \"destination\":destinationNode});\n }\n return true;\n }\n \n /**\n * Remove a connection between two nodes.\n * @param {GraphNode} sourceNode - the node to unregsiter connection from.\n * @param {GraphNode} destinationNode - the node to register connection to.\n * @return {boolean} Will return true if removing connection succeeds, or false if there was no connectionsction to remove.\n */\n unregisterConnection(sourceNode, destinationNode){\n let toRemove = [];\n \n this.connections.forEach(function(connection){\n if (connection.source === sourceNode && connection.destination === destinationNode){\n toRemove.push(connection);\n }\n });\n\n if (toRemove.length === 0) return false;\n\n toRemove.forEach((removeNode) => {\n let index = this.connections.indexOf(removeNode);\n this.connections.splice(index, 1);\n });\n\n return true;\n }\n\n static outputEdgesFor(node, connections){\n let results = [];\n for(let conn of connections){\n if (conn.source === node){\n results.push(conn);\n }\n }\n return results;\n }\n\n static inputEdgesFor(node, connections){\n let results = [];\n for(let conn of connections){\n if (conn.destination === node){\n results.push(conn);\n }\n }\n return results;\n }\n\n static getInputlessNodes(connections){\n let inputLess = [];\n for (let conn of connections){\n inputLess.push(conn.source);\n }\n for (let conn of connections){\n let index = inputLess.indexOf(conn.destination);\n if (index !== -1){\n inputLess.splice(index, 1);\n }\n }\n return inputLess;\n }\n}\n\nexport default RenderGraph;\n\n\n\n// WEBPACK FOOTER //\n// ./src/rendergraph.js","function stripHash (url){\n if (url.port === \"\" || url.port === undefined){\n return `${url.protocol}//${url.hostname}${url.pathname}`;\n } else {\n return `${url.protocol}//${url.hostname}:${url.port}${url.pathname}`;\n }\n}\n\nclass VideoElementCache {\n\n constructor(cache_size = 3) {\n this._elements = [];\n this._elementsInitialised = false;\n for (let i = 0; i < cache_size; i++) {\n let element = this._createElement(); \n this._elements.push(element);\n }\n }\n\n\n _createElement(){\n let videoElement = document.createElement(\"video\");\n videoElement.setAttribute(\"crossorigin\", \"anonymous\");\n videoElement.setAttribute(\"webkit-playsinline\", \"\");\n videoElement.setAttribute(\"playsinline\", \"\");\n videoElement.src = \"\";\n return videoElement;\n }\n\n init(){\n if (!this._elementsInitialised){\n for(let element of this._elements){\n try {\n element.play().then(()=>{\n }, (e)=>{\n if (e.name !== \"NotSupportedError\")throw(e);\n });\n } catch(e) {\n //console.log(e.name);\n }\n } \n }\n this._elementsInitialised = true;\n }\n\n get() {\n //Try and get an already intialised element.\n for (let element of this._elements) {\n // For some reason an uninitialised videoElement has its sr attribute set to the windows href. Hence the below check.\n if ((element.src === \"\" || element.src === undefined || element.src === stripHash(window.location)) && element.srcObject == null )return element;\n }\n //Fallback to creating a new element if non exists.\n console.debug(\"No available video element in the cache, creating a new one. This may break mobile, make your initial cache larger.\");\n let element = this._createElement();\n this._elements.push(element);\n this._elementsInitialised = false;\n return element;\n }\n\n get length(){\n return this._elements.length;\n }\n\n get unused(){\n let count = 0;\n for (let element of this._elements) {\n // For some reason an uninitialised videoElement has its sr attribute set to the windows href. Hence the below check.\n if ((element.src === \"\" || element.src === undefined || element.src === stripHash(window.location)) && element.srcObject == null )count += 1;\n }\n return count;\n }\n\n}\n\nexport default VideoElementCache;\n\n\n// WEBPACK FOOTER //\n// ./src/videoelementcache.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 1f6f6efa3622032d049e","webpack:///./src/videocontext.js","webpack:///./src/SourceNodes/videonode.js","webpack:///./src/SourceNodes/sourcenode.js","webpack:///./src/utils.js","webpack:///./src/Definitions/definitions.js","webpack:///./src/Definitions/aaf_video_scale.js","webpack:///./src/Definitions/crossfade.js","webpack:///./src/Definitions/horizontalWipe.js","webpack:///./src/Definitions/verticalWipe.js","webpack:///./src/Definitions/randomDissolve.js","webpack:///./src/Definitions/toColorAndBackFade.js","webpack:///./src/Definitions/starWipe.js","webpack:///./src/Definitions/combine.js","webpack:///./src/Definitions/colorThreshold.js","webpack:///./src/Definitions/monochrome.js","webpack:///./src/Definitions/horizontalBlur.js","webpack:///./src/Definitions/verticalBlur.js","webpack:///./src/Definitions/aaf_video_flop.js","webpack:///./src/Definitions/aaf_video_flip.js","webpack:///./src/Definitions/aaf_video_position.js","webpack:///./src/Definitions/aaf_video_crop.js","webpack:///./src/Definitions/staticDissolve.js","webpack:///./src/Definitions/staticEffect.js","webpack:///./src/Definitions/dreamfade.js","webpack:///./src/Definitions/opacity.js","webpack:///./src/Definitions/crop.js","webpack:///./src/graphnode.js","webpack:///./src/SourceNodes/imagenode.js","webpack:///./src/SourceNodes/canvasnode.js","webpack:///./src/ProcessingNodes/compositingnode.js","webpack:///./src/ProcessingNodes/processingnode.js","webpack:///./src/exceptions.js","webpack:///./src/DestinationNode/destinationnode.js","webpack:///./src/ProcessingNodes/effectnode.js","webpack:///./src/ProcessingNodes/transitionnode.js","webpack:///./src/rendergraph.js","webpack:///./src/videoelementcache.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;;;mDCrCsB,CAA4B;;;;mDAC5B,EAA4B;;;;oDAC3B,EAA6B;;;;oDACpB,CAA6B;;6DACjC,EAAsC;;;;6DACtC,EAAsC;;;;wDAC3C,EAAiC;;;;4DAC7B,EAAqC;;;;0CACxC,EAAk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eAAE;AACR,iBAAI,KAAK,GAAG,CAAC,CAAC;;;;;;AACd,uCAAoB,IAAI,CAAC,SAAS,mIAAE;yBAA3B,OAAO;;;AAEZ,yBAAI,CAAC,OAAO,CAAC,GAAG,KAAK,EAAE,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAM,OAAO,CAAC,SAAS,IAAI,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC;kBACjJ;;;;;;;;;;;;;;;;AACD,oBAAO,KAAK,CAAC;UAChB;;;YA9DC,iBAAiB;;;sBAkER,iBAAiB","file":"videocontext.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VideoContext\"] = factory();\n\telse\n\t\troot[\"VideoContext\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 1f6f6efa3622032d049e","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport VideoNode from \"./SourceNodes/videonode.js\";\nimport ImageNode from \"./SourceNodes/imagenode.js\";\nimport CanvasNode from \"./SourceNodes/canvasnode.js\";\nimport { SOURCENODESTATE } from \"./SourceNodes/sourcenode.js\";\nimport CompositingNode from \"./ProcessingNodes/compositingnode.js\";\nimport DestinationNode from \"./DestinationNode/destinationnode.js\";\nimport EffectNode from \"./ProcessingNodes/effectnode.js\";\nimport TransitionNode from \"./ProcessingNodes/transitionnode.js\";\nimport RenderGraph from \"./rendergraph.js\";\nimport VideoElementCache from \"./videoelementcache.js\";\nimport { createSigmaGraphDataFromRenderGraph, visualiseVideoContextTimeline, visualiseVideoContextGraph, createControlFormForNode, UpdateablesManager, exportToJSON, importSimpleEDL, snapshot, generateRandomId } from \"./utils.js\";\nimport DEFINITIONS from \"./Definitions/definitions.js\";\n\nlet updateablesManager = new UpdateablesManager();\n\n/**\n * VideoContext.\n * @module VideoContext\n */\nexport default class VideoContext{\n /**\n * 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.\n *\n * @param {Canvas} canvas - the canvas element to render the output to.\n * @param {function} initErrorCallback - a callback for if initialising the canvas failed.\n * @param {Object} options - a nuber of custom options which can be set on the VideoContext, generally best left as default.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement, function(){console.error(\"Sorry, your browser dosen\\'t support WebGL\");});\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(10);\n * ctx.play();\n *\n */\n constructor(canvas, initErrorCallback, options={\"preserveDrawingBuffer\":true, \"manualUpdate\":false, \"endOnLastSourceEnd\":true, useVideoElementCache:true, videoElementCacheSize:6, webglContextAttributes: {preserveDrawingBuffer: true, alpha: false }}){\n this._canvas = canvas;\n let manualUpdate = false;\n this.endOnLastSourceEnd = true;\n let webglContextAttributes = {preserveDrawingBuffer: true, alpha: false };\n\n if (\"manualUpdate\" in options) manualUpdate = options.manualUpdate;\n if (\"endOnLastSourceEnd\" in options) this._endOnLastSourceEnd = options.endOnLastSourceEnd;\n if (\"webglContextAttributes\" in options) webglContextAttributes = options.webglContextAttributes;\n\n if (webglContextAttributes.alpha === undefined) webglContextAttributes.alpha = false;\n if (webglContextAttributes.alpha === true){\n console.error(\"webglContextAttributes.alpha must be false for correct opeation\");\n }\n\n\n this._gl = canvas.getContext(\"experimental-webgl\", webglContextAttributes);\n if(this._gl === null){\n console.error(\"Failed to intialise WebGL.\");\n if(initErrorCallback)initErrorCallback();\n return;\n }\n\n // Initialise the video element cache\n if(options.useVideoElementCache === undefined) options.useVideoElementCache = true;\n this._useVideoElementCache = options.useVideoElementCache;\n if (this._useVideoElementCache){\n if (!options.videoElementCacheSize) options.videoElementCacheSize = 5;\n this._videoElementCache = new VideoElementCache(options.videoElementCacheSize);\n }\n \n // Create a unique ID for this VideoContext which can be used in the debugger.\n if(this._canvas.id) {\n if (typeof this._canvas.id === \"string\" || this._canvas.id instanceof String){\n this._id = canvas.id;\n }\n }\n if(this._id === undefined) this._id = generateRandomId();\n if (window.__VIDEOCONTEXT_REFS__ === undefined) window.__VIDEOCONTEXT_REFS__ = {};\n window.__VIDEOCONTEXT_REFS__[this._id] = this;\n\n\n this._renderGraph = new RenderGraph();\n this._sourceNodes = [];\n this._processingNodes = [];\n this._timeline = [];\n this._currentTime = 0;\n this._state = VideoContext.STATE.PAUSED;\n this._playbackRate = 1.0;\n this._volume = 1.0;\n this._sourcesPlaying = undefined;\n this._destinationNode = new DestinationNode(this._gl, this._renderGraph);\n\n this._callbacks = new Map();\n this._callbacks.set(\"stalled\", []);\n this._callbacks.set(\"update\", []);\n this._callbacks.set(\"ended\", []);\n this._callbacks.set(\"content\", []);\n this._callbacks.set(\"nocontent\", []);\n\n this._timelineCallbacks = [];\n\n if(!manualUpdate){\n updateablesManager.register(this);\n }\n }\n\n /**\n * Reurns an ID assigned to the VideoContext instance. This will either be the same id as the underlying canvas element,\n * or a uniquley generated one.\n */\n get id(){\n return this._id;\n }\n\n /**\n * Set the ID of the VideoContext instance. This should be unique.\n */\n set id(newID){\n delete window.__VIDEOCONTEXT_REFS__[this._id];\n if (window.__VIDEOCONTEXT_REFS__[newID] !== undefined) console.warn(\"Warning; setting id to that of an existing VideoContext instance.\");\n window.__VIDEOCONTEXT_REFS__[newID] = this;\n this._id = newID;\n }\n\n /**\n * Register a callback to happen at a specific point in time.\n * @param {number} time - the time at which to trigger the callback.\n * @param {Function} func - the callback to register.\n * @param {number} ordering - the order in which to call the callback if more than one is registered for the same time.\n */\n registerTimelineCallback(time, func, ordering= 0){\n this._timelineCallbacks.push({\"time\":time, \"func\":func, \"ordering\":ordering});\n }\n\n\n /**\n * Unregister a callback which happens at a specific point in time.\n * @param {Function} func - the callback to unregister.\n */\n unregisterTimelineCallback(func){\n let toRemove = [];\n for(let callback of this._timelineCallbacks){\n if (callback.func === func){\n toRemove.push(callback);\n }\n }\n for (let callback of toRemove){\n let index = this._timelineCallbacks.indexOf(callback);\n this._timelineCallbacks.splice(index, 1);\n }\n }\n\n /**\n * Regsiter a callback to listen to one of the following events: \"stalled\", \"update\", \"ended\", \"content\", \"nocontent\"\n *\n * \"stalled\" happend anytime playback is stopped due to unavailbale data for playing assets (i.e video still loading)\n * . \"update\" is called any time a frame is rendered to the screen. \"ended\" is called once plackback has finished\n * (i.e ctx.currentTime == ctx.duration). \"content\" is called a the start of a time region where there is content\n * playing out of one or more sourceNodes. \"nocontent\" is called at the start of any time region where the\n * VideoContext is still playing, but there are currently no activly playing soureces.\n *\n * @param {String} type - the event to register against (\"stalled\", \"update\", or \"ended\").\n * @param {Function} func - the callback to register.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * ctx.registerCallback(\"stalled\", function(){console.log(\"Playback stalled\");});\n * ctx.registerCallback(\"update\", function(){console.log(\"new frame\");});\n * ctx.registerCallback(\"ended\", function(){console.log(\"Playback ended\");});\n */\n registerCallback(type, func){\n if (!this._callbacks.has(type)) return false;\n this._callbacks.get(type).push(func);\n }\n\n /**\n * Remove a previously registed callback\n *\n * @param {Function} func - the callback to remove.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n *\n * //the callback\n * var updateCallback = function(){console.log(\"new frame\")};\n *\n * //register the callback\n * ctx.registerCallback(\"update\", updateCallback);\n * //then unregister it\n * ctx.unregisterCallback(updateCallback);\n *\n */\n unregisterCallback(func){\n for(let funcArray of this._callbacks.values()){\n let index = funcArray.indexOf(func);\n if (index !== -1){\n funcArray.splice(index, 1);\n return true;\n }\n }\n return false;\n }\n\n _callCallbacks(type){\n let funcArray = this._callbacks.get(type);\n for (let func of funcArray){\n func(this._currentTime);\n }\n }\n\n /**\n * Get the canvas that the VideoContext is using.\n *\n * @return {HTMLElement} The canvas that the VideoContext is using.\n *\n */\n get element(){\n return this._canvas;\n }\n\n /**\n * Get the current state.\n *\n * This will be either\n * - VideoContext.STATE.PLAYING: current sources on timeline are active\n * - VideoContext.STATE.PAUSED: all sources are paused\n * - VideoContext.STATE.STALLED: one or more sources is unable to play\n * - VideoContext.STATE.ENDED: all sources have finished playing\n * - VideoContext.STATE.BROKEN: the render graph is in a broken state\n * @return {number} The number representing the state.\n *\n */\n get state(){\n return this._state;\n }\n\n /**\n * Set the progress through the internal timeline.\n * Setting this can be used as a way to implement a scrubaable timeline.\n *\n * @param {number} currentTime - this is the currentTime to set the context to.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(20);\n * ctx.currentTime = 10; // seek 10 seconds in\n * ctx.play();\n *\n */\n set currentTime(currentTime){\n if (currentTime < this.duration && this._state === VideoContext.STATE.ENDED) this._state = VideoContext.STATE.PAUSED;\n\n if (typeof currentTime === \"string\" || currentTime instanceof String){\n currentTime = parseFloat(currentTime);\n }\n\n for (let i = 0; i < this._sourceNodes.length; i++) {\n this._sourceNodes[i]._seek(currentTime);\n }\n for (let i = 0; i < this._processingNodes.length; i++) {\n this._processingNodes[i]._seek(currentTime);\n }\n this._currentTime = currentTime;\n }\n\n /**\n * Get how far through the internal timeline has been played.\n *\n * Getting this value will give the current playhead position. Can be used for updating timelines.\n * @return {number} The time in seconds through the current playlist.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(10);\n * ctx.play();\n * setTimeout(function(){console.log(ctx.currentTime);},1000); //should print roughly 1.0\n *\n */\n get currentTime(){\n return this._currentTime;\n }\n\n /**\n * Get the time at which the last node in the current internal timeline finishes playing.\n *\n * @return {number} The end time in seconds of the last video node to finish playing.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * console.log(ctx.duration); //prints 0\n *\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(10);\n *\n * console.log(ctx.duration); //prints 10\n *\n * ctx.play();\n */\n get duration(){\n let maxTime = 0;\n for (let i = 0; i < this._sourceNodes.length; i++) {\n if (this._sourceNodes[i].state !== SOURCENODESTATE.waiting &&this._sourceNodes[i]._stopTime > maxTime){\n maxTime = this._sourceNodes[i]._stopTime;\n }\n }\n return maxTime;\n }\n\n\n /**\n * Get the final node in the render graph which represents the canvas to display content on to.\n *\n * This proprety is read-only and there can only ever be one destination node. Other nodes can connect to this but you cannot connect this node to anything.\n *\n * @return {DestinationNode} A graph node represnting the canvas to display the content on.\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.start(0);\n * videoNode.stop(10);\n * videoNode.connect(ctx.destination);\n *\n */\n get destination(){\n return this._destinationNode;\n }\n\n /**\n * Set the playback rate of the VideoContext instance.\n * This will alter the playback speed of all media elements played through the VideoContext.\n *\n * @param {number} rate - this is the playback rate.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.start(0);\n * videoNode.stop(10);\n * videoNode.connect(ctx.destination);\n * ctx.playbackRate = 2;\n * ctx.play(); // Double playback rate means this will finish playing in 5 seconds.\n */\n set playbackRate(rate){\n if (rate <= 0){\n throw new RangeError(\"playbackRate must be greater than 0\");\n }\n for (let node of this._sourceNodes) {\n if (node.constructor.name === \"VideoNode\"){\n node._globalPlaybackRate = rate;\n node._playbackRateUpdated = true;\n }\n }\n this._playbackRate = rate;\n }\n\n\n /**\n * Return the current playbackRate of the video context.\n * @return {number} A value representing the playbackRate. 1.0 by default.\n */\n get playbackRate(){\n return this._playbackRate;\n }\n\n\n /**\n * Set the volume of all VideoNode's created in the VideoContext.\n * @param {number} volume - the volume to apply to the video nodes.\n */\n set volume(vol){\n for (let node of this._sourceNodes){\n if(node instanceof VideoNode){\n node.volume = vol;\n }\n }\n this._volume = vol;\n }\n\n /**\n * Return the current volume of the video context.\n * @return {number} A value representing the volume. 1.0 by default.\n */\n get volume(){\n return this._volume;\n }\n\n /**\n * Start the VideoContext playing\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(10);\n * ctx.play();\n */\n play(){\n console.debug(\"VideoContext - playing\");\n //Initialise the video elemnt cache\n if (this._videoElementCache)this._videoElementCache.init();\n // set the state.\n this._state = VideoContext.STATE.PLAYING;\n return true;\n }\n\n /**\n * Pause playback of the VideoContext\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(20);\n * ctx.currentTime = 10; // seek 10 seconds in\n * ctx.play();\n * setTimeout(function(){ctx.pause();}, 1000); //pause playback after roughly one second.\n */\n pause(){\n console.debug(\"VideoContext - pausing\");\n this._state = VideoContext.STATE.PAUSED;\n return true;\n }\n\n\n /**\n * Create a new node representing a video source\n *\n * @param {string|Video} - The URL or video element to create the video from.\n * @sourceOffset {number} - Offset into the start of the source video to start playing from.\n * @preloadTime {number} - How many seconds before the video is to be played to start loading it.\n * @videoElementAttributes {Object} - A dictionary of attributes to map onto the underlying video element.\n * @return {VideoNode} A new video node.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var videoElement = document.getElementById(\"video\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(videoElement);\n */\n video(src, sourceOffset=0, preloadTime=4, videoElementAttributes={}){\n let videoNode = new VideoNode(src, this._gl, this._renderGraph, this._currentTime, this._playbackRate, sourceOffset, preloadTime, this._videoElementCache, videoElementAttributes);\n this._sourceNodes.push(videoNode);\n return videoNode;\n }\n\n /**\n * @depricated\n */\n createVideoSourceNode(src, sourceOffset=0, preloadTime=4, videoElementAttributes={}){\n this._depricate(\"Warning: createVideoSourceNode will be depricated in v1.0, please switch to using VideoContext.video()\");\n return this.video(src, sourceOffset, preloadTime, videoElementAttributes);\n }\n\n\n /**\n * Create a new node representing an image source\n * @param {string|Image} src - The url or image element to create the image node from.\n * @param {number} [preloadTime] - How long before a node is to be displayed to attmept to load it.\n * @param {Object} [imageElementAttributes] - Any attributes to be given to the underlying image element.\n * @return {ImageNode} A new image node.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var imageNode = ctx.image(\"image.png\");\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var imageElement = document.getElementById(\"image\");\n * var ctx = new VideoContext(canvasElement);\n * var imageNode = ctx.image(imageElement);\n */\n image(src, preloadTime=4, imageElementAttributes={}){\n let imageNode = new ImageNode(src, this._gl, this._renderGraph, this._currentTime, preloadTime, imageElementAttributes);\n this._sourceNodes.push(imageNode);\n return imageNode;\n }\n\n /**\n * @depricated\n */\n createImageSourceNode(src, sourceOffset=0, preloadTime=4, imageElementAttributes={}){\n this._depricate(\"Warning: createImageSourceNode will be depricated in v1.0, please switch to using VideoContext.image()\");\n return this.image(src, sourceOffset, preloadTime, imageElementAttributes);\n }\n\n\n /**\n * Create a new node representing a canvas source\n * @param {Canvas} src - The canvas element to create the canvas node from.\n * @return {CanvasNode} A new canvas node.\n */\n canvas(canvas){\n let canvasNode = new CanvasNode(canvas, this._gl, this._renderGraph, this._currentTime);\n this._sourceNodes.push(canvasNode);\n return canvasNode;\n }\n\n /**\n * @depricated\n */\n createCanvasSourceNode(canvas, sourceOffset=0, preloadTime=4){\n this._depricate(\"Warning: createCanvasSourceNode will be depricated in v1.0, please switch to using VideoContext.canvas()\");\n return this.canvas(canvas, sourceOffset, preloadTime);\n }\n\n\n /**\n * Create a new effect node.\n * @param {Object} definition - this is an object defining the shaders, inputs, and properties of the compositing node to create. Builtin definitions can be found by accessing VideoContext.DEFINITIONS.\n * @return {EffectNode} A new effect node created from the passed definition\n */\n effect(definition){\n let effectNode = new EffectNode(this._gl, this._renderGraph, definition);\n this._processingNodes.push(effectNode);\n return effectNode;\n }\n\n /**\n * @depricated\n */\n createEffectNode(definition){\n this._depricate(\"Warning: createEffectNode will be depricated in v1.0, please switch to using VideoContext.effect()\");\n return this.effect(definition);\n }\n\n /**\n * Create a new compositiing node.\n *\n * Compositing nodes are used for operations such as combining multiple video sources into a single track/connection for further processing in the graph.\n *\n * A compositing node is slightly different to other processing nodes in that it only has one input in it's definition but can have unlimited connections made to it.\n * The shader in the definition is run for each input in turn, drawing them to the output buffer. This means there can be no interaction between the spearte inputs to a compositing node, as they are individually processed in seperate shader passes.\n *\n * @param {Object} definition - this is an object defining the shaders, inputs, and properties of the compositing node to create. Builtin definitions can be found by accessing VideoContext.DEFINITIONS\n *\n * @return {CompositingNode} A new compositing node created from the passed definition.\n *\n * @example\n *\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n *\n * //A simple compositing node definition which just renders all the inputs to the output buffer.\n * var combineDefinition = {\n * vertexShader : \"\\\n * attribute vec2 a_position;\\\n * attribute vec2 a_texCoord;\\\n * varying vec2 v_texCoord;\\\n * void main() {\\\n * gl_Position = vec4(vec2(2.0,2.0)*vec2(1.0, 1.0), 0.0, 1.0);\\\n * v_texCoord = a_texCoord;\\\n * }\",\n * fragmentShader : \"\\\n * precision mediump float;\\\n * uniform sampler2D u_image;\\\n * uniform float a;\\\n * varying vec2 v_texCoord;\\\n * varying float v_progress;\\\n * void main(){\\\n * vec4 color = texture2D(u_image, v_texCoord);\\\n * gl_FragColor = color;\\\n * }\",\n * properties:{\n * \"a\":{type:\"uniform\", value:0.0},\n * },\n * inputs:[\"u_image\"]\n * };\n * //Create the node, passing in the definition.\n * var trackNode = videoCtx.compositor(combineDefinition);\n *\n * //create two videos which will play at back to back\n * var videoNode1 = ctx.video(\"video1.mp4\");\n * videoNode1.play(0);\n * videoNode1.stop(10);\n * var videoNode2 = ctx.video(\"video2.mp4\");\n * videoNode2.play(10);\n * videoNode2.stop(20);\n *\n * //Connect the nodes to the combine node. This will give a single connection representing the two videos which can\n * //be connected to other effects such as LUTs, chromakeyers, etc.\n * videoNode1.connect(trackNode);\n * videoNode2.connect(trackNode);\n *\n * //Don't do anything exciting, just connect it to the output.\n * trackNode.connect(ctx.destination);\n *\n */\n compositor(definition){\n let compositingNode = new CompositingNode(this._gl, this._renderGraph, definition);\n this._processingNodes.push(compositingNode);\n return compositingNode;\n }\n\n /**\n * @depricated\n */\n createCompositingNode(definition){\n this._depricate(\"Warning: createCompositingNode will be depricated in v1.0, please switch to using VideoContext.compositor()\");\n return this.compositor(definition);\n }\n\n\n\n /**\n * Create a new transition node.\n *\n * Transistion nodes are a type of effect node which have parameters which can be changed as events on the timeline.\n *\n * For example a transition node which cross-fades between two videos could have a \"mix\" property which sets the\n * progress through the transistion. Rather than having to write your own code to adjust this property at specfic\n * points in time a transition node has a \"transition\" function which takes a startTime, stopTime, targetValue, and a\n * propertyName (which will be \"mix\"). This will linearly interpolate the property from the curernt value to\n * tragetValue between the startTime and stopTime.\n *\n * @param {Object} definition - this is an object defining the shaders, inputs, and properties of the transition node to create.\n * @return {TransitionNode} A new transition node created from the passed definition.\n * @example\n *\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n *\n * //A simple cross-fade node definition which cross-fades between two videos based on the mix property.\n * var crossfadeDefinition = {\n * vertexShader : \"\\\n * attribute vec2 a_position;\\\n * attribute vec2 a_texCoord;\\\n * varying vec2 v_texCoord;\\\n * void main() {\\\n * gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n * v_texCoord = a_texCoord;\\\n * }\",\n * fragmentShader : \"\\\n * precision mediump float;\\\n * uniform sampler2D u_image_a;\\\n * uniform sampler2D u_image_b;\\\n * uniform float mix;\\\n * varying vec2 v_texCoord;\\\n * varying float v_mix;\\\n * void main(){\\\n * vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n * vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n * color_a[0] *= mix;\\\n * color_a[1] *= mix;\\\n * color_a[2] *= mix;\\\n * color_a[3] *= mix;\\\n * color_b[0] *= (1.0 - mix);\\\n * color_b[1] *= (1.0 - mix);\\\n * color_b[2] *= (1.0 - mix);\\\n * color_b[3] *= (1.0 - mix);\\\n * gl_FragColor = color_a + color_b;\\\n * }\",\n * properties:{\n * \"mix\":{type:\"uniform\", value:0.0},\n * },\n * inputs:[\"u_image_a\",\"u_image_b\"]\n * };\n *\n * //Create the node, passing in the definition.\n * var transitionNode = videoCtx.transition(crossfadeDefinition);\n *\n * //create two videos which will overlap by two seconds\n * var videoNode1 = ctx.video(\"video1.mp4\");\n * videoNode1.play(0);\n * videoNode1.stop(10);\n * var videoNode2 = ctx.video(\"video2.mp4\");\n * videoNode2.play(8);\n * videoNode2.stop(18);\n *\n * //Connect the nodes to the transistion node.\n * videoNode1.connect(transitionNode);\n * videoNode2.connect(transitionNode);\n *\n * //Set-up a transition which happens at the crossover point of the playback of the two videos\n * transitionNode.transition(8,10,1.0,\"mix\");\n *\n * //Connect the transition node to the output\n * transitionNode.connect(ctx.destination);\n *\n * //start playback\n * ctx.play();\n */\n transition(definition){\n let transitionNode = new TransitionNode(this._gl, this._renderGraph, definition);\n this._processingNodes.push(transitionNode);\n return transitionNode;\n }\n\n /**\n * @depricated\n */\n createTransitionNode(definition){\n this._depricate(\"Warning: createTransitionNode will be depricated in v1.0, please switch to using VideoContext.transition()\");\n return this.transition(definition);\n }\n\n\n\n\n _isStalled(){\n for (let i = 0; i < this._sourceNodes.length; i++) {\n let sourceNode = this._sourceNodes[i];\n if (!sourceNode._isReady()){\n return true;\n }\n }\n return false;\n }\n\n\n /**\n * This allows manual calling of the update loop of the videoContext.\n *\n * @param {Number} dt - The difference in seconds between this and the previous calling of update.\n * @example\n *\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement, undefined, {\"manualUpdate\" : true});\n *\n * var previousTime;\n * function update(time){\n * if (previousTime === undefined) previousTime = time;\n * var dt = (time - previousTime)/1000;\n * ctx.update(dt);\n * previousTime = time;\n * requestAnimationFrame(update);\n * }\n * update();\n *\n */\n update(dt){\n this._update(dt);\n }\n\n\n _update(dt){\n //Remove any destroyed nodes\n this._sourceNodes = this._sourceNodes.filter(sourceNode=>{\n if (!sourceNode.destroyed) return sourceNode;\n });\n\n this._processingNodes = this._processingNodes.filter(processingNode=>{\n if (!processingNode.destroyed) return processingNode;\n });\n\n\n if (this._state === VideoContext.STATE.PLAYING || this._state === VideoContext.STATE.STALLED || this._state === VideoContext.STATE.PAUSED) {\n this._callCallbacks(\"update\");\n\n if (this._state !== VideoContext.STATE.PAUSED){\n if (this._isStalled()){\n this._callCallbacks(\"stalled\");\n this._state = VideoContext.STATE.STALLED;\n }else{\n this._state = VideoContext.STATE.PLAYING;\n }\n }\n\n if(this._state === VideoContext.STATE.PLAYING){\n //Handle timeline callbacks.\n let activeCallbacks = new Map();\n for(let callback of this._timelineCallbacks){\n if (callback.time >= this.currentTime && callback.time < (this._currentTime + dt * this._playbackRate)){\n //group the callbacks by time\n if(!activeCallbacks.has(callback.time)) activeCallbacks.set(callback.time, []);\n activeCallbacks.get(callback.time).push(callback);\n }\n }\n\n\n //Sort the groups of callbacks by the times of the groups\n let timeIntervals = Array.from(activeCallbacks.keys());\n timeIntervals.sort(function(a, b){\n return a - b;\n });\n\n for (let t of timeIntervals){\n let callbacks = activeCallbacks.get(t);\n callbacks.sort(function(a,b){\n return a.ordering - b.ordering;\n });\n for(let callback of callbacks){\n callback.func();\n }\n }\n\n this._currentTime += dt * this._playbackRate;\n if(this._currentTime > this.duration && this._endOnLastSourceEnd){\n //Do an update od the sourcenodes in case anything in the \"ended\" callbacks modifes currentTime and sources haven't had a chance to stop.\n for (let i = 0; i < this._sourceNodes.length; i++) {\n this._sourceNodes[i]._update(this._currentTime);\n }\n this._state = VideoContext.STATE.ENDED;\n this._callCallbacks(\"ended\");\n }\n }\n\n let sourcesPlaying = false;\n\n for (let i = 0; i < this._sourceNodes.length; i++) {\n let sourceNode = this._sourceNodes[i];\n\n if(this._state === VideoContext.STATE.STALLED){\n if (sourceNode._isReady() && sourceNode._state === SOURCENODESTATE.playing) sourceNode._pause();\n }\n if(this._state === VideoContext.STATE.PAUSED){\n sourceNode._pause();\n }\n if(this._state === VideoContext.STATE.PLAYING){\n sourceNode._play();\n }\n sourceNode._update(this._currentTime);\n if (sourceNode._state === SOURCENODESTATE.paused || sourceNode._state === SOURCENODESTATE.playing){\n sourcesPlaying = true;\n }\n }\n\n\n if (sourcesPlaying !== this._sourcesPlaying && this._state === VideoContext.STATE.PLAYING){\n if (sourcesPlaying === true){\n this._callCallbacks(\"content\");\n }else{\n this._callCallbacks(\"nocontent\");\n }\n this._sourcesPlaying = sourcesPlaying;\n }\n\n\n /*\n * Itterate the directed acyclic graph using Khan's algorithm (KHAAAAAN!).\n *\n * This has highlighted a bunch of ineffencies in the rendergraph class about how its stores connections.\n * Mainly the fact that to get inputs for a node you have to iterate the full list of connections rather than\n * a node owning it's connections.\n * The trade off with changing this is making/removing connections becomes more costly performance wise, but\n * this is deffinately worth while because getting the connnections is a much more common operation.\n *\n * TL;DR Future matt - refactor this.\n *\n */\n let sortedNodes = [];\n let connections = this._renderGraph.connections.slice();\n let nodes = RenderGraph.getInputlessNodes(connections);\n\n\n while (nodes.length > 0) {\n let node = nodes.pop();\n sortedNodes.push(node);\n for (let edge of RenderGraph.outputEdgesFor(node, connections)){\n let index = connections.indexOf(edge);\n if (index > -1) connections.splice(index, 1);\n if (RenderGraph.inputEdgesFor(edge.destination, connections).length === 0){\n nodes.push(edge.destination);\n }\n }\n }\n\n for (let node of sortedNodes){\n if (this._sourceNodes.indexOf(node) === -1){\n node._update(this._currentTime);\n node._render();\n }\n }\n }\n }\n\n /**\n * Destroy all nodes in the graph and reset the timeline. After calling this any created nodes will be unusable.\n */\n reset(){\n for (let callback of this._callbacks){\n this.unregisterCallback(callback);\n }\n for (let node of this._sourceNodes){\n node.destroy();\n }\n for (let node of this._processingNodes){\n node.destroy();\n }\n this._update(0);\n this._sourceNodes = [];\n this._processingNodes = [];\n this._timeline = [];\n this._currentTime = 0;\n this._state = VideoContext.STATE.PAUSED;\n this._playbackRate = 1.0;\n this._sourcesPlaying = undefined;\n this._callbacks.set(\"stalled\", []);\n this._callbacks.set(\"update\", []);\n this._callbacks.set(\"ended\", []);\n this._callbacks.set(\"content\", []);\n this._callbacks.set(\"nocontent\", []);\n this._timelineCallbacks = [];\n }\n\n _depricate(msg){\n console.log(msg);\n }\n\n static get DEFINITIONS() {\n return DEFINITIONS;\n }\n\n /**\n * Get a JS Object containing the state of the VideoContext instance and all the created nodes.\n */\n snapshot () {\n return snapshot(this);\n }\n}\n\n//playing - all sources are active\n//paused - all sources are paused\n//stalled - one or more sources is unable to play\n//ended - all sources have finished playing\n//broken - the render graph is in a broken state\nVideoContext.STATE = {};\nVideoContext.STATE.PLAYING = 0;\nVideoContext.STATE.PAUSED = 1;\nVideoContext.STATE.STALLED = 2;\nVideoContext.STATE.ENDED = 3;\nVideoContext.STATE.BROKEN = 4;\n\nVideoContext.visualiseVideoContextTimeline = visualiseVideoContextTimeline;\nVideoContext.visualiseVideoContextGraph = visualiseVideoContextGraph;\nVideoContext.createControlFormForNode = createControlFormForNode;\nVideoContext.createSigmaGraphDataFromRenderGraph = createSigmaGraphDataFromRenderGraph;\nVideoContext.exportToJSON = exportToJSON;\nVideoContext.updateablesManager = updateablesManager;\nVideoContext.importSimpleEDL = importSimpleEDL;\n\n\n\n// WEBPACK FOOTER //\n// ./src/videocontext.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport SourceNode, { SOURCENODESTATE } from \"./sourcenode\";\n\nclass VideoNode extends SourceNode {\n /**\n * Initialise an instance of a VideoNode.\n * This should not be called directly, but created through a call to videoContext.createVideoNode();\n */\n constructor(src, gl, renderGraph, currentTime, globalPlaybackRate=1.0, sourceOffset=0, preloadTime = 4, videoElementCache=undefined, attributes = {}){\n super(src, gl, renderGraph, currentTime);\n this._preloadTime = preloadTime;\n this._sourceOffset = sourceOffset;\n this._globalPlaybackRate = globalPlaybackRate;\n this._videoElementCache = videoElementCache;\n this._playbackRate = 1.0;\n this._volume = 1.0;\n this._playbackRateUpdated = true;\n this._attributes = attributes;\n this._loopElement = false;\n this._isElementPlaying = false;\n if (this._attributes.loop){\n this._loopElement = this._attributes.loop;\n }\n this._displayName = \"VideoNode\";\n }\n\n set playbackRate(playbackRate){\n this._playbackRate = playbackRate;\n this._playbackRateUpdated = true;\n }\n\n set stretchPaused(stretchPaused){\n super.stretchPaused = stretchPaused;\n if(this._element){\n if (this._stretchPaused){\n this._element.pause();\n } else{\n if(this._state === SOURCENODESTATE.playing){\n this._element.play();\n }\n }\n }\n }\n\n get stretchPaused(){\n return this._stretchPaused;\n }\n\n get playbackRate(){\n return this._playbackRate;\n }\n\n get elementURL(){\n return this._elementURL;\n }\n\n set volume(volume){\n this._volume = volume;\n if(this._element !== undefined) this._element.volume = this._volume;\n }\n\n _load(){\n super._load();\n if (this._element !== undefined){\n\n for (var key in this._attributes) {\n this._element[key] = this._attributes[key];\n }\n\n if (this._element.readyState > 3 && !this._element.seeking){\n if(this._loopElement === false){\n if (this._stopTime === Infinity || this._stopTime == undefined){\n this._stopTime = this._startTime + this._element.duration;\n this._triggerCallbacks(\"durationchange\", this.duration);\n }\n }\n if(this._ready !== true){\n this._triggerCallbacks(\"loaded\");\n this._playbackRateUpdated = true;\n\n }\n\n this._ready = true;\n\n } else{\n if(this._state !== SOURCENODESTATE.error){\n this._ready = false;\n }\n }\n return;\n }\n if (this._isResponsibleForElementLifeCycle){\n if (this._videoElementCache){\n this._element = this._videoElementCache.get();\n }else{\n this._element = document.createElement(\"video\");\n this._element.setAttribute(\"crossorigin\", \"anonymous\");\n this._element.setAttribute(\"webkit-playsinline\", \"\");\n this._element.setAttribute(\"playsinline\", \"\");\n this._playbackRateUpdated = true;\n }\n this._element.volume = this._volume;\n if (window.MediaStream !== undefined && this._elementURL instanceof MediaStream){\n this._element.srcObject = this._elementURL;\n } else {\n this._element.src = this._elementURL;\n }\n\n for (let key in this._attributes) {\n this._element[key] = this._attributes[key];\n }\n }\n if (this._element){\n let currentTimeOffset = 0;\n if (this._currentTime > this._startTime) currentTimeOffset = this._currentTime - this._startTime;\n this._element.currentTime = this._sourceOffset + currentTimeOffset;\n this._element.onerror = () => {\n if (this._element === undefined) return;\n console.debug(\"Error with element\", this._element);\n this._state = SOURCENODESTATE.error;\n //Event though there's an error ready should be set to true so the node can output transparenn\n this._ready = true;\n this._triggerCallbacks(\"error\");\n };\n }else{\n //If the element doesn't exist for whatever reason enter the error state.\n this._state = SOURCENODESTATE.error;\n this._ready = true;\n this._triggerCallbacks(\"error\");\n }\n }\n\n _unload(){\n super._unload();\n if (this._isResponsibleForElementLifeCycle && this._element !== undefined){\n this._element.src = \"\";\n this._element.srcObject = undefined;\n for (let key in this._attributes){\n this._element.removeAttribute(key);\n }\n this._element = undefined;\n if(!this._videoElementCache) delete this._element;\n }\n this._ready = false;\n this._isElementPlaying = false;\n }\n\n _seek(time){\n super._seek(time);\n if (this.state === SOURCENODESTATE.playing || this.state === SOURCENODESTATE.paused){\n if (this._element === undefined) this._load();\n let relativeTime = this._currentTime - this._startTime + this._sourceOffset;\n this._element.currentTime = relativeTime;\n this._ready = false;\n }\n if((this._state === SOURCENODESTATE.sequenced || this._state === SOURCENODESTATE.ended) && this._element !== undefined){\n this._unload();\n }\n }\n\n _update(currentTime){\n //if (!super._update(currentTime)) return false;\n super._update(currentTime);\n //check if the video has ended\n if(this._element !== undefined){\n if (this._element.ended){\n this._state = SOURCENODESTATE.ended;\n this._triggerCallbacks(\"ended\");\n }\n }\n\n if (this._startTime - this._currentTime <= this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();\n\n if (this._state === SOURCENODESTATE.playing){\n if (this._playbackRateUpdated)\n {\n this._element.playbackRate = this._globalPlaybackRate * this._playbackRate;\n this._playbackRateUpdated = false;\n }\n if (!this._isElementPlaying){\n this._element.play();\n if (this._stretchPaused){\n this._element.pause();\n }\n this._isElementPlaying = true;\n }\n return true;\n } else if (this._state === SOURCENODESTATE.paused){\n this._element.pause();\n this._isElementPlaying = false;\n return true;\n }\n else if (this._state === SOURCENODESTATE.ended && this._element !== undefined){\n this._element.pause();\n if (this._isElementPlaying){\n this._unload();\n }\n return false;\n }\n }\n\n clearTimelineState(){\n super.clearTimelineState();\n if (this._element !== undefined) {\n this._element.pause();\n this._isElementPlaying = false;\n }\n this._unload();\n }\n\n destroy(){\n if (this._element) this._element.pause();\n super.destroy();\n }\n\n}\n\nexport default VideoNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/SourceNodes/videonode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport { updateTexture, clearTexture, createElementTexutre } from \"../utils.js\";\nimport GraphNode from \"../graphnode\";\n\nlet STATE = {\"waiting\":0, \"sequenced\":1, \"playing\":2, \"paused\":3, \"ended\":4, \"error\":5};\n\nclass SourceNode extends GraphNode{\n /**\n * Initialise an instance of a SourceNode.\n * This is the base class for other Nodes which generate media to be passed into the processing pipeline.\n */\n constructor(src, gl, renderGraph, currentTime){\n super(gl,renderGraph, [], true);\n this._element = undefined;\n this._elementURL = undefined;\n this._isResponsibleForElementLifeCycle = true;\n\n if (typeof src === \"string\" || (window.MediaStream !== undefined && src instanceof MediaStream)){\n //create the node from the passed URL or MediaStream\n this._elementURL = src;\n }else{\n //use the passed element to create the SourceNode\n this._element = src;\n this._isResponsibleForElementLifeCycle = false;\n }\n\n this._state = STATE.waiting;\n this._currentTime = currentTime;\n this._startTime = NaN;\n this._stopTime = Infinity;\n this._ready = false;\n this._loadCalled = false;\n this._stretchPaused = false;\n this._texture = createElementTexutre(gl);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));\n this._callbacks = [];\n this._renderPaused = false;\n this._displayName = \"SourceNode\";\n\n }\n\n /**\n * Returns the state of the node.\n * 0 - Waiting, start() has not been called on it yet.\n * 1 - Sequenced, start() has been called but it is not playing yet.\n * 2 - Playing, the node is playing.\n * 3 - Paused, the node is paused.\n * 4 - Ended, playback of the node has finished.\n *\n * @example\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n * console.log(videoNode.state); //will output 0 (for waiting)\n * videoNode.start(5);\n * console.log(videoNode.state); //will output 1 (for sequenced)\n * videoNode.stop(10);\n * ctx.play();\n * console.log(videoNode.state); //will output 2 (for playing)\n * ctx.paused();\n * console.log(videoNode.state); //will output 3 (for paused)\n */\n get state(){\n return this._state;\n }\n\n\n /**\n * Returns the underlying DOM element which represents this source node.\n * Note: If a source node is created with a url rather than passing in an existing element then this will return undefined until the source node preloads the element.\n *\n * @return {Element} The underlying DOM element representing the media for the node. If the lifecycle of the video is owned UNSIGNED_BYTE the node itself, this can return undefined if the element hasn't been loaded yet.\n *\n * @example\n * //Accessing the Element on a VideoNode created via a URL\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n * videoNode.start(0);\n * videoNode.stop(5);\n * //When the node starts playing the element should exist so set it's volume to 0\n * videoNode.regsiterCallback(\"play\", function(){videoNode.element.volume = 0;});\n *\n *\n * @example\n * //Accessing the Element on a VideoNode created via an already existing element\n * var ctx = new VideoContext();\n * var videoElement = document.createElement(\"video\");\n * var videoNode = ctx.createVideoSourceNode(videoElement);\n * videoNode.start(0);\n * videoNode.stop(5);\n * //The elemnt can be accessed any time because it's lifecycle is managed outside of the VideoContext\n * videoNode.element.volume = 0;\n *\n */\n get element(){\n return this._element;\n }\n\n\n /**\n * Returns the duration of the node on a timeline. If no start time is set will return undefiend, if no stop time is set will return Infinity.\n *\n * @return {number} The duration of the node in seconds.\n *\n * @example\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n * videoNode.start(5);\n * videoNode.stop(10);\n * console.log(videoNode.duration); //will output 10\n */\n get duration(){\n if (isNaN(this._startTime)) return undefined;\n if (this._stopTime === Infinity) return Infinity;\n return this._stopTime - this._startTime;\n }\n\n set stretchPaused(stretchPaused){\n this._stretchPaused = stretchPaused;\n }\n\n get stretchPaused(){\n return this._stretchPaused;\n }\n\n _load(){\n if (!this._loadCalled){\n this._triggerCallbacks(\"load\");\n this._loadCalled = true;\n }\n }\n\n _unload (){\n this._triggerCallbacks(\"destroy\");\n this._loadCalled = false;\n }\n\n /**\n * Register callbacks against one of these events: \"load\", \"destroy\", \"seek\", \"pause\", \"play\", \"ended\", \"durationchange\", \"loaded\", \"error\"\n *\n * @param {String} type - the type of event to register the callback against.\n * @param {function} func - the function to call.\n *\n * @example\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n *\n * videoNode.registerCallback(\"load\", function(){\"video is loading\"});\n * videoNode.registerCallback(\"play\", function(){\"video is playing\"});\n * videoNode.registerCallback(\"ended\", function(){\"video has eneded\"});\n *\n */\n registerCallback(type, func){\n this._callbacks.push({type:type, func:func});\n }\n\n /**\n * Remove callback.\n *\n * @param {function} [func] - the callback to remove, if undefined will remove all callbacks for this node.\n *\n * @example\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n *\n * videoNode.registerCallback(\"load\", function(){\"video is loading\"});\n * videoNode.registerCallback(\"play\", function(){\"video is playing\"});\n * videoNode.registerCallback(\"ended\", function(){\"video has eneded\"});\n * videoNode.unregisterCallback(); //remove all of the three callbacks.\n *\n */\n unregisterCallback(func){\n let toRemove = [];\n for(let callback of this._callbacks){\n if (func === undefined){\n toRemove.push(callback);\n } else if (callback.func === func){\n toRemove.push(callback);\n }\n }\n for(let callback of toRemove){\n let index = this._callbacks.indexOf(callback);\n this._callbacks.splice(index, 1);\n }\n }\n\n _triggerCallbacks(type, data){\n for(let callback of this._callbacks){\n if (callback.type === type){\n if (data!== undefined){\n callback.func(this, data);\n }else{\n callback.func(this);\n }\n }\n }\n }\n\n /**\n * Start playback at VideoContext.currentTime plus passed time. If passed time is negative, will play as soon as possible.\n *\n * @param {number} time - the time from the currentTime of the VideoContext which to start playing, if negative will play as soon as possible.\n * @return {boolean} Will return true is seqeuncing has succeded, or false if it is already sequenced.\n */\n start(time){\n if (this._state !== STATE.waiting){\n console.debug(\"SourceNode is has already been sequenced. Can't sequence twice.\");\n return false;\n }\n\n this._startTime = this._currentTime + time;\n this._state = STATE.sequenced;\n return true;\n }\n\n /**\n * Start playback at an absolute time ont the VideoContext's timeline.\n *\n * @param {number} time - the time on the VideoContexts timeline to start playing.\n * @return {boolean} Will return true is seqeuncing has succeded, or false if it is already sequenced.\n */\n startAt(time){\n if (this._state !== STATE.waiting){\n console.debug(\"SourceNode is has already been sequenced. Can't sequence twice.\");\n return false;\n }\n this._startTime = time;\n this._state = STATE.sequenced;\n return true;\n }\n\n\n get startTime(){\n return this._startTime;\n }\n\n\n /**\n * Stop playback at VideoContext.currentTime plus passed time. If passed time is negative, will play as soon as possible.\n *\n * @param {number} time - the time from the currentTime of the video context which to stop playback.\n * @return {boolean} Will return true is seqeuncing has succeded, or false if the playback has already ended or if start hasn't been called yet, or if time is less than the start time.\n */\n stop(time){\n if (this._state === STATE.ended){\n console.debug(\"SourceNode has already ended. Cannot call stop.\");\n return false;\n } else if (this._state === STATE.waiting){\n console.debug(\"SourceNode must have start called before stop is called\");\n return false;\n }\n if (this._currentTime + time <= this._startTime){\n console.debug(\"SourceNode must have a stop time after it's start time, not before.\");\n return false;\n }\n this._stopTime = this._currentTime + time;\n this._stretchPaused = false;\n this._triggerCallbacks(\"durationchange\", this.duration);\n return true;\n }\n\n /**\n * Stop playback at an absolute time ont the VideoContext's timeline.\n *\n * @param {number} time - the time on the VideoContexts timeline to stop playing.\n * @return {boolean} Will return true is seqeuncing has succeded, or false if the playback has already ended or if start hasn't been called yet, or if time is less than the start time.\n */\n stopAt(time){\n if (this._state === STATE.ended){\n console.debug(\"SourceNode has already ended. Cannot call stop.\");\n return false;\n } else if (this._state === STATE.waiting){\n console.debug(\"SourceNode must have start called before stop is called\");\n return false;\n }\n if (time <= this._startTime){\n console.debug(\"SourceNode must have a stop time after it's start time, not before.\");\n return false;\n }\n this._stopTime = time;\n this._stretchPaused = false;\n this._triggerCallbacks(\"durationchange\", this.duration);\n return true;\n }\n\n\n get stopTime(){\n return this._stopTime;\n }\n\n\n _seek(time){\n this._renderPaused = false;\n\n this._triggerCallbacks(\"seek\", time);\n\n if (this._state === STATE.waiting) return;\n if (time < this._startTime){\n clearTexture(this._gl, this._texture);\n this._state = STATE.sequenced;\n }\n if (time >= this._startTime && this._state !== STATE.paused){\n this._state = STATE.playing;\n }\n if (time >= this._stopTime){\n clearTexture(this._gl, this._texture);\n this._triggerCallbacks(\"ended\");\n this._state = STATE.ended;\n }\n //update the current time\n this._currentTime = time;\n }\n\n _pause(){\n if(this._state === STATE.playing || (this._currentTime === 0 && this._startTime === 0)){\n this._triggerCallbacks(\"pause\");\n this._state = STATE.paused;\n this._renderPaused = false;\n }\n }\n _play(){\n\n if(this._state === STATE.paused){\n this._triggerCallbacks(\"play\");\n this._state = STATE.playing;\n }\n }\n\n _isReady(){\n if (this._state === STATE.playing || this._state === STATE.paused || this._state === STATE.error){\n return this._ready;\n }\n return true;\n }\n\n _update(currentTime, triggerTextureUpdate=true){\n this._rendered = true;\n let timeDelta = currentTime - this._currentTime;\n\n //update the current time\n this._currentTime = currentTime;\n\n //update the state\n if (this._state === STATE.waiting || this._state === STATE.ended || this._state === STATE.error) return false;\n\n this._triggerCallbacks(\"render\", currentTime);\n\n\n if (currentTime < this._startTime){\n clearTexture(this._gl, this._texture);\n this._state = STATE.sequenced;\n }\n\n\n if (currentTime >= this._startTime && this._state !== STATE.paused && this._state !== STATE.error){\n if (this._state !== STATE.playing) this._triggerCallbacks(\"play\");\n this._state = STATE.playing;\n }\n\n if (currentTime >= this._stopTime){\n clearTexture(this._gl, this._texture);\n this._triggerCallbacks(\"ended\");\n this._state = STATE.ended;\n }\n\n //update this source nodes texture\n if (this._element === undefined || this._ready === false) return true;\n\n if (!this._renderPaused && this._state === STATE.paused) {\n if(triggerTextureUpdate)updateTexture(this._gl, this._texture, this._element);\n this._renderPaused = true;\n }\n if(this._state === STATE.playing){\n if(triggerTextureUpdate)updateTexture(this._gl, this._texture, this._element);\n if(this._stretchPaused){\n this._stopTime += timeDelta;\n }\n }\n\n return true;\n }\n\n /**\n * Clear any timeline state the node currently has, this puts the node in the \"waiting\" state, as if neither start nor stop had been called.\n */\n clearTimelineState(){\n this._startTime = NaN;\n this._stopTime = Infinity;\n this._state = STATE.waiting;\n }\n\n /**\n * Destroy and clean-up the node.\n */\n destroy(){\n this._unload();\n super.destroy();\n this.unregisterCallback();\n delete this._element;\n this._elementURL = undefined;\n this._state = STATE.waiting;\n this._currentTime = 0;\n this._startTime = NaN;\n this._stopTime = Infinity;\n this._ready = false;\n this._loadCalled = false;\n this._gl.deleteTexture(this._texture);\n this._texture = undefined;\n }\n}\n\nexport {STATE as SOURCENODESTATE};\n\nexport default SourceNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/SourceNodes/sourcenode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport DEFINITIONS from \"./Definitions/definitions.js\";\nimport { SOURCENODESTATE } from \"./SourceNodes/sourcenode.js\";\n\n/*\n* Utility function to compile a WebGL Vertex or Fragment shader.\n*\n* @param {WebGLRenderingContext} gl - the webgl context fo which to build the shader.\n* @param {String} shaderSource - A string of shader code to compile.\n* @param {number} shaderType - Shader type, either WebGLRenderingContext.VERTEX_SHADER or WebGLRenderingContext.FRAGMENT_SHADER.\n*\n* @return {WebGLShader} A compiled shader.\n*\n*/\nexport function compileShader(gl, shaderSource, shaderType) {\n let shader = gl.createShader(shaderType);\n gl.shaderSource(shader, shaderSource);\n gl.compileShader(shader);\n let success = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if (!success) {\n throw \"could not compile shader:\" + gl.getShaderInfoLog(shader);\n }\n return shader;\n}\n\n/*\n* Create a shader program from a passed vertex and fragment shader source string.\n*\n* @param {WebGLRenderingContext} gl - the webgl context fo which to build the shader.\n* @param {WebGLShader} vertexShader - A compiled vertex shader.\n* @param {WebGLShader} fragmentShader - A compiled fragment shader.\n*\n* @return {WebGLProgram} A compiled & linkde shader program.\n*/\nexport function createShaderProgram(gl, vertexShader, fragmentShader){\n let program = gl.createProgram();\n\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n gl.linkProgram(program);\n\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)){\n throw {\"error\":4,\"msg\":\"Can't link shader program for track\", toString:function(){return this.msg;}};\n }\n return program;\n}\n\nexport function createElementTexutre(gl){\n let texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n // Set the parameters so we can render any size image.\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n //Initialise the texture untit to clear.\n //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, type);\n\n return texture;\n}\n\nexport function updateTexture(gl, texture, element){\n if(element.readyState !== undefined && element.readyState === 0) return;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, element);\n}\n\nexport function clearTexture(gl, texture){\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));\n}\n\n\nexport function generateRandomId(){\n const appearanceAdjective = [\"adorable\", \"alert\", \"average\", \"beautiful\", \"blonde\", \"bloody\", \"blushing\", \"bright\", \"clean\", \"clear\", \"cloudy\", \"colourful\", \"concerned\",\"crowded\", \"curious\", \"cute\", \"dark\", \"dirty\", \"drab\", \"distinct\", \"dull\", \"elegant\", \"fancy\", \"filthy\", \"glamorous\", \"gleaming\", \"graceful\", \"grotesque\", \"homely\", \"light\", \"misty\", \"motionless\", \"muddy\", \"plain\", \"poised\", \"quaint\", \"scary\", \"shiny\", \"smoggy\", \"sparkling\", \"spotless\", \"stormy\", \"strange\", \"ugly\", \"unsightly\", \"unusual\"];\n const conditionAdjective = [\"alive\", \"brainy\", \"broken\", \"busy\", \"careful\",\"cautious\", \"clever\", \"crazy\", \"damaged\", \"dead\", \"difficult\",\"easy\",\"fake\", \"false\",\"famous\", \"forward\", \"fragile\",\"guilty\", \"helpful\",\"helpless\",\"important\", \"impossible\",\"infamous\",\"innocent\", \"inquisitive\", \"mad\", \"modern\", \"open\", \"outgoing\", \"outstanding\",\"poor\", \"powerful\",\"puzzled\", \"real\", \"rich\", \"right\", \"robust\",\"sane\", \"scary\", \"shy\", \"sleepy\",\"stupid\", \"super\", \"tame\", \"thick\",\"tired\",\"wild\", \"wrong\"];\n const nounAnimal = [\"manatee\", \"gila monster\", \"nematode\", \"seahorse\", \"slug\", \"koala bear\", \"giant tortoise\",\"garden snail\", \"starfish\", \"sloth\", \"american woodcock\", \"coral\", \"swallowtail butterfly\", \"house sparrow\", \"sea anemone\"];\n\n function randomChoice(array){\n return array[Math.floor(Math.random() * array.length)];\n }\n\n function capitalize(word){\n word = word.replace(/\\b\\w/g, l => l.toUpperCase());\n return word;\n }\n\n let name = randomChoice(appearanceAdjective) + \" \" + randomChoice(conditionAdjective) + \" \" + randomChoice(nounAnimal);\n name = capitalize(name);\n name = name.replace(/ /g, \"-\");\n return name;\n}\n\n\nexport function exportToJSON(vc) {\n console.warn(\"VideoContext.exportToJSON has been deprecated. Please use VideoContext.snapshot instead.\");\n return JSON.stringify(snapshotNodes(vc));\n}\n\nexport function snapshot(vc) {\n return {\n nodes: snapshotNodes(vc),\n videoContext: snapshotVideoContext(vc)\n };\n}\n\nfunction snapshotVideoContext(vc) {\n return {\n currentTime: vc.currentTime,\n duration: vc.duration,\n state: vc.state,\n playbackRate: vc.playbackRate,\n };\n}\n\nlet warningExportSourceLogged = false;\nfunction snapshotNodes(vc){\n\n function qualifyURL(url) {\n var a = document.createElement(\"a\");\n a.href = url;\n return a.href;\n }\n\n function getInputIDs(node, vc){\n let inputs = [];\n for (let input of node.inputs){\n if (input === undefined)continue;\n let inputID;\n let inputIndex = node.inputs.indexOf(input);\n let index = vc._processingNodes.indexOf(input);\n if (index > -1){\n inputID = \"processor\" + index;\n } else{\n let index = vc._sourceNodes.indexOf(input);\n if(index > -1){\n inputID = \"source\" + index;\n } else {\n console.log(\"Warning, can't find input\",input);\n }\n }\n inputs.push({id:inputID, index:inputIndex});\n }\n return inputs;\n }\n\n let result = {};\n\n\n let sourceNodeStateMapping = [];\n for (let state in SOURCENODESTATE){\n sourceNodeStateMapping[SOURCENODESTATE[state]] = state;\n }\n\n for(let index in vc._sourceNodes){\n let source = vc._sourceNodes[index];\n let id = \"source\" + index;\n let node_url = \"\";\n\n if(!source._isResponsibleForElementLifeCycle){\n if (!warningExportSourceLogged){\n console.debug(\"Warning - Trying to export source created from an element not a URL. URL of export will be set to the elements src attribute and may be incorrect\", source);\n warningExportSourceLogged = true;\n }\n node_url = source.element.src;\n } else {\n node_url = qualifyURL(source._elementURL);\n }\n\n let node = {\n type: source.displayName,\n url: node_url,\n start: source.startTime,\n stop: source.stopTime,\n state: sourceNodeStateMapping[source.state],\n };\n if (node.type === \"VideoNode\") {\n node.currentTime = null;\n if(source.element && source.element.currentTime) {\n node.currentTime = source.element.currentTime;\n }\n }\n\n if (source._sourceOffset){\n node.sourceOffset = source._sourceOffset;\n }\n result[id] = node;\n }\n\n for (let index in vc._processingNodes){\n let processor = vc._processingNodes[index];\n let id = \"processor\" + index;\n let node = {\n type: processor.displayName,\n definition: processor._definition,\n inputs: getInputIDs(processor, vc),\n properties:{}\n };\n\n for(let property in node.definition.properties){\n node.properties[property] = processor[property];\n }\n\n if (node.type === \"TransitionNode\"){\n node.transitions = processor._transitions;\n }\n\n result[id] = node;\n }\n\n result[\"destination\"] = {\n type:\"Destination\",\n inputs: getInputIDs(vc.destination, vc)\n };\n\n return result;\n}\n\nexport function createControlFormForNode(node, nodeName){\n let rootDiv = document.createElement(\"div\");\n\n if (nodeName !== undefined){\n var title = document.createElement(\"h2\");\n title.innerHTML = nodeName;\n rootDiv.appendChild(title);\n }\n\n for(let propertyName in node._properties){\n let propertyParagraph = document.createElement(\"p\");\n let propertyTitleHeader = document.createElement(\"h3\");\n propertyTitleHeader.innerHTML = propertyName;\n propertyParagraph.appendChild(propertyTitleHeader);\n\n let propertyValue = node._properties[propertyName].value;\n if (typeof propertyValue === \"number\"){\n let range = document.createElement(\"input\");\n range.setAttribute(\"type\", \"range\");\n range.setAttribute(\"min\", \"0\");\n range.setAttribute(\"max\", \"1\");\n range.setAttribute(\"step\", \"0.01\");\n range.setAttribute(\"value\", propertyValue,toString());\n\n let number = document.createElement(\"input\");\n number.setAttribute(\"type\", \"number\");\n number.setAttribute(\"min\", \"0\");\n number.setAttribute(\"max\", \"1\");\n number.setAttribute(\"step\", \"0.01\");\n number.setAttribute(\"value\", propertyValue,toString());\n\n let mouseDown = false;\n range.onmousedown =function(){mouseDown=true;};\n range.onmouseup =function(){mouseDown=false;};\n range.onmousemove = function(){\n if(mouseDown){\n node[propertyName] = parseFloat(range.value);\n number.value = range.value;\n }\n };\n range.onchange = function(){\n node[propertyName] = parseFloat(range.value);\n number.value = range.value;\n };\n number.onchange =function(){\n node[propertyName] = parseFloat(number.value);\n range.value = number.value;\n };\n propertyParagraph.appendChild(range);\n propertyParagraph.appendChild(number);\n }\n else if(Object.prototype.toString.call(propertyValue) === \"[object Array]\"){\n for (var i = 0; i < propertyValue.length; i++) {\n let range = document.createElement(\"input\");\n range.setAttribute(\"type\", \"range\");\n range.setAttribute(\"min\", \"0\");\n range.setAttribute(\"max\", \"1\");\n range.setAttribute(\"step\", \"0.01\");\n range.setAttribute(\"value\", propertyValue[i],toString());\n\n let number = document.createElement(\"input\");\n number.setAttribute(\"type\", \"number\");\n number.setAttribute(\"min\", \"0\");\n number.setAttribute(\"max\", \"1\");\n number.setAttribute(\"step\", \"0.01\");\n number.setAttribute(\"value\", propertyValue,toString());\n\n let index = i;\n let mouseDown = false;\n range.onmousedown =function(){mouseDown=true;};\n range.onmouseup =function(){mouseDown=false;};\n range.onmousemove = function(){\n if(mouseDown){\n node[propertyName][index] = parseFloat(range.value);\n number.value = range.value;\n }\n };\n range.onchange = function(){\n node[propertyName][index] = parseFloat(range.value);\n number.value = range.value;\n };\n\n number.onchange = function(){\n node[propertyName][index] = parseFloat(number.value);\n range.value = number.value;\n };\n propertyParagraph.appendChild(range);\n propertyParagraph.appendChild(number);\n }\n }\n\n rootDiv.appendChild(propertyParagraph);\n }\n return rootDiv;\n}\n\n\nfunction calculateNodeDepthFromDestination(videoContext){\n let destination = videoContext.destination;\n let depthMap= new Map();\n depthMap.set(destination, 0);\n\n function itterateBackwards(node, depth=0){\n for (let n of node.inputs){\n let d = depth + 1;\n if (depthMap.has(n)){\n if (d > depthMap.get(n)){\n depthMap.set(n, d);\n }\n } else{\n depthMap.set(n,d);\n }\n itterateBackwards(n, depthMap.get(n));\n }\n }\n\n itterateBackwards(destination);\n return depthMap;\n}\n\n\n\n\nexport function visualiseVideoContextGraph(videoContext, canvas){\n let ctx = canvas.getContext(\"2d\");\n let w = canvas.width;\n let h = canvas.height;\n ctx.clearRect(0,0,w,h);\n\n let nodeDepths = calculateNodeDepthFromDestination(videoContext);\n let depths = nodeDepths.values();\n depths = Array.from(depths).sort(function(a, b){return b-a;});\n let maxDepth = depths[0];\n\n let xStep = w / (maxDepth+1);\n\n let nodeHeight = (h / videoContext._sourceNodes.length)/3;\n let nodeWidth = nodeHeight * 1.618;\n\n\n function calculateNodePos(node, nodeDepths, xStep, nodeHeight){\n let depth = nodeDepths.get(node);\n nodeDepths.values();\n\n let count = 0;\n for(let nodeDepth of nodeDepths){\n if (nodeDepth[0] === node) break;\n if (nodeDepth[1] === depth) count += 1;\n }\n return {x:(xStep*nodeDepths.get(node)), y:nodeHeight*1.5*count + 50};\n }\n\n\n // \"video\":[\"#572A72\", \"#3C1255\"],\n // \"image\":[\"#7D9F35\", \"#577714\"],\n // \"canvas\":[\"#AA9639\", \"#806D15\"]\n\n for (let i = 0; i < videoContext._renderGraph.connections.length; i++) {\n let conn = videoContext._renderGraph.connections[i];\n let source = calculateNodePos(conn.source, nodeDepths, xStep, nodeHeight);\n let destination = calculateNodePos(conn.destination, nodeDepths, xStep, nodeHeight);\n if (source !== undefined && destination !== undefined){\n ctx.beginPath();\n //ctx.moveTo(source.x + nodeWidth/2, source.y + nodeHeight/2);\n let x1 = source.x + nodeWidth/2;\n let y1 = source.y + nodeHeight/2;\n let x2 = destination.x + nodeWidth/2;\n let y2 = destination.y + nodeHeight/2;\n let dx = x2 - x1;\n let dy = y2 - y1;\n\n let angle = Math.PI/2 - Math.atan2(dx,dy);\n\n let distance = Math.sqrt(Math.pow(x1-x2,2) + Math.pow(y1-y2,2));\n\n let midX = Math.min(x1, x2) + (Math.max(x1,x2) - Math.min(x1, x2))/2;\n let midY = Math.min(y1, y2) + (Math.max(y1,y2) - Math.min(y1, y2))/2;\n\n let testX = (Math.cos(angle + Math.PI/2))*distance/1.5 + midX;\n let testY = (Math.sin(angle + Math.PI/2))*distance/1.5 + midY;\n // console.log(testX, testY);\n\n ctx.arc(testX, testY, distance/1.2, angle-Math.PI+0.95, angle-0.95);\n\n //ctx.arcTo(source.x + nodeWidth/2 ,source.y + nodeHeight/2,destination.x + nodeWidth/2,destination.y + nodeHeight/2,100);\n //ctx.lineTo(midX, midY);\n ctx.stroke();\n //ctx.endPath();\n }\n }\n\n\n for(let node of nodeDepths.keys()){\n let pos = calculateNodePos(node, nodeDepths, xStep, nodeHeight);\n let color = \"#AA9639\";\n let text = \"\";\n if (node.displayName === \"CompositingNode\"){\n color = \"#000000\";\n }\n if (node.displayName === \"DestinationNode\"){\n color = \"#7D9F35\";\n text=\"Output\";\n }\n if (node.displayName === \"VideoNode\"){\n color = \"#572A72\";\n text = \"Video\";\n }\n if (node.displayName === \"CanvasNode\"){\n color = \"#572A72\";\n text = \"Canvas\";\n }\n if (node.displayName === \"ImageNode\"){\n color = \"#572A72\";\n text = \"Image\";\n }\n ctx.beginPath();\n ctx.fillStyle = color;\n ctx.fillRect(pos.x, pos.y, nodeWidth, nodeHeight);\n ctx.fill();\n\n\n ctx.fillStyle = \"#000\";\n ctx.textAlign = \"center\";\n ctx.font = \"10px Arial\";\n ctx.fillText(text,pos.x+nodeWidth/2, pos.y+nodeHeight/2+2.5);\n ctx.fill();\n }\n\n return;\n}\n\n\n\n\nexport function createSigmaGraphDataFromRenderGraph(videoContext){\n\n function idForNode(node){\n if (videoContext._sourceNodes.indexOf(node) !== -1){\n let id = \"source \" + node.displayName+ \" \"+videoContext._sourceNodes.indexOf(node);\n return id;\n }\n let id = \"processor \" + node.displayName + \" \"+videoContext._processingNodes.indexOf(node);\n return id;\n }\n\n let graph = {\n nodes:[\n {\n id: idForNode(videoContext.destination),\n label:\"Destination Node\",\n x:2.5,\n y:0.5,\n size:2,\n node: videoContext.destination\n }],\n edges:[]\n };\n\n for (let i = 0; i < videoContext._sourceNodes.length; i++) {\n let sourceNode = videoContext._sourceNodes[i];\n let y = i * (1.0 / videoContext._sourceNodes.length);\n graph.nodes.push({\n id: idForNode(sourceNode),\n label:\"Source \"+ i.toString(),\n x:0,\n y: y,\n size:2,\n color:\"#572A72\",\n node:sourceNode\n });\n }\n for (let i = 0; i < videoContext._processingNodes.length; i++) {\n let processingNode = videoContext._processingNodes[i];\n graph.nodes.push({\n id: idForNode(processingNode),\n x: Math.random() *2.5,\n y: Math.random(),\n size:2,\n node: processingNode\n });\n }\n\n for (let i = 0; i < videoContext._renderGraph.connections.length; i++) {\n let conn = videoContext._renderGraph.connections[i];\n graph.edges.push({\n \"id\":\"e\"+i.toString(),\n \"source\": idForNode(conn.source),\n \"target\": idForNode(conn.destination)\n });\n }\n\n\n\n return graph;\n}\n\n\nexport function importSimpleEDL(ctx, playlist){\n // Create a \"track\" node to connect all the clips to.\n let trackNode = ctx.compositor(DEFINITIONS.COMBINE);\n\n // Create a source node for each of the clips.\n for (let clip of playlist){\n let node;\n if (clip.type === \"video\"){\n node = ctx.video(clip.src, clip.sourceStart);\n } else if (clip.type === \"image\"){\n node = ctx.image(clip.src, clip.sourceStart);\n }else {\n console.debug(\"Clip type \\\"\" + clip.type + \"\\\" not recognised, skipping.\");\n continue;\n }\n node.startAt(clip.start);\n node.stopAt(clip.start + clip.duration);\n node.connect(trackNode);\n }\n return trackNode;\n}\n\nexport function visualiseVideoContextTimeline(videoContext, canvas, currentTime){\n let ctx = canvas.getContext(\"2d\");\n let w = canvas.width;\n let h = canvas.height;\n let trackHeight = h / videoContext._sourceNodes.length;\n let playlistDuration = videoContext.duration;\n\n if (currentTime > playlistDuration && !videoContext.endOnLastSourceEnd) playlistDuration = currentTime;\n\n if (videoContext.duration === Infinity){\n let total = 0;\n for (let i = 0; i < videoContext._sourceNodes.length; i++) {\n let sourceNode = videoContext._sourceNodes[i];\n if(sourceNode._stopTime !== Infinity) total += sourceNode._stopTime;\n }\n\n if (total > videoContext.currentTime){\n playlistDuration = total+5;\n }else{\n playlistDuration = videoContext.currentTime+5;\n }\n }\n let pixelsPerSecond = w / playlistDuration;\n let mediaSourceStyle = {\n \"video\":[\"#572A72\", \"#3C1255\"],\n \"image\":[\"#7D9F35\", \"#577714\"],\n \"canvas\":[\"#AA9639\", \"#806D15\"]\n };\n\n\n ctx.clearRect(0,0,w,h);\n ctx.fillStyle = \"#999\";\n\n for(let node of videoContext._processingNodes){\n if (node.displayName !== \"TransitionNode\") continue;\n for(let propertyName in node._transitions){\n for(let transition of node._transitions[propertyName]){\n let tW = (transition.end - transition.start) * pixelsPerSecond;\n let tH = h;\n let tX = transition.start * pixelsPerSecond;\n let tY = 0;\n ctx.fillStyle = \"rgba(0,0,0, 0.3)\";\n ctx.fillRect(tX, tY, tW, tH);\n ctx.fill();\n }\n }\n }\n\n\n for (let i = 0; i < videoContext._sourceNodes.length; i++) {\n let sourceNode = videoContext._sourceNodes[i];\n let duration = sourceNode._stopTime - sourceNode._startTime;\n if(duration=== Infinity) duration = videoContext.currentTime;\n let start = sourceNode._startTime;\n\n let msW = duration * pixelsPerSecond;\n let msH = trackHeight;\n let msX = start * pixelsPerSecond;\n let msY = trackHeight * i;\n ctx.fillStyle = mediaSourceStyle.video[i%mediaSourceStyle.video.length];\n\n\n ctx.fillRect(msX,msY,msW,msH);\n ctx.fill();\n }\n\n\n\n if (currentTime !== undefined){\n ctx.fillStyle = \"#000\";\n ctx.fillRect(currentTime*pixelsPerSecond, 0, 1, h);\n }\n}\n\n\n\n\nexport class UpdateablesManager{\n constructor(){\n this._updateables = [];\n this._useWebworker = false;\n this._active = false;\n this._previousRAFTime = undefined;\n this._previousWorkerTime = undefined;\n\n this._webWorkerString = \"\\\n var running = false;\\\n function tick(){\\\n postMessage(Date.now());\\\n if (running){\\\n setTimeout(tick, 1000/20);\\\n }\\\n }\\\n self.addEventListener('message',function(msg){\\\n var data = msg.data;\\\n if (data === 'start'){\\\n running = true;\\\n tick();\\\n }\\\n if (data === 'stop') running = false;\\\n });\";\n this._webWorker = undefined;\n }\n\n _initWebWorker(){\n window.URL = window.URL || window.webkitURL;\n let blob = new Blob([this._webWorkerString], {type: \"application/javascript\"});\n this._webWorker = new Worker(URL.createObjectURL(blob));\n this._webWorker.onmessage = (msg)=>{\n let time = msg.data;\n this._updateWorkerTime(time);\n };\n }\n\n _lostVisibility(){\n this._previousWorkerTime = Date.now();\n this._useWebworker = true;\n if (!this._webWorker){\n this._initWebWorker();\n }\n this._webWorker.postMessage(\"start\");\n }\n\n _gainedVisibility(){\n this._useWebworker = false;\n this._previousRAFTime = undefined;\n if(this._webWorker) this._webWorker.postMessage(\"stop\");\n requestAnimationFrame(this._updateRAFTime.bind(this));\n }\n\n _init(){\n if(!window.Worker)return;\n\n //If page visibility API not present fallback to using \"focus\" and \"blur\" event listeners.\n if (typeof document.hidden === \"undefined\") {\n window.addEventListener(\"focus\", this._gainedVisibility.bind(this));\n window.addEventListener(\"blur\", this._lostVisibility.bind(this));\n return;\n }\n //Otherwise we can use the visibility API to do the loose/gain focus properly\n document.addEventListener(\"visibilitychange\", ()=>{\n if (document.hidden === true) {\n this._lostVisibility();\n } else {\n this._gainedVisibility();\n }\n }, false);\n\n requestAnimationFrame(this._updateRAFTime.bind(this));\n }\n\n _updateWorkerTime(time){\n let dt = (time - this._previousWorkerTime) / 1000;\n if (dt !== 0) this._update(dt);\n this._previousWorkerTime = time;\n }\n\n _updateRAFTime(time){\n if (this._previousRAFTime === undefined)this._previousRAFTime = time;\n let dt = (time - this._previousRAFTime) / 1000;\n if (dt !== 0) this._update(dt);\n this._previousRAFTime = time;\n if(!this._useWebworker)requestAnimationFrame(this._updateRAFTime.bind(this));\n }\n\n _update(dt){\n for(let i = 0; i < this._updateables.length; i++){\n this._updateables[i]._update(parseFloat(dt));\n\n }\n }\n\n register(updateable){\n this._updateables.push(updateable);\n if (this._active === false){\n this._active = true;\n this._init();\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","import aaf_video_scale from \"./aaf_video_scale.js\";\nimport crossfade from \"./crossfade.js\";\nimport horizontalWipe from \"./horizontalWipe.js\";\nimport verticalWipe from \"./verticalWipe.js\";\nimport randomDissolve from \"./randomDissolve.js\";\nimport toColorAndBackFade from \"./toColorAndBackFade.js\";\nimport starWipe from \"./starWipe.js\";\nimport combine from \"./combine.js\";\nimport colorThreshold from \"./colorThreshold.js\";\nimport monochrome from \"./monochrome.js\";\nimport horizontalBlur from \"./horizontalBlur.js\";\nimport verticalBlur from \"./verticalBlur.js\";\nimport aaf_video_flop from \"./aaf_video_flop.js\";\nimport aaf_video_flip from \"./aaf_video_flip.js\";\nimport aaf_video_position from \"./aaf_video_position.js\";\nimport aaf_video_crop from \"./aaf_video_crop.js\";\nimport staticDissolve from \"./staticDissolve.js\";\nimport staticEffect from \"./staticEffect.js\";\nimport dreamfade from \"./dreamfade.js\";\nimport opacity from \"./opacity.js\";\nimport crop from \"./crop.js\";\n\nlet DEFINITIONS = {\n AAF_VIDEO_SCALE: aaf_video_scale,\n CROSSFADE: crossfade,\n DREAMFADE: dreamfade,\n HORIZONTAL_WIPE:horizontalWipe,\n VERTICAL_WIPE:verticalWipe,\n RANDOM_DISSOLVE:randomDissolve,\n STATIC_DISSOLVE:staticDissolve,\n STATIC_EFFECT:staticEffect,\n TO_COLOR_AND_BACK: toColorAndBackFade,\n STAR_WIPE:starWipe,\n COMBINE: combine,\n COLORTHRESHOLD: colorThreshold,\n MONOCHROME: monochrome,\n HORIZONTAL_BLUR:horizontalBlur,\n VERTICAL_BLUR:verticalBlur,\n AAF_VIDEO_CROP: aaf_video_crop,\n AAF_VIDEO_POSITION: aaf_video_position,\n AAF_VIDEO_FLIP: aaf_video_flip,\n AAF_VIDEO_FLOP: aaf_video_flop,\n OPACITY: opacity,\n CROP: crop\n};\n\nexport default DEFINITIONS;\n\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/definitions.js","let aaf_video_scale = {\n \"title\":\"AAF Video Scale Effect\",\n \"description\": \"A scale effect based on the AAF spec.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float scaleX;\\\n uniform float scaleY;\\\n varying vec2 v_texCoord;\\\n varying float v_progress;\\\n void main(){\\\n vec2 pos = vec2(v_texCoord[0]*1.0/scaleX - (1.0/scaleX/2.0 -0.5), v_texCoord[1]*1.0/scaleY - (1.0/scaleY/2.0 -0.5));\\\n vec4 color = texture2D(u_image, pos);\\\n if (pos[0] < 0.0 || pos[0] > 1.0 || pos[1] < 0.0 || pos[1] > 1.0){\\\n color = vec4(0.0,0.0,0.0,0.0);\\\n }\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"scaleX\":{\"type\":\"uniform\", \"value\":1.0},\n \"scaleY\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_scale;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_scale.js","let crossfade = {\n \"title\":\"Cross-Fade\",\n \"description\": \"A cross-fade effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n color_a[0] *= (1.0 - mix);\\\n color_a[1] *= (1.0 - mix);\\\n color_a[2] *= (1.0 - mix);\\\n color_a[3] *= (1.0 - mix);\\\n color_b[0] *= mix;\\\n color_b[1] *= mix;\\\n color_b[2] *= mix;\\\n color_b[3] *= mix;\\\n gl_FragColor = color_a + color_b;\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default crossfade;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/crossfade.js","let horizontal_wipe = {\n \"title\":\"Horizontal Wipe\",\n \"description\": \"A horizontal wipe effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n if (v_texCoord[0] > mix){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default horizontal_wipe;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/horizontalWipe.js","let verticalWipe = {\n \"title\":\"vertical Wipe\",\n \"description\": \"A vertical wipe effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n if (v_texCoord[1] > mix){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default verticalWipe;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/verticalWipe.js","let randomDissolve = {\n \"title\":\"Random Dissolve\",\n \"description\": \"A random dissolve effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n float rand(vec2 co){\\\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\\\n }\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n if (clamp(rand(v_texCoord), 0.01, 1.001) > mix){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default randomDissolve;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/randomDissolve.js","let toColorAndBackFade = {\n \"title\":\"To Color And Back Fade\",\n \"description\": \"A fade to black and back effect. Setting mix to 0.5 is a fully solid color frame. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n uniform vec4 color;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n float mix_amount = (mix *2.0) - 1.0;\\\n if(mix_amount < 0.0){\\\n gl_FragColor = abs(mix_amount) * color_a + (1.0 - abs(mix_amount)) * color;\\\n } else {\\\n gl_FragColor = mix_amount * color_b + (1.0 - mix_amount) * color;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0},\n \"color\":{\"type\":\"uniform\", \"value\":[0.0,0.0,0.0,0.0]}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\nexport default toColorAndBackFade;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/toColorAndBackFade.js","let starWipe = {\n \"title\":\"Star Wipe Fade\",\n \"description\": \"A classic star wipe transistion. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n float sign (vec2 p1, vec2 p2, vec2 p3){\\\n return (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]);\\\n }\\\n bool pointInTriangle(vec2 pt, vec2 v1, vec2 v2, vec2 v3){\\\n bool b1, b2, b3;\\\n b1 = sign(pt, v1, v2) < 0.0;\\\n b2 = sign(pt, v2, v3) < 0.0;\\\n b3 = sign(pt, v3, v1) < 0.0;\\\n return ((b1 == b2) && (b2 == b3));\\\n }\\\n vec2 rotatePointAboutPoint(vec2 point, vec2 pivot, float angle){\\\n float s = sin(angle);\\\n float c = cos(angle);\\\n float x = point[0] - pivot[0];\\\n float y = point[1] - pivot[1];\\\n float new_x = x * c - y * s;\\\n float new_y = x * s + y * c;\\\n return vec2(new_x + pivot[0], new_y+pivot[1]);\\\n }\\\n \\\n void main(){\\\n vec4 color_a = texture2D(u_image_b, v_texCoord);\\\n vec4 color_b = texture2D(u_image_a, v_texCoord);\\\n vec2 t0_p0,t0_p1,t0_p2,t1_p0,t1_p1,t1_p2,t2_p0,t2_p1,t2_p2,t3_p0,t3_p1,t3_p2;\\\n vec2 t4_p0,t4_p1,t4_p2,t5_p0,t5_p1,t5_p2,t6_p0,t6_p1,t6_p2,t7_p0,t7_p1,t7_p2;\\\n \\\n \\\n t0_p0 = vec2(0.0, 0.25) * clamp(mix,0.0,1.0) * 2.0 + vec2(0.5,0.5);\\\n t0_p1 = vec2(0.0, -0.25) * clamp(mix,0.0,1.0) * 2.0 + vec2(0.5,0.5);\\\n t0_p2 = vec2(1.0, 0.0) * clamp(mix,0.0,1.0) * 2.0 + vec2(0.5,0.5);\\\n \\\n t1_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854);\\\n t1_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854);\\\n t1_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854);\\\n \\\n t2_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 2.0);\\\n t2_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 2.0);\\\n t2_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 2.0);\\\n \\\n t3_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 3.0);\\\n t3_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 3.0);\\\n t3_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 3.0);\\\n \\\n t4_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 4.0);\\\n t4_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 4.0);\\\n t4_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 4.0);\\\n \\\n t5_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 5.0);\\\n t5_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 5.0);\\\n t5_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 5.0);\\\n \\\n t6_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 6.0);\\\n t6_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 6.0);\\\n t6_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 6.0);\\\n \\\n t7_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 7.0);\\\n t7_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 7.0);\\\n t7_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 7.0);\\\n \\\n if(mix > 0.99){\\\n gl_FragColor = color_a;\\\n return;\\\n }\\\n if(mix < 0.01){\\\n gl_FragColor = color_b;\\\n return;\\\n }\\\n if(pointInTriangle(v_texCoord, t0_p0, t0_p1, t0_p2) || pointInTriangle(v_texCoord, t1_p0, t1_p1, t1_p2) || pointInTriangle(v_texCoord, t2_p0, t2_p1, t2_p2) || pointInTriangle(v_texCoord, t3_p0, t3_p1, t3_p2) || pointInTriangle(v_texCoord, t4_p0, t4_p1, t4_p2) || pointInTriangle(v_texCoord, t5_p0, t5_p1, t5_p2) || pointInTriangle(v_texCoord, t6_p0, t6_p1, t6_p2) || pointInTriangle(v_texCoord, t7_p0, t7_p1, t7_p2)){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default starWipe;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/starWipe.js","let combine = {\n \"title\":\"Combine\",\n \"description\": \"A basic effect which renders the input to the output, Typically used as a combine node for layering up media with alpha transparency.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float a;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"a\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default combine;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/combine.js","let colorThreshold = {\n \"title\":\"Color Threshold\",\n \"description\": \"Turns all pixels with a greater value than the specified threshold transparent.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float a;\\\n uniform vec3 colorAlphaThreshold;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n if (color[0] > colorAlphaThreshold[0] && color[1]> colorAlphaThreshold[1] && color[2]> colorAlphaThreshold[2]){\\\n color = vec4(0.0,0.0,0.0,0.0);\\\n }\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"a\":{\"type\":\"uniform\", \"value\":0.0},\n \"colorAlphaThreshold\":{\"type\":\"uniform\", \"value\":[0.0,0.55,0.0]}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default colorThreshold;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/colorThreshold.js","let monochrome = {\n \"title\":\"Monochrome\",\n \"description\": \"Change images to a single chroma (e.g can be used to make a black & white filter). Input color mix and output color mix can be adjusted.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform vec3 inputMix;\\\n uniform vec3 outputMix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n float mono = color[0]*inputMix[0] + color[1]*inputMix[1] + color[2]*inputMix[2];\\\n color[0] = mono * outputMix[0];\\\n color[1] = mono * outputMix[1];\\\n color[2] = mono * outputMix[2];\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"inputMix\":{\"type\":\"uniform\", \"value\":[0.4,0.6,0.2]},\n \"outputMix\":{\"type\":\"uniform\", \"value\":[1.0,1.0,1.0]}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default monochrome;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/monochrome.js","let horizontal_blur = {\n \"title\":\"Horizontal Blur\",\n \"description\": \"A horizontal blur effect. Adpated from http://xissburg.com/faster-gaussian-blur-in-glsl/\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n uniform float blurAmount;\\\n varying vec2 v_texCoord;\\\n varying vec2 v_blurTexCoords[14];\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n v_blurTexCoords[ 0] = v_texCoord + vec2(-0.028 * blurAmount, 0.0);\\\n v_blurTexCoords[ 1] = v_texCoord + vec2(-0.024 * blurAmount, 0.0);\\\n v_blurTexCoords[ 2] = v_texCoord + vec2(-0.020 * blurAmount, 0.0);\\\n v_blurTexCoords[ 3] = v_texCoord + vec2(-0.016 * blurAmount, 0.0);\\\n v_blurTexCoords[ 4] = v_texCoord + vec2(-0.012 * blurAmount, 0.0);\\\n v_blurTexCoords[ 5] = v_texCoord + vec2(-0.008 * blurAmount, 0.0);\\\n v_blurTexCoords[ 6] = v_texCoord + vec2(-0.004 * blurAmount, 0.0);\\\n v_blurTexCoords[ 7] = v_texCoord + vec2( 0.004 * blurAmount, 0.0);\\\n v_blurTexCoords[ 8] = v_texCoord + vec2( 0.008 * blurAmount, 0.0);\\\n v_blurTexCoords[ 9] = v_texCoord + vec2( 0.012 * blurAmount, 0.0);\\\n v_blurTexCoords[10] = v_texCoord + vec2( 0.016 * blurAmount, 0.0);\\\n v_blurTexCoords[11] = v_texCoord + vec2( 0.020 * blurAmount, 0.0);\\\n v_blurTexCoords[12] = v_texCoord + vec2( 0.024 * blurAmount, 0.0);\\\n v_blurTexCoords[13] = v_texCoord + vec2( 0.028 * blurAmount, 0.0);\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n varying vec2 v_blurTexCoords[14];\\\n void main(){\\\n gl_FragColor = vec4(0.0);\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 0])*0.0044299121055113265;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 1])*0.00895781211794;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 2])*0.0215963866053;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 3])*0.0443683338718;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 4])*0.0776744219933;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 5])*0.115876621105;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 6])*0.147308056121;\\\n gl_FragColor += texture2D(u_image, v_texCoord )*0.159576912161;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 7])*0.147308056121;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 8])*0.115876621105;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 9])*0.0776744219933;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[10])*0.0443683338718;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[11])*0.0215963866053;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[12])*0.00895781211794;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[13])*0.0044299121055113265;\\\n }\",\n \"properties\":{\n \"blurAmount\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default horizontal_blur;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/horizontalBlur.js","let verticalBlur = {\n \"title\":\"Vertical Blur\",\n \"description\": \"A vertical blur effect. Adpated from http://xissburg.com/faster-gaussian-blur-in-glsl/\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n uniform float blurAmount;\\\n varying vec2 v_blurTexCoords[14];\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n v_blurTexCoords[ 0] = v_texCoord + vec2(0.0,-0.028 * blurAmount);\\\n v_blurTexCoords[ 1] = v_texCoord + vec2(0.0,-0.024 * blurAmount);\\\n v_blurTexCoords[ 2] = v_texCoord + vec2(0.0,-0.020 * blurAmount);\\\n v_blurTexCoords[ 3] = v_texCoord + vec2(0.0,-0.016 * blurAmount);\\\n v_blurTexCoords[ 4] = v_texCoord + vec2(0.0,-0.012 * blurAmount);\\\n v_blurTexCoords[ 5] = v_texCoord + vec2(0.0,-0.008 * blurAmount);\\\n v_blurTexCoords[ 6] = v_texCoord + vec2(0.0,-0.004 * blurAmount);\\\n v_blurTexCoords[ 7] = v_texCoord + vec2(0.0, 0.004 * blurAmount);\\\n v_blurTexCoords[ 8] = v_texCoord + vec2(0.0, 0.008 * blurAmount);\\\n v_blurTexCoords[ 9] = v_texCoord + vec2(0.0, 0.012 * blurAmount);\\\n v_blurTexCoords[10] = v_texCoord + vec2(0.0, 0.016 * blurAmount);\\\n v_blurTexCoords[11] = v_texCoord + vec2(0.0, 0.020 * blurAmount);\\\n v_blurTexCoords[12] = v_texCoord + vec2(0.0, 0.024 * blurAmount);\\\n v_blurTexCoords[13] = v_texCoord + vec2(0.0, 0.028 * blurAmount);\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n varying vec2 v_blurTexCoords[14];\\\n void main(){\\\n gl_FragColor = vec4(0.0);\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 0])*0.0044299121055113265;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 1])*0.00895781211794;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 2])*0.0215963866053;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 3])*0.0443683338718;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 4])*0.0776744219933;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 5])*0.115876621105;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 6])*0.147308056121;\\\n gl_FragColor += texture2D(u_image, v_texCoord )*0.159576912161;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 7])*0.147308056121;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 8])*0.115876621105;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 9])*0.0776744219933;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[10])*0.0443683338718;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[11])*0.0215963866053;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[12])*0.00895781211794;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[13])*0.0044299121055113265;\\\n }\",\n \"properties\":{\n \"blurAmount\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default verticalBlur;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/verticalBlur.js","let aaf_video_flop = {\n \"title\":\"AAF Video Flop Effect\",\n \"description\": \"A flop effect based on the AAF spec. Mirrors the image in the y-axis\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n void main(){\\\n vec2 coord = vec2(1.0 - v_texCoord[0] ,v_texCoord[1]);\\\n vec4 color = texture2D(u_image, coord);\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_flop;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_flop.js","let aaf_video_flip = {\n \"title\":\"AAF Video Scale Effect\",\n \"description\": \"A flip effect based on the AAF spec. Mirrors the image in the x-axis\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n void main(){\\\n vec2 coord = vec2(v_texCoord[0] ,1.0 - v_texCoord[1]);\\\n vec4 color = texture2D(u_image, coord);\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_flip;\n\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_flip.js","let aaf_video_position = {\n \"title\":\"AAF Video Position Effect\",\n \"description\": \"A position effect based on the AAF spec.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float positionOffsetX;\\\n uniform float positionOffsetY;\\\n varying vec2 v_texCoord;\\\n varying float v_progress;\\\n void main(){\\\n vec2 pos = vec2(v_texCoord[0] - positionOffsetX/2.0, v_texCoord[1] - positionOffsetY/2.0);\\\n vec4 color = texture2D(u_image, pos);\\\n if (pos[0] < 0.0 || pos[0] > 1.0 || pos[1] < 0.0 || pos[1] > 1.0){\\\n color = vec4(0.0,0.0,0.0,0.0);\\\n }\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"positionOffsetX\":{\"type\":\"uniform\", \"value\":0.0},\n \"positionOffsetY\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_position;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_position.js","let aaf_video_crop = {\n \"title\":\"AAF Video Crop Effect\",\n \"description\": \"A crop effect based on the AAF spec.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float cropLeft;\\\n uniform float cropRight;\\\n uniform float cropTop;\\\n uniform float cropBottom;\\\n varying vec2 v_texCoord;\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n if (v_texCoord[0] < (cropLeft+1.0)/2.0) color = vec4(0.0,0.0,0.0,0.0);\\\n if (v_texCoord[0] > (cropRight+1.0)/2.0) color = vec4(0.0,0.0,0.0,0.0);\\\n if (v_texCoord[1] < (-cropBottom+1.0)/2.0) color = vec4(0.0,0.0,0.0,0.0);\\\n if (v_texCoord[1] > (-cropTop+1.0)/2.0) color = vec4(0.0,0.0,0.0,0.0);\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"cropLeft\":{\"type\":\"uniform\", \"value\":-1.0},\n \"cropRight\":{\"type\":\"uniform\", \"value\":1.0},\n \"cropTop\":{\"type\":\"uniform\", \"value\": -1.0},\n \"cropBottom\":{\"type\":\"uniform\", \"value\": 1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_crop;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_crop.js","let staticDissolve = {\n \"title\":\"Static Dissolve\",\n \"description\": \"A static dissolve effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n uniform float currentTime;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n float rand(vec2 co, float currentTime){\\\n return fract(sin(dot(co.xy,vec2(12.9898,78.233))+currentTime) * 43758.5453);\\\n }\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n if (clamp(rand(v_texCoord, currentTime), 0.01, 1.001) > mix){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default staticDissolve;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/staticDissolve.js","let staticEffect = {\n \"title\":\"Static\",\n \"description\": \"A static effect to add pseudo random noise to a video\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float currentTime;\\\n uniform float amount;\\\n varying vec2 v_texCoord;\\\n uniform vec3 weight;\\\n float rand(vec2 co, float currentTime){\\\n return fract(sin(dot(co.xy,vec2(12.9898,78.233))+currentTime) * 43758.5453);\\\n }\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n color[0] = color[0] + (2.0*(clamp(rand(v_texCoord, currentTime), 0.01, 1.001)-0.5)) * weight[0] * amount;\\\n color[1] = color[1] + (2.0*(clamp(rand(v_texCoord, currentTime), 0.01, 1.001)-0.5)) * weight[1] * amount;\\\n color[2] = color[2] + (2.0*(clamp(rand(v_texCoord, currentTime), 0.01, 1.001)-0.5)) * weight[2] *amount;\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"weight\":{\"type\":\"uniform\", \"value\":[1.0,1.0,1.0]},\n \"amount\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default staticEffect;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/staticEffect.js","let dreamfade = {\n \"title\":\"Dream-Fade\",\n \"description\": \"A wobbly dream effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n float wobble = 1.0 - abs((mix*2.0)-1.0);\\\n vec2 pos = vec2(v_texCoord[0] + ((sin(v_texCoord[1]*(10.0*wobble*3.14) + wobble*10.0)/13.0)), v_texCoord[1]);\\\n vec4 color_a = texture2D(u_image_a, pos);\\\n vec4 color_b = texture2D(u_image_b, pos);\\\n color_a[0] *= (1.0 - mix);\\\n color_a[1] *= (1.0 - mix);\\\n color_a[2] *= (1.0 - mix);\\\n color_a[3] *= (1.0 - mix);\\\n color_b[0] *= mix;\\\n color_b[1] *= mix;\\\n color_b[2] *= mix;\\\n color_b[3] *= mix;\\\n gl_FragColor = color_a + color_b;\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default dreamfade;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/dreamfade.js","const opacity = {\n \"title\": \"Opacity\",\n \"description\": \"Sets the opacity of an input.\",\n \"vertexShader\": `\n attribute vec2 a_position;\n attribute vec2 a_texCoord;\n varying vec2 v_texCoord;\n void main() {\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\n v_texCoord = a_texCoord;\n }`,\n \"fragmentShader\": `\n precision mediump float;\n uniform sampler2D u_image;\n uniform float opacity;\n varying vec2 v_texCoord;\n varying float v_opacity;\n void main(){\n vec4 color = texture2D(u_image, v_texCoord);\n color[3] *= opacity;\n gl_FragColor = color;\n }`,\n \"properties\": {\n \"opacity\": {\"type\": \"uniform\", \"value\": 0.7},\n },\n \"inputs\": [\"u_image\"],\n};\n\nexport default opacity;\n\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/opacity.js","let crop = {\n \"title\":\"Primer Simple Crop\",\n \"description\": \"A simple crop processors for primer\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float x;\\\n uniform float y;\\\n uniform float width;\\\n uniform float height;\\\n varying vec2 v_texCoord;\\\n varying float v_progress;\\\n void main(){\\\n vec2 pos = (((v_texCoord)*vec2(width, height)) + vec2(0, 1.0-height)) +vec2(x,-y);\\\n vec4 color = texture2D(u_image, pos);\\\n if (pos[0] < 0.0 || pos[0] > 1.0 || pos[1] < 0.0 || pos[1] > 1.0){\\\n color = vec4(0.0,0.0,0.0,0.0);\\\n }\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"x\":{type:\"uniform\", value:0.0},\n \"y\":{type:\"uniform\", value:0.0},\n \"width\":{type:\"uniform\", value:1.0},\n \"height\":{type:\"uniform\", value:1.0},\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default crop;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/crop.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nclass GraphNode {\n /**\n * Base class from which all processing and source nodes are derrived.\n */\n constructor(gl, renderGraph, inputNames, limitConnections=false){\n this._renderGraph = renderGraph;\n this._limitConnections = limitConnections;\n this._inputNames = inputNames;\n this._destroyed = false;\n\n //Setup WebGL output texture\n this._gl = gl;\n this._renderGraph = renderGraph;\n this._rendered =false;\n this._displayName = \"GraphNode\";\n }\n\n /**\n * Get a string representation of the class name.\n *\n * @return String A string of the class name.\n */ \n get displayName(){\n return this._displayName;\n }\n\n /**\n * Get the names of the inputs to this node.\n *\n * @return {String[]} An array of the names of the inputs ot the node.\n */ \n get inputNames(){\n return this._inputNames.slice();\n }\n\n /**\n * The maximum number of connections that can be made to this node. If there is not limit this will return Infinity.\n *\n * @return {number} The number of connections which can be made to this node.\n */\n get maximumConnections(){\n if (this._limitConnections ===false) return Infinity;\n return this._inputNames.length;\n }\n\n /**\n * Get an array of all the nodes which connect to this node.\n *\n * @return {GraphNode[]} An array of nodes which connect to this node.\n */\n get inputs(){\n let result = this._renderGraph.getInputsForNode(this);\n result = result.filter(function(n){return n !== undefined;});\n return result;\n }\n \n /**\n * Get an array of all the nodes which this node outputs to.\n *\n * @return {GraphNode[]} An array of nodes which this node connects to.\n */\n get outputs(){\n return this._renderGraph.getOutputsForNode(this);\n }\n\n /**\n * Get whether the node has been destroyed or not.\n *\n * @return {boolean} A true/false value of whather the node has been destoryed or not.\n */\n get destroyed(){\n return this._destroyed;\n }\n\n\n /**\n * Connect this node to the targetNode\n * \n * @param {GraphNode} targetNode - the node to connect.\n * @param {(number| String)} [targetPort] - the port on the targetNode to connect to, this can be an index, a string identifier, or undefined (in which case the next available port will be connected to).\n * \n */\n connect(targetNode, targetPort){\n return (this._renderGraph.registerConnection(this, targetNode, targetPort));\n }\n \n /**\n * Disconnect this node from the targetNode. If targetNode is undefind remove all out-bound connections.\n *\n * @param {GraphNode} [targetNode] - the node to disconnect from. If undefined, disconnect from all nodes.\n *\n */\n disconnect(targetNode){\n if (targetNode === undefined){\n let toRemove = this._renderGraph.getOutputsForNode(this);\n toRemove.forEach((target) => this._renderGraph.unregisterConnection(this, target));\n if (toRemove.length > 0) return true;\n return false;\n }\n return this._renderGraph.unregisterConnection(this, targetNode);\n }\n\n /**\n * Destory this node, removing it from the graph.\n */\n destroy(){\n this.disconnect();\n for (let input of this.inputs){\n input.disconnect(this);\n }\n this._destroyed = true;\n }\n}\n\nexport default GraphNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/graphnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport SourceNode, { SOURCENODESTATE } from \"./sourcenode\";\n\nclass ImageNode extends SourceNode {\n /**\n * Initialise an instance of an ImageNode.\n * This should not be called directly, but created through a call to videoContext.createImageNode();\n */\n constructor(src, gl, renderGraph, currentTime, preloadTime = 4, attributes = {}){\n super(src, gl, renderGraph, currentTime);\n this._preloadTime = preloadTime;\n this._attributes = attributes;\n this._textureUploaded = false;\n this._displayName = \"ImageNode\";\n }\n\n get elementURL(){\n return this._elementURL;\n }\n\n _load(){\n\n if (this._element !== undefined){\n for (var key in this._attributes) {\n this._element[key] = this._attributes[key];\n }\n return;\n }\n if (this._isResponsibleForElementLifeCycle){\n super._load();\n this._element = new Image();\n this._element.setAttribute(\"crossorigin\", \"anonymous\");\n this._element.src = this._elementURL;\n this._element.onload = () => {\n this._ready = true;\n this._triggerCallbacks(\"loaded\");\n };\n this._element.onerror = () => {\n console.error(\"ImageNode failed to load. url:\", this._elementURL);\n };\n\n for (let key in this._attributes) {\n this._element[key] = this._attributes[key];\n }\n }\n this._element.onerror = () => {\n console.debug(\"Error with element\", this._element);\n this._state = SOURCENODESTATE.error;\n //Event though there's an error ready should be set to true so the node can output transparenn\n this._ready = true;\n this._triggerCallbacks(\"error\");\n };\n }\n\n _unload(){\n super._unload();\n if (this._isResponsibleForElementLifeCycle){\n this._element.src = \"\";\n this._element.onerror = undefined;\n this._element = undefined;\n delete this._element;\n }\n this._ready = false;\n }\n\n _seek(time){\n super._seek(time);\n if (this.state === SOURCENODESTATE.playing || this.state === SOURCENODESTATE.paused){\n if (this._element === undefined) this._load();\n }\n if((this._state === SOURCENODESTATE.sequenced || this._state === SOURCENODESTATE.ended) && this._element !== undefined){\n this._unload();\n }\n }\n\n _update(currentTime){\n //if (!super._update(currentTime)) return false;\n if (this._textureUploaded){\n super._update(currentTime, false);\n }else{\n super._update(currentTime);\n }\n\n if (this._startTime - this._currentTime <= this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();\n\n if (this._state === SOURCENODESTATE.playing){\n return true;\n } else if (this._state === SOURCENODESTATE.paused){\n return true;\n }\n else if (this._state === SOURCENODESTATE.ended && this._element !== undefined){\n this._unload();\n return false;\n }\n\n }\n\n}\n\nexport default ImageNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/SourceNodes/imagenode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport SourceNode, { SOURCENODESTATE } from \"./sourcenode\";\n\nclass CanvasNode extends SourceNode {\n /**\n * Initialise an instance of a CanvasNode.\n * This should not be called directly, but created through a call to videoContext.createCanvasNode();\n */\n constructor(canvas, gl, renderGraph, currentTime, preloadTime = 4){\n super(canvas, gl, renderGraph, currentTime);\n this._preloadTime = preloadTime;\n this._displayName = \"CanvasNode\";\n }\n\n _load(){\n super._load();\n this._ready = true;\n this._triggerCallbacks(\"loaded\");\n }\n\n _unload(){\n super._unload();\n this._ready = false;\n }\n\n _seek(time){\n super._seek(time);\n if (this.state === SOURCENODESTATE.playing || this.state === SOURCENODESTATE.paused){\n if (this._element === undefined) this._load();\n this._ready = false;\n }\n if((this._state === SOURCENODESTATE.sequenced || this._state === SOURCENODESTATE.ended) && this._element !== undefined){\n this._unload();\n }\n }\n\n _update(currentTime){\n //if (!super._update(currentTime)) return false;\n super._update(currentTime);\n if (this._startTime - this._currentTime <= this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();\n\n if (this._state === SOURCENODESTATE.playing){\n return true;\n } else if (this._state === SOURCENODESTATE.paused){\n return true;\n }\n else if (this._state === SOURCENODESTATE.ended && this._element !== undefined){\n this._unload();\n return false;\n }\n\n }\n\n}\n\nexport default CanvasNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/SourceNodes/canvasnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport ProcessingNode from \"./processingnode\";\nimport { createElementTexutre } from \"../utils.js\";\n\nclass CompositingNode extends ProcessingNode{\n /**\n * Initialise an instance of a Compositing Node. You should not instantiate this directly, but use VideoContest.createCompositingNode().\n */\n constructor(gl, renderGraph, definition){\n let placeholderTexture = createElementTexutre(gl);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));\n super(gl, renderGraph, definition, definition.inputs, false);\n this._placeholderTexture = placeholderTexture;\n this._displayName = \"CompositingNode\";\n }\n\n _render(){\n let gl = this._gl; \n gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this._texture,0);\n gl.clearColor(0, 0, 0, 0); // green;\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\n this.inputs.forEach((node) => {\n if (node === undefined)return;\n super._render();\n\n //map the input textures input the node\n var texture = node._texture;\n let textureOffset = 0;\n\n for(let mapping of this._inputTextureUnitMapping ){\n gl.activeTexture(mapping.textureUnit);\n let textureLocation = gl.getUniformLocation(this._program, mapping.name);\n gl.uniform1i(textureLocation, this._parameterTextureCount + textureOffset);\n textureOffset += 1;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n }\n\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n });\n \n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n}\n\nexport default CompositingNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ProcessingNodes/compositingnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport GraphNode from \"../graphnode\";\nimport { compileShader, createShaderProgram, createElementTexutre, updateTexture } from \"../utils.js\";\nimport { RenderException } from \"../exceptions.js\";\n\nclass ProcessingNode extends GraphNode{\n /**\n * Initialise an instance of a ProcessingNode.\n *\n * This class is not used directly, but is extended to create CompositingNodes, TransitionNodes, and EffectNodes.\n */\n constructor(gl, renderGraph, definition, inputNames, limitConnections){\n super(gl, renderGraph, inputNames, limitConnections);\n this._vertexShader = compileShader(gl, definition.vertexShader, gl.VERTEX_SHADER);\n this._fragmentShader = compileShader(gl, definition.fragmentShader, gl.FRAGMENT_SHADER);\n this._definition = definition;\n this._properties = {};//definition.properties;\n //copy definition properties\n for(let propertyName in definition.properties){\n let propertyValue = definition.properties[propertyName].value;\n //if an array then shallow copy it\n if(Object.prototype.toString.call(propertyValue) === \"[object Array]\"){\n propertyValue = definition.properties[propertyName].value.slice();\n }\n let propertyType = definition.properties[propertyName].type;\n this._properties[propertyName] = {type:propertyType, value:propertyValue};\n }\n\n this._inputTextureUnitMapping =[];\n this._maxTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n this._boundTextureUnits = 0;\n this._parameterTextureCount = 0;\n this._inputTextureCount = 0;\n this._texture = createElementTexutre(gl);\n gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGBA, gl.canvas.width, gl.canvas.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n //compile the shader\n this._program = createShaderProgram(gl, this._vertexShader, this._fragmentShader);\n\n //create and setup the framebuffer\n this._framebuffer = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this._texture,0);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n //create properties on this object for the passed properties\n for (let propertyName in this._properties){\n Object.defineProperty(this, propertyName, {\n get:function(){return this._properties[propertyName].value;},\n set:function(passedValue){this._properties[propertyName].value = passedValue;}\n });\n }\n\n //create texutres for any texture properties\n for (let propertyName in this._properties){\n let propertyValue = this._properties[propertyName].value;\n if (propertyValue instanceof Image){\n this._properties[propertyName].texture = createElementTexutre(gl);\n this._properties[propertyName].texutreUnit = gl.TEXTURE0 + this._boundTextureUnits;\n this._boundTextureUnits += 1;\n this._parameterTextureCount +=1;\n if (this._boundTextureUnits > this._maxTextureUnits){\n throw new RenderException(\"Trying to bind more than available textures units to shader\");\n }\n }\n }\n\n //calculate texutre units for input textures\n for(let inputName of definition.inputs){\n this._inputTextureUnitMapping.push({name:inputName, textureUnit:gl.TEXTURE0 + this._boundTextureUnits});\n this._boundTextureUnits += 1;\n this._inputTextureCount += 1;\n if (this._boundTextureUnits > this._maxTextureUnits){\n throw new RenderException(\"Trying to bind more than available textures units to shader\");\n }\n }\n\n\n //find the locations of the properties in the compiled shader\n for (let propertyName in this._properties){\n if (this._properties[propertyName].type === \"uniform\"){\n this._properties[propertyName].location = this._gl.getUniformLocation(this._program, propertyName);\n }\n }\n this._currentTimeLocation = this._gl.getUniformLocation(this._program, \"currentTime\");\n this._currentTime = 0;\n\n\n //Other setup\n let positionLocation = gl.getAttribLocation(this._program, \"a_position\");\n let buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.enableVertexAttribArray(positionLocation);\n gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);\n gl.bufferData(\n gl.ARRAY_BUFFER,\n new Float32Array([\n 1.0, 1.0,\n 0.0, 1.0,\n 1.0, 0.0,\n 1.0, 0.0,\n 0.0, 1.0,\n 0.0, 0.0]),\n gl.STATIC_DRAW);\n let texCoordLocation = gl.getAttribLocation(this._program, \"a_texCoord\");\n gl.enableVertexAttribArray(texCoordLocation);\n gl.vertexAttribPointer(texCoordLocation, 2, gl.FLOAT, false, 0, 0);\n this._displayName = \"ProcessingNode\";\n\n }\n\n /**\n * Sets the passed processing node property to the passed value.\n * @param {string} name - The name of the processing node parameter to modify.\n * @param {Object} value - The value to set it to.\n *\n * @example \n * var ctx = new VideoContext();\n * var monoNode = ctx.effect(VideoContext.DEFINITIONS.MONOCHROME);\n * monoNode.setProperty(\"inputMix\", [1.0,0.0,0.0]); //Just use red channel\n */\n setProperty(name, value){\n this._properties[name].value = value;\n }\n\n /**\n * Sets the passed processing node property to the passed value.\n * @param {string} name - The name of the processing node parameter to get.\n *\n * @example \n * var ctx = new VideoContext();\n * var monoNode = ctx.effect(VideoContext.DEFINITIONS.MONOCHROME);\n * console.log(monoNode.getProperty(\"inputMix\")); //Will output [0.4,0.6,0.2], the default value from the effect definition.\n * \n */\n getProperty(name){\n return this._properties[name].value;\n }\n\n /**\n * Destroy and clean-up the node.\n */\n destroy(){\n super.destroy();\n //destrpy texutres for any texture properties\n for (let propertyName in this._properties){\n let propertyValue = this._properties[propertyName].value;\n if (propertyValue instanceof Image){\n this._gl.deleteTexture(this._properties[propertyName].texture);\n this._texture = undefined;\n }\n }\n //Destroy main\n this._gl.deleteTexture(this._texture);\n this._texture = undefined;\n //Detach shaders\n this._gl.detachShader(this._program, this._vertexShader);\n this._gl.detachShader(this._program, this._fragmentShader);\n //Delete shaders\n this._gl.deleteShader(this._vertexShader);\n this._gl.deleteShader(this._fragmentShader);\n //Delete program\n this._gl.deleteProgram(this._program);\n //Delete Framebuffer\n this._gl.deleteFramebuffer(this._framebuffer);\n }\n\n _update(currentTime){\n this._currentTime = currentTime;\n }\n\n _seek(currentTime){\n this._currentTime = currentTime;\n }\n\n _render(){\n this._rendered = true;\n let gl = this._gl;\n gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);\n\n gl.useProgram(this._program);\n\n //upload the default uniforms\n gl.uniform1f(this._currentTimeLocation, parseFloat(this._currentTime));\n\n //upload/update the custom uniforms\n let textureOffset = 0;\n\n for (let propertyName in this._properties){\n let propertyValue = this._properties[propertyName].value;\n let propertyType = this._properties[propertyName].type;\n let propertyLocation = this._properties[propertyName].location;\n if (propertyType !== \"uniform\") continue;\n\n if (typeof propertyValue === \"number\"){\n gl.uniform1f(propertyLocation, propertyValue);\n }\n else if( Object.prototype.toString.call(propertyValue) === \"[object Array]\"){\n if(propertyValue.length === 1){\n gl.uniform1fv(propertyLocation, propertyValue);\n } else if(propertyValue.length === 2){\n gl.uniform2fv(propertyLocation, propertyValue);\n } else if(propertyValue.length === 3){\n gl.uniform3fv(propertyLocation, propertyValue);\n } else if(propertyValue.length === 4){\n gl.uniform4fv(propertyLocation, propertyValue);\n } else{\n console.debug(\"Shader parameter\", propertyName, \"is too long an array:\", propertyValue);\n }\n } else if(propertyValue instanceof Image){\n let texture = this._properties[propertyName].texture;\n let textureUnit = this._properties[propertyName].texutreUnit;\n updateTexture(gl, texture, propertyValue);\n\n gl.activeTexture(textureUnit);\n gl.uniform1i(propertyLocation, textureOffset);\n textureOffset += 1;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n }\n else{\n //TODO - add tests for textures\n /*gl.activeTexture(gl.TEXTURE0 + textureOffset);\n gl.uniform1i(parameterLoctation, textureOffset);\n gl.bindTexture(gl.TEXTURE_2D, textures[textureOffset-1]);*/\n }\n }\n\n }\n}\n\nexport default ProcessingNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ProcessingNodes/processingnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nexport function ConnectException(message){\n this.message = message;\n this.name = \"ConnectionException\";\n}\n\nexport function RenderException(message){\n this.message = message;\n this.name = \"RenderException\";\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/exceptions.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport ProcessingNode from \"../ProcessingNodes/processingnode\";\n\nclass DestinationNode extends ProcessingNode {\n /**\n * Initialise an instance of a DestinationNode. \n *\n * There should only be a single instance of a DestinationNode per VideoContext instance. An VideoContext's destination can be accessed like so: videoContext.desitnation.\n * \n * You should not instantiate this directly.\n */\n constructor(gl, renderGraph){ \n \n let vertexShader = \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\";\n\n let fragmentShader = \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n varying float v_progress;\\\n void main(){\\\n gl_FragColor = texture2D(u_image, v_texCoord);\\\n }\";\n\n let deffinition = {fragmentShader:fragmentShader, vertexShader:vertexShader, properties:{}, inputs:[\"u_image\"]};\n\n super(gl, renderGraph, deffinition, deffinition.inputs, false);\n this._displayName = \"DestinationNode\";\n }\n\n _render(){\n let gl = this._gl; \n\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n gl.enable(gl.BLEND);\n gl.clearColor(0, 0, 0, 0.0); // green;\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n this.inputs.forEach((node)=>{\n super._render();\n //map the input textures input the node\n var texture = node._texture;\n let textureOffset = 0;\n\n for(let mapping of this._inputTextureUnitMapping ){\n gl.activeTexture(mapping.textureUnit);\n let textureLocation = gl.getUniformLocation(this._program, mapping.name);\n gl.uniform1i(textureLocation, this._parameterTextureCount + textureOffset);\n textureOffset += 1;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n }\n\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n });\n }\n}\n\nexport default DestinationNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/DestinationNode/destinationnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport ProcessingNode from \"./processingnode\";\nimport { createElementTexutre } from \"../utils.js\";\n\nclass EffectNode extends ProcessingNode{\n /**\n * Initialise an instance of an EffectNode. You should not instantiate this directly, but use VideoContest.createEffectNode().\n */\n constructor(gl, renderGraph, definition){\n let placeholderTexture = createElementTexutre(gl);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));\n\n super(gl, renderGraph, definition, definition.inputs, true);\n \n this._placeholderTexture = placeholderTexture;\n this._displayName = \"EffectNode\";\n }\n \n _render(){\n let gl = this._gl;\n gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this._texture,0);\n gl.clearColor(0, 0, 0, 0); // green;\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n super._render();\n\n let inputs = this._renderGraph.getInputsForNode(this);\n let textureOffset = 0;\n\n for (var i = 0; i < this._inputTextureUnitMapping.length; i++) {\n let inputTexture = this._placeholderTexture; \n let textureUnit = this._inputTextureUnitMapping[i].textureUnit;\n let textureName = this._inputTextureUnitMapping[i].name;\n if (i < inputs.length && inputs[i] !== undefined){\n inputTexture = inputs[i]._texture;\n }\n\n gl.activeTexture(textureUnit);\n let textureLocation = gl.getUniformLocation(this._program, textureName);\n gl.uniform1i(textureLocation, this._parameterTextureCount + textureOffset);\n textureOffset += 1;\n gl.bindTexture(gl.TEXTURE_2D, inputTexture);\n }\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n}\n\nexport default EffectNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ProcessingNodes/effectnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport EffectNode from \"./effectnode\";\n\nclass TransitionNode extends EffectNode{\n /**\n * Initialise an instance of a TransitionNode. You should not instantiate this directly, but use VideoContest.createTransitonNode().\n */\n constructor(gl, renderGraph, definition){\n super(gl, renderGraph, definition);\n this._transitions = {};\n \n //save a version of the original property values\n this._initialPropertyValues = {};\n for (let propertyName in this._properties){\n this._initialPropertyValues[propertyName] = this._properties[propertyName].value;\n }\n this._displayName = \"TransitionNode\";\n }\n\n _doesTransitionFitOnTimeline(testTransition){\n if (this._transitions[testTransition.property] === undefined) return true;\n for (let transition of this._transitions[testTransition.property]) {\n if (testTransition.start > transition.start && testTransition.start < transition.end)return false;\n if (testTransition.end > transition.start && testTransition.end < transition.end)return false;\n if(transition.start > testTransition.start && transition.start < testTransition.end) return false;\n if(transition.end > testTransition.start && transition.end < testTransition.end) return false;\n }\n return true;\n }\n\n _insertTransitionInTimeline(transition){\n if (this._transitions[transition.property] === undefined) this._transitions[transition.property] = [];\n this._transitions[transition.property].push(transition);\n\n this._transitions[transition.property].sort(function(a,b){\n return a.start - b.start;\n });\n }\n\n /**\n * Create a transition on the timeline.\n * \n * @param {number} startTime - The time at which the transition should start (relative to currentTime of video context).\n * @param {number} endTime - The time at which the transition should be completed by (relative to currentTime of video context).\n * @param {number} currentValue - The value to start the transition at.\n * @param {number} targetValue - The value to transition to by endTime.\n * @param {String} propertyName - The name of the property to clear transitions on, if undefined default to \"mix\".\n * \n * @return {Boolean} returns True if a transition is successfully added, false otherwise.\n */\n transition(startTime, endTime, currentValue, targetValue, propertyName=\"mix\"){\n let transition = {start:startTime + this._currentTime, end:endTime + this._currentTime, current:currentValue, target:targetValue, property:propertyName};\n if (!this._doesTransitionFitOnTimeline(transition))return false;\n this._insertTransitionInTimeline(transition);\n return true;\n }\n\n\n /**\n * Create a transition on the timeline at an absolute time.\n * \n * @param {number} startTime - The time at which the transition should start (relative to time 0).\n * @param {number} endTime - The time at which the transition should be completed by (relative to time 0).\n * @param {number} currentValue - The value to start the transition at.\n * @param {number} targetValue - The value to transition to by endTime.\n * @param {String} propertyName - The name of the property to clear transitions on, if undefined default to \"mix\".\n * \n * @return {Boolean} returns True if a transition is successfully added, false otherwise.\n */\n transitionAt(startTime, endTime, currentValue, targetValue, propertyName=\"mix\"){\n let transition = {start:startTime, end:endTime, current:currentValue, target:targetValue, property:propertyName};\n if (!this._doesTransitionFitOnTimeline(transition))return false;\n this._insertTransitionInTimeline(transition);\n return true;\n }\n\n /**\n * Clear all transistions on the passed property. If no property is defined clear all transitions on the node.\n * \n * @param {String} propertyName - The name of the property to clear transitions on, if undefined clear all transitions on the node.\n */\n clearTransitions(propertyName){\n if (propertyName === undefined){\n this._transitions = {};\n }else{\n this._transitions[propertyName] = [];\n }\n }\n \n /**\n * Clear a transistion on the passed property that the specified time lies within.\n * \n * @param {String} propertyName - The name of the property to clear a transition on.\n * @param {number} time - A time which lies within the property you're trying to clear.\n *\n * @return {Boolean} returns True if a transition is removed, false otherwise.\n */\n clearTransition(propertyName, time){\n let transitionIndex = undefined;\n for (var i = 0; i < this._transitions[propertyName].length; i++) {\n let transition = this._transitions[propertyName][i];\n if (time > transition.start && time < transition.end){\n transitionIndex = i;\n }\n }\n if(transitionIndex !== undefined){\n this._transitions[propertyName].splice(transitionIndex, 1);\n return true;\n }\n return false;\n }\n\n _update(currentTime){\n super._update(currentTime);\n for (let propertyName in this._transitions){\n let value = this[propertyName];\n if (this._transitions[propertyName].length > 0){\n value = this._transitions[propertyName][0].current;\n }\n let transitionActive = false;\n\n for (var i = 0; i < this._transitions[propertyName].length; i++) {\n let transition = this._transitions[propertyName][i];\n if (currentTime > transition.end){\n value = transition.target;\n continue;\n }\n\n if (currentTime > transition.start && currentTime < transition.end){\n let difference = transition.target - transition.current;\n let progress = (this._currentTime - transition.start)/(transition.end - transition.start);\n transitionActive = true;\n this[propertyName] = transition.current + (difference * progress);\n break;\n }\n }\n\n if(!transitionActive)this[propertyName] = value;\n }\n }\n}\n\nexport default TransitionNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ProcessingNodes/transitionnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport { ConnectException } from \"./exceptions.js\";\n\n\nclass RenderGraph {\n /**\n * Manages the rendering graph.\n */\n constructor(){\n this.connections = [];\n }\n\n /**\n * Get a list of nodes which are connected to the output of the passed node.\n * \n * @param {GraphNode} node - the node to get the outputs for.\n * @return {GraphNode[]} An array of the nodes which are connected to the output.\n */\n getOutputsForNode(node){\n let results = [];\n this.connections.forEach(function(connection){\n if (connection.source === node){\n results.push(connection.destination);\n }\n });\n return results;\n }\n \n /**\n * Get a list of nodes which are connected, by input name, to the given node. Array contains objects of the form: {\"source\":sourceNode, \"type\":\"name\", \"name\":inputName, \"destination\":destinationNode}.\n *\n * @param {GraphNode} node - the node to get the named inputs for.\n * @return {Object[]} An array of objects representing the nodes and connection type, which are connected to the named inputs for the node.\n */\n getNamedInputsForNode(node){\n let results = [];\n this.connections.forEach(function(connection){\n if (connection.destination === node && connection.type === \"name\"){\n results.push(connection);\n }\n });\n return results;\n }\n\n /**\n * Get a list of nodes which are connected, by z-index name, to the given node. Array contains objects of the form: {\"source\":sourceNode, \"type\":\"zIndex\", \"zIndex\":0, \"destination\":destinationNode}.\n * \n * @param {GraphNode} node - the node to get the z-index refernced inputs for.\n * @return {Object[]} An array of objects representing the nodes and connection type, which are connected by z-Index for the node.\n */\n getZIndexInputsForNode(node){\n let results = [];\n this.connections.forEach(function(connection){\n if (connection.destination === node && connection.type === \"zIndex\"){\n results.push(connection);\n }\n });\n results.sort(function(a,b){\n return a.zIndex - b.zIndex;\n });\n return results; \n }\n\n /**\n * Get a list of nodes which are connected as inputs to the given node. The length of the return array is always equal to the number of inputs for the node, with undefined taking the place of any inputs not connected.\n * \n * @param {GraphNode} node - the node to get the inputs for.\n * @return {GraphNode[]} An array of GraphNodes which are connected to the node.\n */\n getInputsForNode(node){\n let inputNames = node.inputNames; \n let results = [];\n let namedInputs = this.getNamedInputsForNode(node);\n let indexedInputs = this.getZIndexInputsForNode(node);\n\n if(node._limitConnections === true){\n for (let i = 0; i < inputNames.length; i++) {\n results[i] = undefined;\n }\n \n for(let connection of namedInputs){\n let index = inputNames.indexOf(connection.name);\n results[index] = connection.source;\n }\n let indexedInputsIndex = 0;\n for (let i = 0; i < results.length; i++) {\n if (results[i] === undefined && indexedInputs[indexedInputsIndex]!== undefined){\n results[i] = indexedInputs[indexedInputsIndex].source;\n indexedInputsIndex += 1;\n }\n }\n }else{\n for(let connection of namedInputs){\n results.push(connection.source);\n }\n for(let connection of indexedInputs){\n results.push(connection.source);\n }\n }\n return results;\n }\n\n /**\n * Check if a named input on a node is available to connect too.\n * @param {GraphNode} node - the node to check.\n * @param {String} inputName - the named input to check.\n */\n isInputAvailable(node, inputName){\n if (node._inputNames.indexOf(inputName) === -1) return false;\n for(let connection of this.connections){\n if (connection.type === \"name\"){\n if (connection.destination === node && connection.name === inputName){\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * Register a connection between two nodes.\n * \n * @param {GraphNode} sourceNode - the node to connect from.\n * @param {GraphNode} destinationNode - the node to connect to.\n * @param {(String | number)} [target] - the target port of the conenction, this could be a string to specfiy a specific named port, a number to specify a port by index, or undefined, in which case the next available port will be connected to.\n * @return {boolean} Will return true if connection succeeds otherwise will throw a ConnectException.\n */\n registerConnection(sourceNode, destinationNode, target){\n if (destinationNode.inputs.length >= destinationNode.inputNames.length && destinationNode._limitConnections === true){\n throw new ConnectException(\"Node has reached max number of inputs, can't connect\");\n }\n \n if (destinationNode._limitConnections === false){\n //check if connection is already made, if so raise a warning\n const inputs = this.getInputsForNode(destinationNode);\n if (inputs.includes(sourceNode)){\n console.debug(\"WARNING - node connected mutliple times, removing previous connection\");\n this.unregisterConnection(sourceNode, destinationNode);\n }\n }\n\n if (typeof target === \"number\"){\n //target is a specific\n this.connections.push({\"source\":sourceNode, \"type\":\"zIndex\", \"zIndex\":target, \"destination\":destinationNode});\n } else if (typeof target === \"string\" && destinationNode._limitConnections){\n //target is a named port\n\n //make sure named port is free\n if (this.isInputAvailable(destinationNode, target)){\n this.connections.push({\"source\":sourceNode, \"type\":\"name\", \"name\":target, \"destination\":destinationNode});\n }else{\n throw new ConnectException(\"Port \"+target+\" is already connected to\");\n }\n\n } else{\n //target is undefined so just make it a high zIndex\n let indexedConns = this.getZIndexInputsForNode(destinationNode);\n let index = 0;\n if (indexedConns.length > 0)index = indexedConns[indexedConns.length-1].zIndex +1;\n this.connections.push({\"source\":sourceNode, \"type\":\"zIndex\", \"zIndex\":index, \"destination\":destinationNode});\n }\n return true;\n }\n \n /**\n * Remove a connection between two nodes.\n * @param {GraphNode} sourceNode - the node to unregsiter connection from.\n * @param {GraphNode} destinationNode - the node to register connection to.\n * @return {boolean} Will return true if removing connection succeeds, or false if there was no connectionsction to remove.\n */\n unregisterConnection(sourceNode, destinationNode){\n let toRemove = [];\n \n this.connections.forEach(function(connection){\n if (connection.source === sourceNode && connection.destination === destinationNode){\n toRemove.push(connection);\n }\n });\n\n if (toRemove.length === 0) return false;\n\n toRemove.forEach((removeNode) => {\n let index = this.connections.indexOf(removeNode);\n this.connections.splice(index, 1);\n });\n\n return true;\n }\n\n static outputEdgesFor(node, connections){\n let results = [];\n for(let conn of connections){\n if (conn.source === node){\n results.push(conn);\n }\n }\n return results;\n }\n\n static inputEdgesFor(node, connections){\n let results = [];\n for(let conn of connections){\n if (conn.destination === node){\n results.push(conn);\n }\n }\n return results;\n }\n\n static getInputlessNodes(connections){\n let inputLess = [];\n for (let conn of connections){\n inputLess.push(conn.source);\n }\n for (let conn of connections){\n let index = inputLess.indexOf(conn.destination);\n if (index !== -1){\n inputLess.splice(index, 1);\n }\n }\n return inputLess;\n }\n}\n\nexport default RenderGraph;\n\n\n\n// WEBPACK FOOTER //\n// ./src/rendergraph.js","function stripHash (url){\n if (url.port === \"\" || url.port === undefined){\n return `${url.protocol}//${url.hostname}${url.pathname}`;\n } else {\n return `${url.protocol}//${url.hostname}:${url.port}${url.pathname}`;\n }\n}\n\nclass VideoElementCache {\n\n constructor(cache_size = 3) {\n this._elements = [];\n this._elementsInitialised = false;\n for (let i = 0; i < cache_size; i++) {\n let element = this._createElement(); \n this._elements.push(element);\n }\n }\n\n\n _createElement(){\n let videoElement = document.createElement(\"video\");\n videoElement.setAttribute(\"crossorigin\", \"anonymous\");\n videoElement.setAttribute(\"webkit-playsinline\", \"\");\n videoElement.setAttribute(\"playsinline\", \"\");\n videoElement.src = \"\";\n return videoElement;\n }\n\n init(){\n if (!this._elementsInitialised){\n for(let element of this._elements){\n try {\n element.play().then(()=>{\n }, (e)=>{\n if (e.name !== \"NotSupportedError\")throw(e);\n });\n } catch(e) {\n //console.log(e.name);\n }\n } \n }\n this._elementsInitialised = true;\n }\n\n get() {\n //Try and get an already intialised element.\n for (let element of this._elements) {\n // For some reason an uninitialised videoElement has its sr attribute set to the windows href. Hence the below check.\n if ((element.src === \"\" || element.src === undefined || element.src === stripHash(window.location)) && element.srcObject == null )return element;\n }\n //Fallback to creating a new element if non exists.\n console.debug(\"No available video element in the cache, creating a new one. This may break mobile, make your initial cache larger.\");\n let element = this._createElement();\n this._elements.push(element);\n this._elementsInitialised = false;\n return element;\n }\n\n get length(){\n return this._elements.length;\n }\n\n get unused(){\n let count = 0;\n for (let element of this._elements) {\n // For some reason an uninitialised videoElement has its sr attribute set to the windows href. Hence the below check.\n if ((element.src === \"\" || element.src === undefined || element.src === stripHash(window.location)) && element.srcObject == null )count += 1;\n }\n return count;\n }\n\n}\n\nexport default VideoElementCache;\n\n\n// WEBPACK FOOTER //\n// ./src/videoelementcache.js"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/api/SourceNodes_canvasnode.js.html b/docs/api/SourceNodes_canvasnode.js.html index 48a03943..d2f90b4f 100644 --- a/docs/api/SourceNodes_canvasnode.js.html +++ b/docs/api/SourceNodes_canvasnode.js.html @@ -43,7 +43,7 @@

Source: SourceNodes/canvasnode.js

_load(){ super._load(); this._ready = true; - this._triggerCallbacks("loaded"); + this._triggerCallbacks("loaded"); } _unload(){ @@ -61,11 +61,11 @@

Source: SourceNodes/canvasnode.js

this._unload(); } } - + _update(currentTime){ //if (!super._update(currentTime)) return false; super._update(currentTime); - if (this._startTime - this._currentTime < this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load(); + if (this._startTime - this._currentTime <= this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load(); if (this._state === SOURCENODESTATE.playing){ return true; diff --git a/docs/api/SourceNodes_imagenode.js.html b/docs/api/SourceNodes_imagenode.js.html index 49072a50..fdceb403 100644 --- a/docs/api/SourceNodes_imagenode.js.html +++ b/docs/api/SourceNodes_imagenode.js.html @@ -108,8 +108,8 @@

Source: SourceNodes/imagenode.js

}else{ super._update(currentTime); } - - if (this._startTime - this._currentTime < this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load(); + + if (this._startTime - this._currentTime <= this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load(); if (this._state === SOURCENODESTATE.playing){ return true; diff --git a/docs/dist/videocontext.js b/docs/dist/videocontext.js index ce45d505..b9aeaa08 100644 --- a/docs/dist/videocontext.js +++ b/docs/dist/videocontext.js @@ -4609,7 +4609,7 @@ return /******/ (function(modules) { // webpackBootstrap _get(Object.getPrototypeOf(ImageNode.prototype), "_update", this).call(this, currentTime); } - if (this._startTime - this._currentTime < this._preloadTime && this._state !== _sourcenode.SOURCENODESTATE.waiting && this._state !== _sourcenode.SOURCENODESTATE.ended) this._load(); + if (this._startTime - this._currentTime <= this._preloadTime && this._state !== _sourcenode.SOURCENODESTATE.waiting && this._state !== _sourcenode.SOURCENODESTATE.ended) this._load(); if (this._state === _sourcenode.SOURCENODESTATE.playing) { return true; @@ -4706,7 +4706,7 @@ return /******/ (function(modules) { // webpackBootstrap value: function _update(currentTime) { //if (!super._update(currentTime)) return false; _get(Object.getPrototypeOf(CanvasNode.prototype), "_update", this).call(this, currentTime); - if (this._startTime - this._currentTime < this._preloadTime && this._state !== _sourcenode.SOURCENODESTATE.waiting && this._state !== _sourcenode.SOURCENODESTATE.ended) this._load(); + if (this._startTime - this._currentTime <= this._preloadTime && this._state !== _sourcenode.SOURCENODESTATE.waiting && this._state !== _sourcenode.SOURCENODESTATE.ended) this._load(); if (this._state === _sourcenode.SOURCENODESTATE.playing) { return true; diff --git a/docs/dist/videocontext.js.map b/docs/dist/videocontext.js.map index 372e715b..919381d6 100644 --- a/docs/dist/videocontext.js.map +++ b/docs/dist/videocontext.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 6a234b9f0d7948648942","webpack:///./src/videocontext.js","webpack:///./src/SourceNodes/videonode.js","webpack:///./src/SourceNodes/sourcenode.js","webpack:///./src/utils.js","webpack:///./src/Definitions/definitions.js","webpack:///./src/Definitions/aaf_video_scale.js","webpack:///./src/Definitions/crossfade.js","webpack:///./src/Definitions/horizontalWipe.js","webpack:///./src/Definitions/verticalWipe.js","webpack:///./src/Definitions/randomDissolve.js","webpack:///./src/Definitions/toColorAndBackFade.js","webpack:///./src/Definitions/starWipe.js","webpack:///./src/Definitions/combine.js","webpack:///./src/Definitions/colorThreshold.js","webpack:///./src/Definitions/monochrome.js","webpack:///./src/Definitions/horizontalBlur.js","webpack:///./src/Definitions/verticalBlur.js","webpack:///./src/Definitions/aaf_video_flop.js","webpack:///./src/Definitions/aaf_video_flip.js","webpack:///./src/Definitions/aaf_video_position.js","webpack:///./src/Definitions/aaf_video_crop.js","webpack:///./src/Definitions/staticDissolve.js","webpack:///./src/Definitions/staticEffect.js","webpack:///./src/Definitions/dreamfade.js","webpack:///./src/Definitions/opacity.js","webpack:///./src/Definitions/crop.js","webpack:///./src/graphnode.js","webpack:///./src/SourceNodes/imagenode.js","webpack:///./src/SourceNodes/canvasnode.js","webpack:///./src/ProcessingNodes/compositingnode.js","webpack:///./src/ProcessingNodes/processingnode.js","webpack:///./src/exceptions.js","webpack:///./src/DestinationNode/destinationnode.js","webpack:///./src/ProcessingNodes/effectnode.js","webpack:///./src/ProcessingNodes/transitionnode.js","webpack:///./src/rendergraph.js","webpack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,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,QAAO,CAAC,SAAS,IAAI,IAAI,EAAE,OAAO,QAAO,CAAC;kBACpJ;;;;;;;;;;;;;;;;;AAED,oBAAO,CAAC,KAAK,CAAC,qHAAqH,CAAC,CAAC;AACrI,iBAAI,OAAO,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;AACpC,iBAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC7B,iBAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;AAClC,oBAAO,OAAO,CAAC;UAClB;;;cAES,eAAE;AACR,oBAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;UAChC;;;cAES,eAAE;AACR,iBAAI,KAAK,GAAG,CAAC,CAAC;;;;;;AACd,uCAAoB,IAAI,CAAC,SAAS,mIAAE;yBAA3B,OAAO;;;AAEZ,yBAAI,CAAC,OAAO,CAAC,GAAG,KAAK,EAAE,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAM,OAAO,CAAC,SAAS,IAAI,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC;kBACjJ;;;;;;;;;;;;;;;;AACD,oBAAO,KAAK,CAAC;UAChB;;;YA9DC,iBAAiB;;;sBAkER,iBAAiB","file":"videocontext.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VideoContext\"] = factory();\n\telse\n\t\troot[\"VideoContext\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 6a234b9f0d7948648942","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport VideoNode from \"./SourceNodes/videonode.js\";\nimport ImageNode from \"./SourceNodes/imagenode.js\";\nimport CanvasNode from \"./SourceNodes/canvasnode.js\";\nimport { SOURCENODESTATE } from \"./SourceNodes/sourcenode.js\";\nimport CompositingNode from \"./ProcessingNodes/compositingnode.js\";\nimport DestinationNode from \"./DestinationNode/destinationnode.js\";\nimport EffectNode from \"./ProcessingNodes/effectnode.js\";\nimport TransitionNode from \"./ProcessingNodes/transitionnode.js\";\nimport RenderGraph from \"./rendergraph.js\";\nimport VideoElementCache from \"./videoelementcache.js\";\nimport { createSigmaGraphDataFromRenderGraph, visualiseVideoContextTimeline, visualiseVideoContextGraph, createControlFormForNode, UpdateablesManager, exportToJSON, importSimpleEDL, snapshot, generateRandomId } from \"./utils.js\";\nimport DEFINITIONS from \"./Definitions/definitions.js\";\n\nlet updateablesManager = new UpdateablesManager();\n\n/**\n * VideoContext.\n * @module VideoContext\n */\nexport default class VideoContext{\n /**\n * 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.\n *\n * @param {Canvas} canvas - the canvas element to render the output to.\n * @param {function} initErrorCallback - a callback for if initialising the canvas failed.\n * @param {Object} options - a nuber of custom options which can be set on the VideoContext, generally best left as default.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement, function(){console.error(\"Sorry, your browser dosen\\'t support WebGL\");});\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(10);\n * ctx.play();\n *\n */\n constructor(canvas, initErrorCallback, options={\"preserveDrawingBuffer\":true, \"manualUpdate\":false, \"endOnLastSourceEnd\":true, useVideoElementCache:true, videoElementCacheSize:6, webglContextAttributes: {preserveDrawingBuffer: true, alpha: false }}){\n this._canvas = canvas;\n let manualUpdate = false;\n this.endOnLastSourceEnd = true;\n let webglContextAttributes = {preserveDrawingBuffer: true, alpha: false };\n\n if (\"manualUpdate\" in options) manualUpdate = options.manualUpdate;\n if (\"endOnLastSourceEnd\" in options) this._endOnLastSourceEnd = options.endOnLastSourceEnd;\n if (\"webglContextAttributes\" in options) webglContextAttributes = options.webglContextAttributes;\n\n if (webglContextAttributes.alpha === undefined) webglContextAttributes.alpha = false;\n if (webglContextAttributes.alpha === true){\n console.error(\"webglContextAttributes.alpha must be false for correct opeation\");\n }\n\n\n this._gl = canvas.getContext(\"experimental-webgl\", webglContextAttributes);\n if(this._gl === null){\n console.error(\"Failed to intialise WebGL.\");\n if(initErrorCallback)initErrorCallback();\n return;\n }\n\n // Initialise the video element cache\n if(options.useVideoElementCache === undefined) options.useVideoElementCache = true;\n this._useVideoElementCache = options.useVideoElementCache;\n if (this._useVideoElementCache){\n if (!options.videoElementCacheSize) options.videoElementCacheSize = 5;\n this._videoElementCache = new VideoElementCache(options.videoElementCacheSize);\n }\n \n // Create a unique ID for this VideoContext which can be used in the debugger.\n if(this._canvas.id) {\n if (typeof this._canvas.id === \"string\" || this._canvas.id instanceof String){\n this._id = canvas.id;\n }\n }\n if(this._id === undefined) this._id = generateRandomId();\n if (window.__VIDEOCONTEXT_REFS__ === undefined) window.__VIDEOCONTEXT_REFS__ = {};\n window.__VIDEOCONTEXT_REFS__[this._id] = this;\n\n\n this._renderGraph = new RenderGraph();\n this._sourceNodes = [];\n this._processingNodes = [];\n this._timeline = [];\n this._currentTime = 0;\n this._state = VideoContext.STATE.PAUSED;\n this._playbackRate = 1.0;\n this._volume = 1.0;\n this._sourcesPlaying = undefined;\n this._destinationNode = new DestinationNode(this._gl, this._renderGraph);\n\n this._callbacks = new Map();\n this._callbacks.set(\"stalled\", []);\n this._callbacks.set(\"update\", []);\n this._callbacks.set(\"ended\", []);\n this._callbacks.set(\"content\", []);\n this._callbacks.set(\"nocontent\", []);\n\n this._timelineCallbacks = [];\n\n if(!manualUpdate){\n updateablesManager.register(this);\n }\n }\n\n /**\n * Reurns an ID assigned to the VideoContext instance. This will either be the same id as the underlying canvas element,\n * or a uniquley generated one.\n */\n get id(){\n return this._id;\n }\n\n /**\n * Set the ID of the VideoContext instance. This should be unique.\n */\n set id(newID){\n delete window.__VIDEOCONTEXT_REFS__[this._id];\n if (window.__VIDEOCONTEXT_REFS__[newID] !== undefined) console.warn(\"Warning; setting id to that of an existing VideoContext instance.\");\n window.__VIDEOCONTEXT_REFS__[newID] = this;\n this._id = newID;\n }\n\n /**\n * Register a callback to happen at a specific point in time.\n * @param {number} time - the time at which to trigger the callback.\n * @param {Function} func - the callback to register.\n * @param {number} ordering - the order in which to call the callback if more than one is registered for the same time.\n */\n registerTimelineCallback(time, func, ordering= 0){\n this._timelineCallbacks.push({\"time\":time, \"func\":func, \"ordering\":ordering});\n }\n\n\n /**\n * Unregister a callback which happens at a specific point in time.\n * @param {Function} func - the callback to unregister.\n */\n unregisterTimelineCallback(func){\n let toRemove = [];\n for(let callback of this._timelineCallbacks){\n if (callback.func === func){\n toRemove.push(callback);\n }\n }\n for (let callback of toRemove){\n let index = this._timelineCallbacks.indexOf(callback);\n this._timelineCallbacks.splice(index, 1);\n }\n }\n\n /**\n * Regsiter a callback to listen to one of the following events: \"stalled\", \"update\", \"ended\", \"content\", \"nocontent\"\n *\n * \"stalled\" happend anytime playback is stopped due to unavailbale data for playing assets (i.e video still loading)\n * . \"update\" is called any time a frame is rendered to the screen. \"ended\" is called once plackback has finished\n * (i.e ctx.currentTime == ctx.duration). \"content\" is called a the start of a time region where there is content\n * playing out of one or more sourceNodes. \"nocontent\" is called at the start of any time region where the\n * VideoContext is still playing, but there are currently no activly playing soureces.\n *\n * @param {String} type - the event to register against (\"stalled\", \"update\", or \"ended\").\n * @param {Function} func - the callback to register.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * ctx.registerCallback(\"stalled\", function(){console.log(\"Playback stalled\");});\n * ctx.registerCallback(\"update\", function(){console.log(\"new frame\");});\n * ctx.registerCallback(\"ended\", function(){console.log(\"Playback ended\");});\n */\n registerCallback(type, func){\n if (!this._callbacks.has(type)) return false;\n this._callbacks.get(type).push(func);\n }\n\n /**\n * Remove a previously registed callback\n *\n * @param {Function} func - the callback to remove.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n *\n * //the callback\n * var updateCallback = function(){console.log(\"new frame\")};\n *\n * //register the callback\n * ctx.registerCallback(\"update\", updateCallback);\n * //then unregister it\n * ctx.unregisterCallback(updateCallback);\n *\n */\n unregisterCallback(func){\n for(let funcArray of this._callbacks.values()){\n let index = funcArray.indexOf(func);\n if (index !== -1){\n funcArray.splice(index, 1);\n return true;\n }\n }\n return false;\n }\n\n _callCallbacks(type){\n let funcArray = this._callbacks.get(type);\n for (let func of funcArray){\n func(this._currentTime);\n }\n }\n\n /**\n * Get the canvas that the VideoContext is using.\n *\n * @return {HTMLElement} The canvas that the VideoContext is using.\n *\n */\n get element(){\n return this._canvas;\n }\n\n /**\n * Get the current state.\n *\n * This will be either\n * - VideoContext.STATE.PLAYING: current sources on timeline are active\n * - VideoContext.STATE.PAUSED: all sources are paused\n * - VideoContext.STATE.STALLED: one or more sources is unable to play\n * - VideoContext.STATE.ENDED: all sources have finished playing\n * - VideoContext.STATE.BROKEN: the render graph is in a broken state\n * @return {number} The number representing the state.\n *\n */\n get state(){\n return this._state;\n }\n\n /**\n * Set the progress through the internal timeline.\n * Setting this can be used as a way to implement a scrubaable timeline.\n *\n * @param {number} currentTime - this is the currentTime to set the context to.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(20);\n * ctx.currentTime = 10; // seek 10 seconds in\n * ctx.play();\n *\n */\n set currentTime(currentTime){\n if (currentTime < this.duration && this._state === VideoContext.STATE.ENDED) this._state = VideoContext.STATE.PAUSED;\n\n if (typeof currentTime === \"string\" || currentTime instanceof String){\n currentTime = parseFloat(currentTime);\n }\n\n for (let i = 0; i < this._sourceNodes.length; i++) {\n this._sourceNodes[i]._seek(currentTime);\n }\n for (let i = 0; i < this._processingNodes.length; i++) {\n this._processingNodes[i]._seek(currentTime);\n }\n this._currentTime = currentTime;\n }\n\n /**\n * Get how far through the internal timeline has been played.\n *\n * Getting this value will give the current playhead position. Can be used for updating timelines.\n * @return {number} The time in seconds through the current playlist.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(10);\n * ctx.play();\n * setTimeout(function(){console.log(ctx.currentTime);},1000); //should print roughly 1.0\n *\n */\n get currentTime(){\n return this._currentTime;\n }\n\n /**\n * Get the time at which the last node in the current internal timeline finishes playing.\n *\n * @return {number} The end time in seconds of the last video node to finish playing.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * console.log(ctx.duration); //prints 0\n *\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(10);\n *\n * console.log(ctx.duration); //prints 10\n *\n * ctx.play();\n */\n get duration(){\n let maxTime = 0;\n for (let i = 0; i < this._sourceNodes.length; i++) {\n if (this._sourceNodes[i].state !== SOURCENODESTATE.waiting &&this._sourceNodes[i]._stopTime > maxTime){\n maxTime = this._sourceNodes[i]._stopTime;\n }\n }\n return maxTime;\n }\n\n\n /**\n * Get the final node in the render graph which represents the canvas to display content on to.\n *\n * This proprety is read-only and there can only ever be one destination node. Other nodes can connect to this but you cannot connect this node to anything.\n *\n * @return {DestinationNode} A graph node represnting the canvas to display the content on.\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.start(0);\n * videoNode.stop(10);\n * videoNode.connect(ctx.destination);\n *\n */\n get destination(){\n return this._destinationNode;\n }\n\n /**\n * Set the playback rate of the VideoContext instance.\n * This will alter the playback speed of all media elements played through the VideoContext.\n *\n * @param {number} rate - this is the playback rate.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.start(0);\n * videoNode.stop(10);\n * videoNode.connect(ctx.destination);\n * ctx.playbackRate = 2;\n * ctx.play(); // Double playback rate means this will finish playing in 5 seconds.\n */\n set playbackRate(rate){\n if (rate <= 0){\n throw new RangeError(\"playbackRate must be greater than 0\");\n }\n for (let node of this._sourceNodes) {\n if (node.constructor.name === \"VideoNode\"){\n node._globalPlaybackRate = rate;\n node._playbackRateUpdated = true;\n }\n }\n this._playbackRate = rate;\n }\n\n\n /**\n * Return the current playbackRate of the video context.\n * @return {number} A value representing the playbackRate. 1.0 by default.\n */\n get playbackRate(){\n return this._playbackRate;\n }\n\n\n /**\n * Set the volume of all VideoNode's created in the VideoContext.\n * @param {number} volume - the volume to apply to the video nodes.\n */\n set volume(vol){\n for (let node of this._sourceNodes){\n if(node instanceof VideoNode){\n node.volume = vol;\n }\n }\n this._volume = vol;\n }\n\n /**\n * Return the current volume of the video context.\n * @return {number} A value representing the volume. 1.0 by default.\n */\n get volume(){\n return this._volume;\n }\n\n /**\n * Start the VideoContext playing\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(10);\n * ctx.play();\n */\n play(){\n console.debug(\"VideoContext - playing\");\n //Initialise the video elemnt cache\n if (this._videoElementCache)this._videoElementCache.init();\n // set the state.\n this._state = VideoContext.STATE.PLAYING;\n return true;\n }\n\n /**\n * Pause playback of the VideoContext\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(20);\n * ctx.currentTime = 10; // seek 10 seconds in\n * ctx.play();\n * setTimeout(function(){ctx.pause();}, 1000); //pause playback after roughly one second.\n */\n pause(){\n console.debug(\"VideoContext - pausing\");\n this._state = VideoContext.STATE.PAUSED;\n return true;\n }\n\n\n /**\n * Create a new node representing a video source\n *\n * @param {string|Video} - The URL or video element to create the video from.\n * @sourceOffset {number} - Offset into the start of the source video to start playing from.\n * @preloadTime {number} - How many seconds before the video is to be played to start loading it.\n * @videoElementAttributes {Object} - A dictionary of attributes to map onto the underlying video element.\n * @return {VideoNode} A new video node.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var videoElement = document.getElementById(\"video\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(videoElement);\n */\n video(src, sourceOffset=0, preloadTime=4, videoElementAttributes={}){\n let videoNode = new VideoNode(src, this._gl, this._renderGraph, this._currentTime, this._playbackRate, sourceOffset, preloadTime, this._videoElementCache, videoElementAttributes);\n this._sourceNodes.push(videoNode);\n return videoNode;\n }\n\n /**\n * @depricated\n */\n createVideoSourceNode(src, sourceOffset=0, preloadTime=4, videoElementAttributes={}){\n this._depricate(\"Warning: createVideoSourceNode will be depricated in v1.0, please switch to using VideoContext.video()\");\n return this.video(src, sourceOffset, preloadTime, videoElementAttributes);\n }\n\n\n /**\n * Create a new node representing an image source\n * @param {string|Image} src - The url or image element to create the image node from.\n * @param {number} [preloadTime] - How long before a node is to be displayed to attmept to load it.\n * @param {Object} [imageElementAttributes] - Any attributes to be given to the underlying image element.\n * @return {ImageNode} A new image node.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var imageNode = ctx.image(\"image.png\");\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var imageElement = document.getElementById(\"image\");\n * var ctx = new VideoContext(canvasElement);\n * var imageNode = ctx.image(imageElement);\n */\n image(src, preloadTime=4, imageElementAttributes={}){\n let imageNode = new ImageNode(src, this._gl, this._renderGraph, this._currentTime, preloadTime, imageElementAttributes);\n this._sourceNodes.push(imageNode);\n return imageNode;\n }\n\n /**\n * @depricated\n */\n createImageSourceNode(src, sourceOffset=0, preloadTime=4, imageElementAttributes={}){\n this._depricate(\"Warning: createImageSourceNode will be depricated in v1.0, please switch to using VideoContext.image()\");\n return this.image(src, sourceOffset, preloadTime, imageElementAttributes);\n }\n\n\n /**\n * Create a new node representing a canvas source\n * @param {Canvas} src - The canvas element to create the canvas node from.\n * @return {CanvasNode} A new canvas node.\n */\n canvas(canvas){\n let canvasNode = new CanvasNode(canvas, this._gl, this._renderGraph, this._currentTime);\n this._sourceNodes.push(canvasNode);\n return canvasNode;\n }\n\n /**\n * @depricated\n */\n createCanvasSourceNode(canvas, sourceOffset=0, preloadTime=4){\n this._depricate(\"Warning: createCanvasSourceNode will be depricated in v1.0, please switch to using VideoContext.canvas()\");\n return this.canvas(canvas, sourceOffset, preloadTime);\n }\n\n\n /**\n * Create a new effect node.\n * @param {Object} definition - this is an object defining the shaders, inputs, and properties of the compositing node to create. Builtin definitions can be found by accessing VideoContext.DEFINITIONS.\n * @return {EffectNode} A new effect node created from the passed definition\n */\n effect(definition){\n let effectNode = new EffectNode(this._gl, this._renderGraph, definition);\n this._processingNodes.push(effectNode);\n return effectNode;\n }\n\n /**\n * @depricated\n */\n createEffectNode(definition){\n this._depricate(\"Warning: createEffectNode will be depricated in v1.0, please switch to using VideoContext.effect()\");\n return this.effect(definition);\n }\n\n /**\n * Create a new compositiing node.\n *\n * Compositing nodes are used for operations such as combining multiple video sources into a single track/connection for further processing in the graph.\n *\n * A compositing node is slightly different to other processing nodes in that it only has one input in it's definition but can have unlimited connections made to it.\n * The shader in the definition is run for each input in turn, drawing them to the output buffer. This means there can be no interaction between the spearte inputs to a compositing node, as they are individually processed in seperate shader passes.\n *\n * @param {Object} definition - this is an object defining the shaders, inputs, and properties of the compositing node to create. Builtin definitions can be found by accessing VideoContext.DEFINITIONS\n *\n * @return {CompositingNode} A new compositing node created from the passed definition.\n *\n * @example\n *\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n *\n * //A simple compositing node definition which just renders all the inputs to the output buffer.\n * var combineDefinition = {\n * vertexShader : \"\\\n * attribute vec2 a_position;\\\n * attribute vec2 a_texCoord;\\\n * varying vec2 v_texCoord;\\\n * void main() {\\\n * gl_Position = vec4(vec2(2.0,2.0)*vec2(1.0, 1.0), 0.0, 1.0);\\\n * v_texCoord = a_texCoord;\\\n * }\",\n * fragmentShader : \"\\\n * precision mediump float;\\\n * uniform sampler2D u_image;\\\n * uniform float a;\\\n * varying vec2 v_texCoord;\\\n * varying float v_progress;\\\n * void main(){\\\n * vec4 color = texture2D(u_image, v_texCoord);\\\n * gl_FragColor = color;\\\n * }\",\n * properties:{\n * \"a\":{type:\"uniform\", value:0.0},\n * },\n * inputs:[\"u_image\"]\n * };\n * //Create the node, passing in the definition.\n * var trackNode = videoCtx.compositor(combineDefinition);\n *\n * //create two videos which will play at back to back\n * var videoNode1 = ctx.video(\"video1.mp4\");\n * videoNode1.play(0);\n * videoNode1.stop(10);\n * var videoNode2 = ctx.video(\"video2.mp4\");\n * videoNode2.play(10);\n * videoNode2.stop(20);\n *\n * //Connect the nodes to the combine node. This will give a single connection representing the two videos which can\n * //be connected to other effects such as LUTs, chromakeyers, etc.\n * videoNode1.connect(trackNode);\n * videoNode2.connect(trackNode);\n *\n * //Don't do anything exciting, just connect it to the output.\n * trackNode.connect(ctx.destination);\n *\n */\n compositor(definition){\n let compositingNode = new CompositingNode(this._gl, this._renderGraph, definition);\n this._processingNodes.push(compositingNode);\n return compositingNode;\n }\n\n /**\n * @depricated\n */\n createCompositingNode(definition){\n this._depricate(\"Warning: createCompositingNode will be depricated in v1.0, please switch to using VideoContext.compositor()\");\n return this.compositor(definition);\n }\n\n\n\n /**\n * Create a new transition node.\n *\n * Transistion nodes are a type of effect node which have parameters which can be changed as events on the timeline.\n *\n * For example a transition node which cross-fades between two videos could have a \"mix\" property which sets the\n * progress through the transistion. Rather than having to write your own code to adjust this property at specfic\n * points in time a transition node has a \"transition\" function which takes a startTime, stopTime, targetValue, and a\n * propertyName (which will be \"mix\"). This will linearly interpolate the property from the curernt value to\n * tragetValue between the startTime and stopTime.\n *\n * @param {Object} definition - this is an object defining the shaders, inputs, and properties of the transition node to create.\n * @return {TransitionNode} A new transition node created from the passed definition.\n * @example\n *\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n *\n * //A simple cross-fade node definition which cross-fades between two videos based on the mix property.\n * var crossfadeDefinition = {\n * vertexShader : \"\\\n * attribute vec2 a_position;\\\n * attribute vec2 a_texCoord;\\\n * varying vec2 v_texCoord;\\\n * void main() {\\\n * gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n * v_texCoord = a_texCoord;\\\n * }\",\n * fragmentShader : \"\\\n * precision mediump float;\\\n * uniform sampler2D u_image_a;\\\n * uniform sampler2D u_image_b;\\\n * uniform float mix;\\\n * varying vec2 v_texCoord;\\\n * varying float v_mix;\\\n * void main(){\\\n * vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n * vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n * color_a[0] *= mix;\\\n * color_a[1] *= mix;\\\n * color_a[2] *= mix;\\\n * color_a[3] *= mix;\\\n * color_b[0] *= (1.0 - mix);\\\n * color_b[1] *= (1.0 - mix);\\\n * color_b[2] *= (1.0 - mix);\\\n * color_b[3] *= (1.0 - mix);\\\n * gl_FragColor = color_a + color_b;\\\n * }\",\n * properties:{\n * \"mix\":{type:\"uniform\", value:0.0},\n * },\n * inputs:[\"u_image_a\",\"u_image_b\"]\n * };\n *\n * //Create the node, passing in the definition.\n * var transitionNode = videoCtx.transition(crossfadeDefinition);\n *\n * //create two videos which will overlap by two seconds\n * var videoNode1 = ctx.video(\"video1.mp4\");\n * videoNode1.play(0);\n * videoNode1.stop(10);\n * var videoNode2 = ctx.video(\"video2.mp4\");\n * videoNode2.play(8);\n * videoNode2.stop(18);\n *\n * //Connect the nodes to the transistion node.\n * videoNode1.connect(transitionNode);\n * videoNode2.connect(transitionNode);\n *\n * //Set-up a transition which happens at the crossover point of the playback of the two videos\n * transitionNode.transition(8,10,1.0,\"mix\");\n *\n * //Connect the transition node to the output\n * transitionNode.connect(ctx.destination);\n *\n * //start playback\n * ctx.play();\n */\n transition(definition){\n let transitionNode = new TransitionNode(this._gl, this._renderGraph, definition);\n this._processingNodes.push(transitionNode);\n return transitionNode;\n }\n\n /**\n * @depricated\n */\n createTransitionNode(definition){\n this._depricate(\"Warning: createTransitionNode will be depricated in v1.0, please switch to using VideoContext.transition()\");\n return this.transition(definition);\n }\n\n\n\n\n _isStalled(){\n for (let i = 0; i < this._sourceNodes.length; i++) {\n let sourceNode = this._sourceNodes[i];\n if (!sourceNode._isReady()){\n return true;\n }\n }\n return false;\n }\n\n\n /**\n * This allows manual calling of the update loop of the videoContext.\n *\n * @param {Number} dt - The difference in seconds between this and the previous calling of update.\n * @example\n *\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement, undefined, {\"manualUpdate\" : true});\n *\n * var previousTime;\n * function update(time){\n * if (previousTime === undefined) previousTime = time;\n * var dt = (time - previousTime)/1000;\n * ctx.update(dt);\n * previousTime = time;\n * requestAnimationFrame(update);\n * }\n * update();\n *\n */\n update(dt){\n this._update(dt);\n }\n\n\n _update(dt){\n //Remove any destroyed nodes\n this._sourceNodes = this._sourceNodes.filter(sourceNode=>{\n if (!sourceNode.destroyed) return sourceNode;\n });\n\n this._processingNodes = this._processingNodes.filter(processingNode=>{\n if (!processingNode.destroyed) return processingNode;\n });\n\n\n if (this._state === VideoContext.STATE.PLAYING || this._state === VideoContext.STATE.STALLED || this._state === VideoContext.STATE.PAUSED) {\n this._callCallbacks(\"update\");\n\n if (this._state !== VideoContext.STATE.PAUSED){\n if (this._isStalled()){\n this._callCallbacks(\"stalled\");\n this._state = VideoContext.STATE.STALLED;\n }else{\n this._state = VideoContext.STATE.PLAYING;\n }\n }\n\n if(this._state === VideoContext.STATE.PLAYING){\n //Handle timeline callbacks.\n let activeCallbacks = new Map();\n for(let callback of this._timelineCallbacks){\n if (callback.time >= this.currentTime && callback.time < (this._currentTime + dt * this._playbackRate)){\n //group the callbacks by time\n if(!activeCallbacks.has(callback.time)) activeCallbacks.set(callback.time, []);\n activeCallbacks.get(callback.time).push(callback);\n }\n }\n\n\n //Sort the groups of callbacks by the times of the groups\n let timeIntervals = Array.from(activeCallbacks.keys());\n timeIntervals.sort(function(a, b){\n return a - b;\n });\n\n for (let t of timeIntervals){\n let callbacks = activeCallbacks.get(t);\n callbacks.sort(function(a,b){\n return a.ordering - b.ordering;\n });\n for(let callback of callbacks){\n callback.func();\n }\n }\n\n this._currentTime += dt * this._playbackRate;\n if(this._currentTime > this.duration && this._endOnLastSourceEnd){\n //Do an update od the sourcenodes in case anything in the \"ended\" callbacks modifes currentTime and sources haven't had a chance to stop.\n for (let i = 0; i < this._sourceNodes.length; i++) {\n this._sourceNodes[i]._update(this._currentTime);\n }\n this._state = VideoContext.STATE.ENDED;\n this._callCallbacks(\"ended\");\n }\n }\n\n let sourcesPlaying = false;\n\n for (let i = 0; i < this._sourceNodes.length; i++) {\n let sourceNode = this._sourceNodes[i];\n\n if(this._state === VideoContext.STATE.STALLED){\n if (sourceNode._isReady() && sourceNode._state === SOURCENODESTATE.playing) sourceNode._pause();\n }\n if(this._state === VideoContext.STATE.PAUSED){\n sourceNode._pause();\n }\n if(this._state === VideoContext.STATE.PLAYING){\n sourceNode._play();\n }\n sourceNode._update(this._currentTime);\n if (sourceNode._state === SOURCENODESTATE.paused || sourceNode._state === SOURCENODESTATE.playing){\n sourcesPlaying = true;\n }\n }\n\n\n if (sourcesPlaying !== this._sourcesPlaying && this._state === VideoContext.STATE.PLAYING){\n if (sourcesPlaying === true){\n this._callCallbacks(\"content\");\n }else{\n this._callCallbacks(\"nocontent\");\n }\n this._sourcesPlaying = sourcesPlaying;\n }\n\n\n /*\n * Itterate the directed acyclic graph using Khan's algorithm (KHAAAAAN!).\n *\n * This has highlighted a bunch of ineffencies in the rendergraph class about how its stores connections.\n * Mainly the fact that to get inputs for a node you have to iterate the full list of connections rather than\n * a node owning it's connections.\n * The trade off with changing this is making/removing connections becomes more costly performance wise, but\n * this is deffinately worth while because getting the connnections is a much more common operation.\n *\n * TL;DR Future matt - refactor this.\n *\n */\n let sortedNodes = [];\n let connections = this._renderGraph.connections.slice();\n let nodes = RenderGraph.getInputlessNodes(connections);\n\n\n while (nodes.length > 0) {\n let node = nodes.pop();\n sortedNodes.push(node);\n for (let edge of RenderGraph.outputEdgesFor(node, connections)){\n let index = connections.indexOf(edge);\n if (index > -1) connections.splice(index, 1);\n if (RenderGraph.inputEdgesFor(edge.destination, connections).length === 0){\n nodes.push(edge.destination);\n }\n }\n }\n\n for (let node of sortedNodes){\n if (this._sourceNodes.indexOf(node) === -1){\n node._update(this._currentTime);\n node._render();\n }\n }\n }\n }\n\n /**\n * Destroy all nodes in the graph and reset the timeline. After calling this any created nodes will be unusable.\n */\n reset(){\n for (let callback of this._callbacks){\n this.unregisterCallback(callback);\n }\n for (let node of this._sourceNodes){\n node.destroy();\n }\n for (let node of this._processingNodes){\n node.destroy();\n }\n this._update(0);\n this._sourceNodes = [];\n this._processingNodes = [];\n this._timeline = [];\n this._currentTime = 0;\n this._state = VideoContext.STATE.PAUSED;\n this._playbackRate = 1.0;\n this._sourcesPlaying = undefined;\n this._callbacks.set(\"stalled\", []);\n this._callbacks.set(\"update\", []);\n this._callbacks.set(\"ended\", []);\n this._callbacks.set(\"content\", []);\n this._callbacks.set(\"nocontent\", []);\n this._timelineCallbacks = [];\n }\n\n _depricate(msg){\n console.log(msg);\n }\n\n static get DEFINITIONS() {\n return DEFINITIONS;\n }\n\n /**\n * Get a JS Object containing the state of the VideoContext instance and all the created nodes.\n */\n snapshot () {\n return snapshot(this);\n }\n}\n\n//playing - all sources are active\n//paused - all sources are paused\n//stalled - one or more sources is unable to play\n//ended - all sources have finished playing\n//broken - the render graph is in a broken state\nVideoContext.STATE = {};\nVideoContext.STATE.PLAYING = 0;\nVideoContext.STATE.PAUSED = 1;\nVideoContext.STATE.STALLED = 2;\nVideoContext.STATE.ENDED = 3;\nVideoContext.STATE.BROKEN = 4;\n\nVideoContext.visualiseVideoContextTimeline = visualiseVideoContextTimeline;\nVideoContext.visualiseVideoContextGraph = visualiseVideoContextGraph;\nVideoContext.createControlFormForNode = createControlFormForNode;\nVideoContext.createSigmaGraphDataFromRenderGraph = createSigmaGraphDataFromRenderGraph;\nVideoContext.exportToJSON = exportToJSON;\nVideoContext.updateablesManager = updateablesManager;\nVideoContext.importSimpleEDL = importSimpleEDL;\n\n\n\n// WEBPACK FOOTER //\n// ./src/videocontext.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport SourceNode, { SOURCENODESTATE } from \"./sourcenode\";\n\nclass VideoNode extends SourceNode {\n /**\n * Initialise an instance of a VideoNode.\n * This should not be called directly, but created through a call to videoContext.createVideoNode();\n */\n constructor(src, gl, renderGraph, currentTime, globalPlaybackRate=1.0, sourceOffset=0, preloadTime = 4, videoElementCache=undefined, attributes = {}){\n super(src, gl, renderGraph, currentTime);\n this._preloadTime = preloadTime;\n this._sourceOffset = sourceOffset;\n this._globalPlaybackRate = globalPlaybackRate;\n this._videoElementCache = videoElementCache;\n this._playbackRate = 1.0;\n this._volume = 1.0;\n this._playbackRateUpdated = true;\n this._attributes = attributes;\n this._loopElement = false;\n this._isElementPlaying = false;\n if (this._attributes.loop){\n this._loopElement = this._attributes.loop;\n }\n this._displayName = \"VideoNode\";\n }\n\n set playbackRate(playbackRate){\n this._playbackRate = playbackRate;\n this._playbackRateUpdated = true;\n }\n\n set stretchPaused(stretchPaused){\n super.stretchPaused = stretchPaused;\n if(this._element){\n if (this._stretchPaused){\n this._element.pause();\n } else{\n if(this._state === SOURCENODESTATE.playing){\n this._element.play();\n }\n }\n }\n }\n\n get stretchPaused(){\n return this._stretchPaused;\n }\n\n get playbackRate(){\n return this._playbackRate;\n }\n\n get elementURL(){\n return this._elementURL;\n }\n\n set volume(volume){\n this._volume = volume;\n if(this._element !== undefined) this._element.volume = this._volume;\n }\n\n _load(){\n super._load();\n if (this._element !== undefined){\n\n for (var key in this._attributes) {\n this._element[key] = this._attributes[key];\n }\n\n if (this._element.readyState > 3 && !this._element.seeking){\n if(this._loopElement === false){\n if (this._stopTime === Infinity || this._stopTime == undefined){\n this._stopTime = this._startTime + this._element.duration;\n this._triggerCallbacks(\"durationchange\", this.duration);\n }\n }\n if(this._ready !== true){\n this._triggerCallbacks(\"loaded\");\n this._playbackRateUpdated = true;\n\n }\n\n this._ready = true;\n\n } else{\n if(this._state !== SOURCENODESTATE.error){\n this._ready = false;\n }\n }\n return;\n }\n if (this._isResponsibleForElementLifeCycle){\n if (this._videoElementCache){\n this._element = this._videoElementCache.get();\n }else{\n this._element = document.createElement(\"video\");\n this._element.setAttribute(\"crossorigin\", \"anonymous\");\n this._element.setAttribute(\"webkit-playsinline\", \"\");\n this._element.setAttribute(\"playsinline\", \"\");\n this._playbackRateUpdated = true;\n }\n this._element.volume = this._volume;\n if (window.MediaStream !== undefined && this._elementURL instanceof MediaStream){\n this._element.srcObject = this._elementURL;\n } else {\n this._element.src = this._elementURL;\n }\n\n for (let key in this._attributes) {\n this._element[key] = this._attributes[key];\n }\n }\n if (this._element){\n let currentTimeOffset = 0;\n if (this._currentTime > this._startTime) currentTimeOffset = this._currentTime - this._startTime;\n this._element.currentTime = this._sourceOffset + currentTimeOffset;\n this._element.onerror = () => {\n if (this._element === undefined) return;\n console.debug(\"Error with element\", this._element);\n this._state = SOURCENODESTATE.error;\n //Event though there's an error ready should be set to true so the node can output transparenn\n this._ready = true;\n this._triggerCallbacks(\"error\");\n };\n }else{\n //If the element doesn't exist for whatever reason enter the error state.\n this._state = SOURCENODESTATE.error;\n this._ready = true;\n this._triggerCallbacks(\"error\");\n }\n }\n\n _unload(){\n super._unload();\n if (this._isResponsibleForElementLifeCycle && this._element !== undefined){\n this._element.src = \"\";\n this._element.srcObject = undefined;\n for (let key in this._attributes){\n this._element.removeAttribute(key);\n }\n this._element = undefined;\n if(!this._videoElementCache) delete this._element;\n }\n this._ready = false;\n this._isElementPlaying = false;\n }\n\n _seek(time){\n super._seek(time);\n if (this.state === SOURCENODESTATE.playing || this.state === SOURCENODESTATE.paused){\n if (this._element === undefined) this._load();\n let relativeTime = this._currentTime - this._startTime + this._sourceOffset;\n this._element.currentTime = relativeTime;\n this._ready = false;\n }\n if((this._state === SOURCENODESTATE.sequenced || this._state === SOURCENODESTATE.ended) && this._element !== undefined){\n this._unload();\n }\n }\n\n _update(currentTime){\n //if (!super._update(currentTime)) return false;\n super._update(currentTime);\n //check if the video has ended\n if(this._element !== undefined){\n if (this._element.ended){\n this._state = SOURCENODESTATE.ended;\n this._triggerCallbacks(\"ended\");\n }\n }\n\n if (this._startTime - this._currentTime <= this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();\n\n if (this._state === SOURCENODESTATE.playing){\n if (this._playbackRateUpdated)\n {\n this._element.playbackRate = this._globalPlaybackRate * this._playbackRate;\n this._playbackRateUpdated = false;\n }\n if (!this._isElementPlaying){\n this._element.play();\n if (this._stretchPaused){\n this._element.pause();\n }\n this._isElementPlaying = true;\n }\n return true;\n } else if (this._state === SOURCENODESTATE.paused){\n this._element.pause();\n this._isElementPlaying = false;\n return true;\n }\n else if (this._state === SOURCENODESTATE.ended && this._element !== undefined){\n this._element.pause();\n if (this._isElementPlaying){\n this._unload();\n }\n return false;\n }\n }\n\n clearTimelineState(){\n super.clearTimelineState();\n if (this._element !== undefined) {\n this._element.pause();\n this._isElementPlaying = false;\n }\n this._unload();\n }\n\n destroy(){\n if (this._element) this._element.pause();\n super.destroy();\n }\n\n}\n\nexport default VideoNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/SourceNodes/videonode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport { updateTexture, clearTexture, createElementTexutre } from \"../utils.js\";\nimport GraphNode from \"../graphnode\";\n\nlet STATE = {\"waiting\":0, \"sequenced\":1, \"playing\":2, \"paused\":3, \"ended\":4, \"error\":5};\n\nclass SourceNode extends GraphNode{\n /**\n * Initialise an instance of a SourceNode.\n * This is the base class for other Nodes which generate media to be passed into the processing pipeline.\n */\n constructor(src, gl, renderGraph, currentTime){\n super(gl,renderGraph, [], true);\n this._element = undefined;\n this._elementURL = undefined;\n this._isResponsibleForElementLifeCycle = true;\n\n if (typeof src === \"string\" || (window.MediaStream !== undefined && src instanceof MediaStream)){\n //create the node from the passed URL or MediaStream\n this._elementURL = src;\n }else{\n //use the passed element to create the SourceNode\n this._element = src;\n this._isResponsibleForElementLifeCycle = false;\n }\n\n this._state = STATE.waiting;\n this._currentTime = currentTime;\n this._startTime = NaN;\n this._stopTime = Infinity;\n this._ready = false;\n this._loadCalled = false;\n this._stretchPaused = false;\n this._texture = createElementTexutre(gl);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));\n this._callbacks = [];\n this._renderPaused = false;\n this._displayName = \"SourceNode\";\n\n }\n\n /**\n * Returns the state of the node.\n * 0 - Waiting, start() has not been called on it yet.\n * 1 - Sequenced, start() has been called but it is not playing yet.\n * 2 - Playing, the node is playing.\n * 3 - Paused, the node is paused.\n * 4 - Ended, playback of the node has finished.\n *\n * @example\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n * console.log(videoNode.state); //will output 0 (for waiting)\n * videoNode.start(5);\n * console.log(videoNode.state); //will output 1 (for sequenced)\n * videoNode.stop(10);\n * ctx.play();\n * console.log(videoNode.state); //will output 2 (for playing)\n * ctx.paused();\n * console.log(videoNode.state); //will output 3 (for paused)\n */\n get state(){\n return this._state;\n }\n\n\n /**\n * Returns the underlying DOM element which represents this source node.\n * Note: If a source node is created with a url rather than passing in an existing element then this will return undefined until the source node preloads the element.\n *\n * @return {Element} The underlying DOM element representing the media for the node. If the lifecycle of the video is owned UNSIGNED_BYTE the node itself, this can return undefined if the element hasn't been loaded yet.\n *\n * @example\n * //Accessing the Element on a VideoNode created via a URL\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n * videoNode.start(0);\n * videoNode.stop(5);\n * //When the node starts playing the element should exist so set it's volume to 0\n * videoNode.regsiterCallback(\"play\", function(){videoNode.element.volume = 0;});\n *\n *\n * @example\n * //Accessing the Element on a VideoNode created via an already existing element\n * var ctx = new VideoContext();\n * var videoElement = document.createElement(\"video\");\n * var videoNode = ctx.createVideoSourceNode(videoElement);\n * videoNode.start(0);\n * videoNode.stop(5);\n * //The elemnt can be accessed any time because it's lifecycle is managed outside of the VideoContext\n * videoNode.element.volume = 0;\n *\n */\n get element(){\n return this._element;\n }\n\n\n /**\n * Returns the duration of the node on a timeline. If no start time is set will return undefiend, if no stop time is set will return Infinity.\n *\n * @return {number} The duration of the node in seconds.\n *\n * @example\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n * videoNode.start(5);\n * videoNode.stop(10);\n * console.log(videoNode.duration); //will output 10\n */\n get duration(){\n if (isNaN(this._startTime)) return undefined;\n if (this._stopTime === Infinity) return Infinity;\n return this._stopTime - this._startTime;\n }\n\n set stretchPaused(stretchPaused){\n this._stretchPaused = stretchPaused;\n }\n\n get stretchPaused(){\n return this._stretchPaused;\n }\n\n _load(){\n if (!this._loadCalled){\n this._triggerCallbacks(\"load\");\n this._loadCalled = true;\n }\n }\n\n _unload (){\n this._triggerCallbacks(\"destroy\");\n this._loadCalled = false;\n }\n\n /**\n * Register callbacks against one of these events: \"load\", \"destroy\", \"seek\", \"pause\", \"play\", \"ended\", \"durationchange\", \"loaded\", \"error\"\n *\n * @param {String} type - the type of event to register the callback against.\n * @param {function} func - the function to call.\n *\n * @example\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n *\n * videoNode.registerCallback(\"load\", function(){\"video is loading\"});\n * videoNode.registerCallback(\"play\", function(){\"video is playing\"});\n * videoNode.registerCallback(\"ended\", function(){\"video has eneded\"});\n *\n */\n registerCallback(type, func){\n this._callbacks.push({type:type, func:func});\n }\n\n /**\n * Remove callback.\n *\n * @param {function} [func] - the callback to remove, if undefined will remove all callbacks for this node.\n *\n * @example\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n *\n * videoNode.registerCallback(\"load\", function(){\"video is loading\"});\n * videoNode.registerCallback(\"play\", function(){\"video is playing\"});\n * videoNode.registerCallback(\"ended\", function(){\"video has eneded\"});\n * videoNode.unregisterCallback(); //remove all of the three callbacks.\n *\n */\n unregisterCallback(func){\n let toRemove = [];\n for(let callback of this._callbacks){\n if (func === undefined){\n toRemove.push(callback);\n } else if (callback.func === func){\n toRemove.push(callback);\n }\n }\n for(let callback of toRemove){\n let index = this._callbacks.indexOf(callback);\n this._callbacks.splice(index, 1);\n }\n }\n\n _triggerCallbacks(type, data){\n for(let callback of this._callbacks){\n if (callback.type === type){\n if (data!== undefined){\n callback.func(this, data);\n }else{\n callback.func(this);\n }\n }\n }\n }\n\n /**\n * Start playback at VideoContext.currentTime plus passed time. If passed time is negative, will play as soon as possible.\n *\n * @param {number} time - the time from the currentTime of the VideoContext which to start playing, if negative will play as soon as possible.\n * @return {boolean} Will return true is seqeuncing has succeded, or false if it is already sequenced.\n */\n start(time){\n if (this._state !== STATE.waiting){\n console.debug(\"SourceNode is has already been sequenced. Can't sequence twice.\");\n return false;\n }\n\n this._startTime = this._currentTime + time;\n this._state = STATE.sequenced;\n return true;\n }\n\n /**\n * Start playback at an absolute time ont the VideoContext's timeline.\n *\n * @param {number} time - the time on the VideoContexts timeline to start playing.\n * @return {boolean} Will return true is seqeuncing has succeded, or false if it is already sequenced.\n */\n startAt(time){\n if (this._state !== STATE.waiting){\n console.debug(\"SourceNode is has already been sequenced. Can't sequence twice.\");\n return false;\n }\n this._startTime = time;\n this._state = STATE.sequenced;\n return true;\n }\n\n\n get startTime(){\n return this._startTime;\n }\n\n\n /**\n * Stop playback at VideoContext.currentTime plus passed time. If passed time is negative, will play as soon as possible.\n *\n * @param {number} time - the time from the currentTime of the video context which to stop playback.\n * @return {boolean} Will return true is seqeuncing has succeded, or false if the playback has already ended or if start hasn't been called yet, or if time is less than the start time.\n */\n stop(time){\n if (this._state === STATE.ended){\n console.debug(\"SourceNode has already ended. Cannot call stop.\");\n return false;\n } else if (this._state === STATE.waiting){\n console.debug(\"SourceNode must have start called before stop is called\");\n return false;\n }\n if (this._currentTime + time <= this._startTime){\n console.debug(\"SourceNode must have a stop time after it's start time, not before.\");\n return false;\n }\n this._stopTime = this._currentTime + time;\n this._stretchPaused = false;\n this._triggerCallbacks(\"durationchange\", this.duration);\n return true;\n }\n\n /**\n * Stop playback at an absolute time ont the VideoContext's timeline.\n *\n * @param {number} time - the time on the VideoContexts timeline to stop playing.\n * @return {boolean} Will return true is seqeuncing has succeded, or false if the playback has already ended or if start hasn't been called yet, or if time is less than the start time.\n */\n stopAt(time){\n if (this._state === STATE.ended){\n console.debug(\"SourceNode has already ended. Cannot call stop.\");\n return false;\n } else if (this._state === STATE.waiting){\n console.debug(\"SourceNode must have start called before stop is called\");\n return false;\n }\n if (time <= this._startTime){\n console.debug(\"SourceNode must have a stop time after it's start time, not before.\");\n return false;\n }\n this._stopTime = time;\n this._stretchPaused = false;\n this._triggerCallbacks(\"durationchange\", this.duration);\n return true;\n }\n\n\n get stopTime(){\n return this._stopTime;\n }\n\n\n _seek(time){\n this._renderPaused = false;\n\n this._triggerCallbacks(\"seek\", time);\n\n if (this._state === STATE.waiting) return;\n if (time < this._startTime){\n clearTexture(this._gl, this._texture);\n this._state = STATE.sequenced;\n }\n if (time >= this._startTime && this._state !== STATE.paused){\n this._state = STATE.playing;\n }\n if (time >= this._stopTime){\n clearTexture(this._gl, this._texture);\n this._triggerCallbacks(\"ended\");\n this._state = STATE.ended;\n }\n //update the current time\n this._currentTime = time;\n }\n\n _pause(){\n if(this._state === STATE.playing || (this._currentTime === 0 && this._startTime === 0)){\n this._triggerCallbacks(\"pause\");\n this._state = STATE.paused;\n this._renderPaused = false;\n }\n }\n _play(){\n\n if(this._state === STATE.paused){\n this._triggerCallbacks(\"play\");\n this._state = STATE.playing;\n }\n }\n\n _isReady(){\n if (this._state === STATE.playing || this._state === STATE.paused || this._state === STATE.error){\n return this._ready;\n }\n return true;\n }\n\n _update(currentTime, triggerTextureUpdate=true){\n this._rendered = true;\n let timeDelta = currentTime - this._currentTime;\n\n //update the current time\n this._currentTime = currentTime;\n\n //update the state\n if (this._state === STATE.waiting || this._state === STATE.ended || this._state === STATE.error) return false;\n\n this._triggerCallbacks(\"render\", currentTime);\n\n\n if (currentTime < this._startTime){\n clearTexture(this._gl, this._texture);\n this._state = STATE.sequenced;\n }\n\n\n if (currentTime >= this._startTime && this._state !== STATE.paused && this._state !== STATE.error){\n if (this._state !== STATE.playing) this._triggerCallbacks(\"play\");\n this._state = STATE.playing;\n }\n\n if (currentTime >= this._stopTime){\n clearTexture(this._gl, this._texture);\n this._triggerCallbacks(\"ended\");\n this._state = STATE.ended;\n }\n\n //update this source nodes texture\n if (this._element === undefined || this._ready === false) return true;\n\n if (!this._renderPaused && this._state === STATE.paused) {\n if(triggerTextureUpdate)updateTexture(this._gl, this._texture, this._element);\n this._renderPaused = true;\n }\n if(this._state === STATE.playing){\n if(triggerTextureUpdate)updateTexture(this._gl, this._texture, this._element);\n if(this._stretchPaused){\n this._stopTime += timeDelta;\n }\n }\n\n return true;\n }\n\n /**\n * Clear any timeline state the node currently has, this puts the node in the \"waiting\" state, as if neither start nor stop had been called.\n */\n clearTimelineState(){\n this._startTime = NaN;\n this._stopTime = Infinity;\n this._state = STATE.waiting;\n }\n\n /**\n * Destroy and clean-up the node.\n */\n destroy(){\n this._unload();\n super.destroy();\n this.unregisterCallback();\n delete this._element;\n this._elementURL = undefined;\n this._state = STATE.waiting;\n this._currentTime = 0;\n this._startTime = NaN;\n this._stopTime = Infinity;\n this._ready = false;\n this._loadCalled = false;\n this._gl.deleteTexture(this._texture);\n this._texture = undefined;\n }\n}\n\nexport {STATE as SOURCENODESTATE};\n\nexport default SourceNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/SourceNodes/sourcenode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport DEFINITIONS from \"./Definitions/definitions.js\";\nimport { SOURCENODESTATE } from \"./SourceNodes/sourcenode.js\";\n\n/*\n* Utility function to compile a WebGL Vertex or Fragment shader.\n*\n* @param {WebGLRenderingContext} gl - the webgl context fo which to build the shader.\n* @param {String} shaderSource - A string of shader code to compile.\n* @param {number} shaderType - Shader type, either WebGLRenderingContext.VERTEX_SHADER or WebGLRenderingContext.FRAGMENT_SHADER.\n*\n* @return {WebGLShader} A compiled shader.\n*\n*/\nexport function compileShader(gl, shaderSource, shaderType) {\n let shader = gl.createShader(shaderType);\n gl.shaderSource(shader, shaderSource);\n gl.compileShader(shader);\n let success = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if (!success) {\n throw \"could not compile shader:\" + gl.getShaderInfoLog(shader);\n }\n return shader;\n}\n\n/*\n* Create a shader program from a passed vertex and fragment shader source string.\n*\n* @param {WebGLRenderingContext} gl - the webgl context fo which to build the shader.\n* @param {WebGLShader} vertexShader - A compiled vertex shader.\n* @param {WebGLShader} fragmentShader - A compiled fragment shader.\n*\n* @return {WebGLProgram} A compiled & linkde shader program.\n*/\nexport function createShaderProgram(gl, vertexShader, fragmentShader){\n let program = gl.createProgram();\n\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n gl.linkProgram(program);\n\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)){\n throw {\"error\":4,\"msg\":\"Can't link shader program for track\", toString:function(){return this.msg;}};\n }\n return program;\n}\n\nexport function createElementTexutre(gl){\n let texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n // Set the parameters so we can render any size image.\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n //Initialise the texture untit to clear.\n //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, type);\n\n return texture;\n}\n\nexport function updateTexture(gl, texture, element){\n if(element.readyState !== undefined && element.readyState === 0) return;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, element);\n}\n\nexport function clearTexture(gl, texture){\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));\n}\n\n\nexport function generateRandomId(){\n const appearanceAdjective = [\"adorable\", \"alert\", \"average\", \"beautiful\", \"blonde\", \"bloody\", \"blushing\", \"bright\", \"clean\", \"clear\", \"cloudy\", \"colourful\", \"concerned\",\"crowded\", \"curious\", \"cute\", \"dark\", \"dirty\", \"drab\", \"distinct\", \"dull\", \"elegant\", \"fancy\", \"filthy\", \"glamorous\", \"gleaming\", \"graceful\", \"grotesque\", \"homely\", \"light\", \"misty\", \"motionless\", \"muddy\", \"plain\", \"poised\", \"quaint\", \"scary\", \"shiny\", \"smoggy\", \"sparkling\", \"spotless\", \"stormy\", \"strange\", \"ugly\", \"unsightly\", \"unusual\"];\n const conditionAdjective = [\"alive\", \"brainy\", \"broken\", \"busy\", \"careful\",\"cautious\", \"clever\", \"crazy\", \"damaged\", \"dead\", \"difficult\",\"easy\",\"fake\", \"false\",\"famous\", \"forward\", \"fragile\",\"guilty\", \"helpful\",\"helpless\",\"important\", \"impossible\",\"infamous\",\"innocent\", \"inquisitive\", \"mad\", \"modern\", \"open\", \"outgoing\", \"outstanding\",\"poor\", \"powerful\",\"puzzled\", \"real\", \"rich\", \"right\", \"robust\",\"sane\", \"scary\", \"shy\", \"sleepy\",\"stupid\", \"super\", \"tame\", \"thick\",\"tired\",\"wild\", \"wrong\"];\n const nounAnimal = [\"manatee\", \"gila monster\", \"nematode\", \"seahorse\", \"slug\", \"koala bear\", \"giant tortoise\",\"garden snail\", \"starfish\", \"sloth\", \"american woodcock\", \"coral\", \"swallowtail butterfly\", \"house sparrow\", \"sea anemone\"];\n\n function randomChoice(array){\n return array[Math.floor(Math.random() * array.length)];\n }\n\n function capitalize(word){\n word = word.replace(/\\b\\w/g, l => l.toUpperCase());\n return word;\n }\n\n let name = randomChoice(appearanceAdjective) + \" \" + randomChoice(conditionAdjective) + \" \" + randomChoice(nounAnimal);\n name = capitalize(name);\n name = name.replace(/ /g, \"-\");\n return name;\n}\n\n\nexport function exportToJSON(vc) {\n console.warn(\"VideoContext.exportToJSON has been deprecated. Please use VideoContext.snapshot instead.\");\n return JSON.stringify(snapshotNodes(vc));\n}\n\nexport function snapshot(vc) {\n return {\n nodes: snapshotNodes(vc),\n videoContext: snapshotVideoContext(vc)\n };\n}\n\nfunction snapshotVideoContext(vc) {\n return {\n currentTime: vc.currentTime,\n duration: vc.duration,\n state: vc.state,\n playbackRate: vc.playbackRate,\n };\n}\n\nlet warningExportSourceLogged = false;\nfunction snapshotNodes(vc){\n\n function qualifyURL(url) {\n var a = document.createElement(\"a\");\n a.href = url;\n return a.href;\n }\n\n function getInputIDs(node, vc){\n let inputs = [];\n for (let input of node.inputs){\n if (input === undefined)continue;\n let inputID;\n let inputIndex = node.inputs.indexOf(input);\n let index = vc._processingNodes.indexOf(input);\n if (index > -1){\n inputID = \"processor\" + index;\n } else{\n let index = vc._sourceNodes.indexOf(input);\n if(index > -1){\n inputID = \"source\" + index;\n } else {\n console.log(\"Warning, can't find input\",input);\n }\n }\n inputs.push({id:inputID, index:inputIndex});\n }\n return inputs;\n }\n\n let result = {};\n\n\n let sourceNodeStateMapping = [];\n for (let state in SOURCENODESTATE){\n sourceNodeStateMapping[SOURCENODESTATE[state]] = state;\n }\n\n for(let index in vc._sourceNodes){\n let source = vc._sourceNodes[index];\n let id = \"source\" + index;\n let node_url = \"\";\n\n if(!source._isResponsibleForElementLifeCycle){\n if (!warningExportSourceLogged){\n console.debug(\"Warning - Trying to export source created from an element not a URL. URL of export will be set to the elements src attribute and may be incorrect\", source);\n warningExportSourceLogged = true;\n }\n node_url = source.element.src;\n } else {\n node_url = qualifyURL(source._elementURL);\n }\n\n let node = {\n type: source.displayName,\n url: node_url,\n start: source.startTime,\n stop: source.stopTime,\n state: sourceNodeStateMapping[source.state],\n };\n if (node.type === \"VideoNode\") {\n node.currentTime = null;\n if(source.element && source.element.currentTime) {\n node.currentTime = source.element.currentTime;\n }\n }\n\n if (source._sourceOffset){\n node.sourceOffset = source._sourceOffset;\n }\n result[id] = node;\n }\n\n for (let index in vc._processingNodes){\n let processor = vc._processingNodes[index];\n let id = \"processor\" + index;\n let node = {\n type: processor.displayName,\n definition: processor._definition,\n inputs: getInputIDs(processor, vc),\n properties:{}\n };\n\n for(let property in node.definition.properties){\n node.properties[property] = processor[property];\n }\n\n if (node.type === \"TransitionNode\"){\n node.transitions = processor._transitions;\n }\n\n result[id] = node;\n }\n\n result[\"destination\"] = {\n type:\"Destination\",\n inputs: getInputIDs(vc.destination, vc)\n };\n\n return result;\n}\n\nexport function createControlFormForNode(node, nodeName){\n let rootDiv = document.createElement(\"div\");\n\n if (nodeName !== undefined){\n var title = document.createElement(\"h2\");\n title.innerHTML = nodeName;\n rootDiv.appendChild(title);\n }\n\n for(let propertyName in node._properties){\n let propertyParagraph = document.createElement(\"p\");\n let propertyTitleHeader = document.createElement(\"h3\");\n propertyTitleHeader.innerHTML = propertyName;\n propertyParagraph.appendChild(propertyTitleHeader);\n\n let propertyValue = node._properties[propertyName].value;\n if (typeof propertyValue === \"number\"){\n let range = document.createElement(\"input\");\n range.setAttribute(\"type\", \"range\");\n range.setAttribute(\"min\", \"0\");\n range.setAttribute(\"max\", \"1\");\n range.setAttribute(\"step\", \"0.01\");\n range.setAttribute(\"value\", propertyValue,toString());\n\n let number = document.createElement(\"input\");\n number.setAttribute(\"type\", \"number\");\n number.setAttribute(\"min\", \"0\");\n number.setAttribute(\"max\", \"1\");\n number.setAttribute(\"step\", \"0.01\");\n number.setAttribute(\"value\", propertyValue,toString());\n\n let mouseDown = false;\n range.onmousedown =function(){mouseDown=true;};\n range.onmouseup =function(){mouseDown=false;};\n range.onmousemove = function(){\n if(mouseDown){\n node[propertyName] = parseFloat(range.value);\n number.value = range.value;\n }\n };\n range.onchange = function(){\n node[propertyName] = parseFloat(range.value);\n number.value = range.value;\n };\n number.onchange =function(){\n node[propertyName] = parseFloat(number.value);\n range.value = number.value;\n };\n propertyParagraph.appendChild(range);\n propertyParagraph.appendChild(number);\n }\n else if(Object.prototype.toString.call(propertyValue) === \"[object Array]\"){\n for (var i = 0; i < propertyValue.length; i++) {\n let range = document.createElement(\"input\");\n range.setAttribute(\"type\", \"range\");\n range.setAttribute(\"min\", \"0\");\n range.setAttribute(\"max\", \"1\");\n range.setAttribute(\"step\", \"0.01\");\n range.setAttribute(\"value\", propertyValue[i],toString());\n\n let number = document.createElement(\"input\");\n number.setAttribute(\"type\", \"number\");\n number.setAttribute(\"min\", \"0\");\n number.setAttribute(\"max\", \"1\");\n number.setAttribute(\"step\", \"0.01\");\n number.setAttribute(\"value\", propertyValue,toString());\n\n let index = i;\n let mouseDown = false;\n range.onmousedown =function(){mouseDown=true;};\n range.onmouseup =function(){mouseDown=false;};\n range.onmousemove = function(){\n if(mouseDown){\n node[propertyName][index] = parseFloat(range.value);\n number.value = range.value;\n }\n };\n range.onchange = function(){\n node[propertyName][index] = parseFloat(range.value);\n number.value = range.value;\n };\n\n number.onchange = function(){\n node[propertyName][index] = parseFloat(number.value);\n range.value = number.value;\n };\n propertyParagraph.appendChild(range);\n propertyParagraph.appendChild(number);\n }\n }\n\n rootDiv.appendChild(propertyParagraph);\n }\n return rootDiv;\n}\n\n\nfunction calculateNodeDepthFromDestination(videoContext){\n let destination = videoContext.destination;\n let depthMap= new Map();\n depthMap.set(destination, 0);\n\n function itterateBackwards(node, depth=0){\n for (let n of node.inputs){\n let d = depth + 1;\n if (depthMap.has(n)){\n if (d > depthMap.get(n)){\n depthMap.set(n, d);\n }\n } else{\n depthMap.set(n,d);\n }\n itterateBackwards(n, depthMap.get(n));\n }\n }\n\n itterateBackwards(destination);\n return depthMap;\n}\n\n\n\n\nexport function visualiseVideoContextGraph(videoContext, canvas){\n let ctx = canvas.getContext(\"2d\");\n let w = canvas.width;\n let h = canvas.height;\n ctx.clearRect(0,0,w,h);\n\n let nodeDepths = calculateNodeDepthFromDestination(videoContext);\n let depths = nodeDepths.values();\n depths = Array.from(depths).sort(function(a, b){return b-a;});\n let maxDepth = depths[0];\n\n let xStep = w / (maxDepth+1);\n\n let nodeHeight = (h / videoContext._sourceNodes.length)/3;\n let nodeWidth = nodeHeight * 1.618;\n\n\n function calculateNodePos(node, nodeDepths, xStep, nodeHeight){\n let depth = nodeDepths.get(node);\n nodeDepths.values();\n\n let count = 0;\n for(let nodeDepth of nodeDepths){\n if (nodeDepth[0] === node) break;\n if (nodeDepth[1] === depth) count += 1;\n }\n return {x:(xStep*nodeDepths.get(node)), y:nodeHeight*1.5*count + 50};\n }\n\n\n // \"video\":[\"#572A72\", \"#3C1255\"],\n // \"image\":[\"#7D9F35\", \"#577714\"],\n // \"canvas\":[\"#AA9639\", \"#806D15\"]\n\n for (let i = 0; i < videoContext._renderGraph.connections.length; i++) {\n let conn = videoContext._renderGraph.connections[i];\n let source = calculateNodePos(conn.source, nodeDepths, xStep, nodeHeight);\n let destination = calculateNodePos(conn.destination, nodeDepths, xStep, nodeHeight);\n if (source !== undefined && destination !== undefined){\n ctx.beginPath();\n //ctx.moveTo(source.x + nodeWidth/2, source.y + nodeHeight/2);\n let x1 = source.x + nodeWidth/2;\n let y1 = source.y + nodeHeight/2;\n let x2 = destination.x + nodeWidth/2;\n let y2 = destination.y + nodeHeight/2;\n let dx = x2 - x1;\n let dy = y2 - y1;\n\n let angle = Math.PI/2 - Math.atan2(dx,dy);\n\n let distance = Math.sqrt(Math.pow(x1-x2,2) + Math.pow(y1-y2,2));\n\n let midX = Math.min(x1, x2) + (Math.max(x1,x2) - Math.min(x1, x2))/2;\n let midY = Math.min(y1, y2) + (Math.max(y1,y2) - Math.min(y1, y2))/2;\n\n let testX = (Math.cos(angle + Math.PI/2))*distance/1.5 + midX;\n let testY = (Math.sin(angle + Math.PI/2))*distance/1.5 + midY;\n // console.log(testX, testY);\n\n ctx.arc(testX, testY, distance/1.2, angle-Math.PI+0.95, angle-0.95);\n\n //ctx.arcTo(source.x + nodeWidth/2 ,source.y + nodeHeight/2,destination.x + nodeWidth/2,destination.y + nodeHeight/2,100);\n //ctx.lineTo(midX, midY);\n ctx.stroke();\n //ctx.endPath();\n }\n }\n\n\n for(let node of nodeDepths.keys()){\n let pos = calculateNodePos(node, nodeDepths, xStep, nodeHeight);\n let color = \"#AA9639\";\n let text = \"\";\n if (node.displayName === \"CompositingNode\"){\n color = \"#000000\";\n }\n if (node.displayName === \"DestinationNode\"){\n color = \"#7D9F35\";\n text=\"Output\";\n }\n if (node.displayName === \"VideoNode\"){\n color = \"#572A72\";\n text = \"Video\";\n }\n if (node.displayName === \"CanvasNode\"){\n color = \"#572A72\";\n text = \"Canvas\";\n }\n if (node.displayName === \"ImageNode\"){\n color = \"#572A72\";\n text = \"Image\";\n }\n ctx.beginPath();\n ctx.fillStyle = color;\n ctx.fillRect(pos.x, pos.y, nodeWidth, nodeHeight);\n ctx.fill();\n\n\n ctx.fillStyle = \"#000\";\n ctx.textAlign = \"center\";\n ctx.font = \"10px Arial\";\n ctx.fillText(text,pos.x+nodeWidth/2, pos.y+nodeHeight/2+2.5);\n ctx.fill();\n }\n\n return;\n}\n\n\n\n\nexport function createSigmaGraphDataFromRenderGraph(videoContext){\n\n function idForNode(node){\n if (videoContext._sourceNodes.indexOf(node) !== -1){\n let id = \"source \" + node.displayName+ \" \"+videoContext._sourceNodes.indexOf(node);\n return id;\n }\n let id = \"processor \" + node.displayName + \" \"+videoContext._processingNodes.indexOf(node);\n return id;\n }\n\n let graph = {\n nodes:[\n {\n id: idForNode(videoContext.destination),\n label:\"Destination Node\",\n x:2.5,\n y:0.5,\n size:2,\n node: videoContext.destination\n }],\n edges:[]\n };\n\n for (let i = 0; i < videoContext._sourceNodes.length; i++) {\n let sourceNode = videoContext._sourceNodes[i];\n let y = i * (1.0 / videoContext._sourceNodes.length);\n graph.nodes.push({\n id: idForNode(sourceNode),\n label:\"Source \"+ i.toString(),\n x:0,\n y: y,\n size:2,\n color:\"#572A72\",\n node:sourceNode\n });\n }\n for (let i = 0; i < videoContext._processingNodes.length; i++) {\n let processingNode = videoContext._processingNodes[i];\n graph.nodes.push({\n id: idForNode(processingNode),\n x: Math.random() *2.5,\n y: Math.random(),\n size:2,\n node: processingNode\n });\n }\n\n for (let i = 0; i < videoContext._renderGraph.connections.length; i++) {\n let conn = videoContext._renderGraph.connections[i];\n graph.edges.push({\n \"id\":\"e\"+i.toString(),\n \"source\": idForNode(conn.source),\n \"target\": idForNode(conn.destination)\n });\n }\n\n\n\n return graph;\n}\n\n\nexport function importSimpleEDL(ctx, playlist){\n // Create a \"track\" node to connect all the clips to.\n let trackNode = ctx.compositor(DEFINITIONS.COMBINE);\n\n // Create a source node for each of the clips.\n for (let clip of playlist){\n let node;\n if (clip.type === \"video\"){\n node = ctx.video(clip.src, clip.sourceStart);\n } else if (clip.type === \"image\"){\n node = ctx.image(clip.src, clip.sourceStart);\n }else {\n console.debug(\"Clip type \\\"\" + clip.type + \"\\\" not recognised, skipping.\");\n continue;\n }\n node.startAt(clip.start);\n node.stopAt(clip.start + clip.duration);\n node.connect(trackNode);\n }\n return trackNode;\n}\n\nexport function visualiseVideoContextTimeline(videoContext, canvas, currentTime){\n let ctx = canvas.getContext(\"2d\");\n let w = canvas.width;\n let h = canvas.height;\n let trackHeight = h / videoContext._sourceNodes.length;\n let playlistDuration = videoContext.duration;\n\n if (currentTime > playlistDuration && !videoContext.endOnLastSourceEnd) playlistDuration = currentTime;\n\n if (videoContext.duration === Infinity){\n let total = 0;\n for (let i = 0; i < videoContext._sourceNodes.length; i++) {\n let sourceNode = videoContext._sourceNodes[i];\n if(sourceNode._stopTime !== Infinity) total += sourceNode._stopTime;\n }\n\n if (total > videoContext.currentTime){\n playlistDuration = total+5;\n }else{\n playlistDuration = videoContext.currentTime+5;\n }\n }\n let pixelsPerSecond = w / playlistDuration;\n let mediaSourceStyle = {\n \"video\":[\"#572A72\", \"#3C1255\"],\n \"image\":[\"#7D9F35\", \"#577714\"],\n \"canvas\":[\"#AA9639\", \"#806D15\"]\n };\n\n\n ctx.clearRect(0,0,w,h);\n ctx.fillStyle = \"#999\";\n\n for(let node of videoContext._processingNodes){\n if (node.displayName !== \"TransitionNode\") continue;\n for(let propertyName in node._transitions){\n for(let transition of node._transitions[propertyName]){\n let tW = (transition.end - transition.start) * pixelsPerSecond;\n let tH = h;\n let tX = transition.start * pixelsPerSecond;\n let tY = 0;\n ctx.fillStyle = \"rgba(0,0,0, 0.3)\";\n ctx.fillRect(tX, tY, tW, tH);\n ctx.fill();\n }\n }\n }\n\n\n for (let i = 0; i < videoContext._sourceNodes.length; i++) {\n let sourceNode = videoContext._sourceNodes[i];\n let duration = sourceNode._stopTime - sourceNode._startTime;\n if(duration=== Infinity) duration = videoContext.currentTime;\n let start = sourceNode._startTime;\n\n let msW = duration * pixelsPerSecond;\n let msH = trackHeight;\n let msX = start * pixelsPerSecond;\n let msY = trackHeight * i;\n ctx.fillStyle = mediaSourceStyle.video[i%mediaSourceStyle.video.length];\n\n\n ctx.fillRect(msX,msY,msW,msH);\n ctx.fill();\n }\n\n\n\n if (currentTime !== undefined){\n ctx.fillStyle = \"#000\";\n ctx.fillRect(currentTime*pixelsPerSecond, 0, 1, h);\n }\n}\n\n\n\n\nexport class UpdateablesManager{\n constructor(){\n this._updateables = [];\n this._useWebworker = false;\n this._active = false;\n this._previousRAFTime = undefined;\n this._previousWorkerTime = undefined;\n\n this._webWorkerString = \"\\\n var running = false;\\\n function tick(){\\\n postMessage(Date.now());\\\n if (running){\\\n setTimeout(tick, 1000/20);\\\n }\\\n }\\\n self.addEventListener('message',function(msg){\\\n var data = msg.data;\\\n if (data === 'start'){\\\n running = true;\\\n tick();\\\n }\\\n if (data === 'stop') running = false;\\\n });\";\n this._webWorker = undefined;\n }\n\n _initWebWorker(){\n window.URL = window.URL || window.webkitURL;\n let blob = new Blob([this._webWorkerString], {type: \"application/javascript\"});\n this._webWorker = new Worker(URL.createObjectURL(blob));\n this._webWorker.onmessage = (msg)=>{\n let time = msg.data;\n this._updateWorkerTime(time);\n };\n }\n\n _lostVisibility(){\n this._previousWorkerTime = Date.now();\n this._useWebworker = true;\n if (!this._webWorker){\n this._initWebWorker();\n }\n this._webWorker.postMessage(\"start\");\n }\n\n _gainedVisibility(){\n this._useWebworker = false;\n this._previousRAFTime = undefined;\n if(this._webWorker) this._webWorker.postMessage(\"stop\");\n requestAnimationFrame(this._updateRAFTime.bind(this));\n }\n\n _init(){\n if(!window.Worker)return;\n\n //If page visibility API not present fallback to using \"focus\" and \"blur\" event listeners.\n if (typeof document.hidden === \"undefined\") {\n window.addEventListener(\"focus\", this._gainedVisibility.bind(this));\n window.addEventListener(\"blur\", this._lostVisibility.bind(this));\n return;\n }\n //Otherwise we can use the visibility API to do the loose/gain focus properly\n document.addEventListener(\"visibilitychange\", ()=>{\n if (document.hidden === true) {\n this._lostVisibility();\n } else {\n this._gainedVisibility();\n }\n }, false);\n\n requestAnimationFrame(this._updateRAFTime.bind(this));\n }\n\n _updateWorkerTime(time){\n let dt = (time - this._previousWorkerTime) / 1000;\n if (dt !== 0) this._update(dt);\n this._previousWorkerTime = time;\n }\n\n _updateRAFTime(time){\n if (this._previousRAFTime === undefined)this._previousRAFTime = time;\n let dt = (time - this._previousRAFTime) / 1000;\n if (dt !== 0) this._update(dt);\n this._previousRAFTime = time;\n if(!this._useWebworker)requestAnimationFrame(this._updateRAFTime.bind(this));\n }\n\n _update(dt){\n for(let i = 0; i < this._updateables.length; i++){\n this._updateables[i]._update(parseFloat(dt));\n\n }\n }\n\n register(updateable){\n this._updateables.push(updateable);\n if (this._active === false){\n this._active = true;\n this._init();\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","import aaf_video_scale from \"./aaf_video_scale.js\";\nimport crossfade from \"./crossfade.js\";\nimport horizontalWipe from \"./horizontalWipe.js\";\nimport verticalWipe from \"./verticalWipe.js\";\nimport randomDissolve from \"./randomDissolve.js\";\nimport toColorAndBackFade from \"./toColorAndBackFade.js\";\nimport starWipe from \"./starWipe.js\";\nimport combine from \"./combine.js\";\nimport colorThreshold from \"./colorThreshold.js\";\nimport monochrome from \"./monochrome.js\";\nimport horizontalBlur from \"./horizontalBlur.js\";\nimport verticalBlur from \"./verticalBlur.js\";\nimport aaf_video_flop from \"./aaf_video_flop.js\";\nimport aaf_video_flip from \"./aaf_video_flip.js\";\nimport aaf_video_position from \"./aaf_video_position.js\";\nimport aaf_video_crop from \"./aaf_video_crop.js\";\nimport staticDissolve from \"./staticDissolve.js\";\nimport staticEffect from \"./staticEffect.js\";\nimport dreamfade from \"./dreamfade.js\";\nimport opacity from \"./opacity.js\";\nimport crop from \"./crop.js\";\n\nlet DEFINITIONS = {\n AAF_VIDEO_SCALE: aaf_video_scale,\n CROSSFADE: crossfade,\n DREAMFADE: dreamfade,\n HORIZONTAL_WIPE:horizontalWipe,\n VERTICAL_WIPE:verticalWipe,\n RANDOM_DISSOLVE:randomDissolve,\n STATIC_DISSOLVE:staticDissolve,\n STATIC_EFFECT:staticEffect,\n TO_COLOR_AND_BACK: toColorAndBackFade,\n STAR_WIPE:starWipe,\n COMBINE: combine,\n COLORTHRESHOLD: colorThreshold,\n MONOCHROME: monochrome,\n HORIZONTAL_BLUR:horizontalBlur,\n VERTICAL_BLUR:verticalBlur,\n AAF_VIDEO_CROP: aaf_video_crop,\n AAF_VIDEO_POSITION: aaf_video_position,\n AAF_VIDEO_FLIP: aaf_video_flip,\n AAF_VIDEO_FLOP: aaf_video_flop,\n OPACITY: opacity,\n CROP: crop\n};\n\nexport default DEFINITIONS;\n\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/definitions.js","let aaf_video_scale = {\n \"title\":\"AAF Video Scale Effect\",\n \"description\": \"A scale effect based on the AAF spec.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float scaleX;\\\n uniform float scaleY;\\\n varying vec2 v_texCoord;\\\n varying float v_progress;\\\n void main(){\\\n vec2 pos = vec2(v_texCoord[0]*1.0/scaleX - (1.0/scaleX/2.0 -0.5), v_texCoord[1]*1.0/scaleY - (1.0/scaleY/2.0 -0.5));\\\n vec4 color = texture2D(u_image, pos);\\\n if (pos[0] < 0.0 || pos[0] > 1.0 || pos[1] < 0.0 || pos[1] > 1.0){\\\n color = vec4(0.0,0.0,0.0,0.0);\\\n }\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"scaleX\":{\"type\":\"uniform\", \"value\":1.0},\n \"scaleY\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_scale;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_scale.js","let crossfade = {\n \"title\":\"Cross-Fade\",\n \"description\": \"A cross-fade effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n color_a[0] *= (1.0 - mix);\\\n color_a[1] *= (1.0 - mix);\\\n color_a[2] *= (1.0 - mix);\\\n color_a[3] *= (1.0 - mix);\\\n color_b[0] *= mix;\\\n color_b[1] *= mix;\\\n color_b[2] *= mix;\\\n color_b[3] *= mix;\\\n gl_FragColor = color_a + color_b;\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default crossfade;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/crossfade.js","let horizontal_wipe = {\n \"title\":\"Horizontal Wipe\",\n \"description\": \"A horizontal wipe effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n if (v_texCoord[0] > mix){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default horizontal_wipe;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/horizontalWipe.js","let verticalWipe = {\n \"title\":\"vertical Wipe\",\n \"description\": \"A vertical wipe effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n if (v_texCoord[1] > mix){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default verticalWipe;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/verticalWipe.js","let randomDissolve = {\n \"title\":\"Random Dissolve\",\n \"description\": \"A random dissolve effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n float rand(vec2 co){\\\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\\\n }\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n if (clamp(rand(v_texCoord), 0.01, 1.001) > mix){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default randomDissolve;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/randomDissolve.js","let toColorAndBackFade = {\n \"title\":\"To Color And Back Fade\",\n \"description\": \"A fade to black and back effect. Setting mix to 0.5 is a fully solid color frame. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n uniform vec4 color;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n float mix_amount = (mix *2.0) - 1.0;\\\n if(mix_amount < 0.0){\\\n gl_FragColor = abs(mix_amount) * color_a + (1.0 - abs(mix_amount)) * color;\\\n } else {\\\n gl_FragColor = mix_amount * color_b + (1.0 - mix_amount) * color;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0},\n \"color\":{\"type\":\"uniform\", \"value\":[0.0,0.0,0.0,0.0]}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\nexport default toColorAndBackFade;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/toColorAndBackFade.js","let starWipe = {\n \"title\":\"Star Wipe Fade\",\n \"description\": \"A classic star wipe transistion. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n float sign (vec2 p1, vec2 p2, vec2 p3){\\\n return (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]);\\\n }\\\n bool pointInTriangle(vec2 pt, vec2 v1, vec2 v2, vec2 v3){\\\n bool b1, b2, b3;\\\n b1 = sign(pt, v1, v2) < 0.0;\\\n b2 = sign(pt, v2, v3) < 0.0;\\\n b3 = sign(pt, v3, v1) < 0.0;\\\n return ((b1 == b2) && (b2 == b3));\\\n }\\\n vec2 rotatePointAboutPoint(vec2 point, vec2 pivot, float angle){\\\n float s = sin(angle);\\\n float c = cos(angle);\\\n float x = point[0] - pivot[0];\\\n float y = point[1] - pivot[1];\\\n float new_x = x * c - y * s;\\\n float new_y = x * s + y * c;\\\n return vec2(new_x + pivot[0], new_y+pivot[1]);\\\n }\\\n \\\n void main(){\\\n vec4 color_a = texture2D(u_image_b, v_texCoord);\\\n vec4 color_b = texture2D(u_image_a, v_texCoord);\\\n vec2 t0_p0,t0_p1,t0_p2,t1_p0,t1_p1,t1_p2,t2_p0,t2_p1,t2_p2,t3_p0,t3_p1,t3_p2;\\\n vec2 t4_p0,t4_p1,t4_p2,t5_p0,t5_p1,t5_p2,t6_p0,t6_p1,t6_p2,t7_p0,t7_p1,t7_p2;\\\n \\\n \\\n t0_p0 = vec2(0.0, 0.25) * clamp(mix,0.0,1.0) * 2.0 + vec2(0.5,0.5);\\\n t0_p1 = vec2(0.0, -0.25) * clamp(mix,0.0,1.0) * 2.0 + vec2(0.5,0.5);\\\n t0_p2 = vec2(1.0, 0.0) * clamp(mix,0.0,1.0) * 2.0 + vec2(0.5,0.5);\\\n \\\n t1_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854);\\\n t1_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854);\\\n t1_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854);\\\n \\\n t2_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 2.0);\\\n t2_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 2.0);\\\n t2_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 2.0);\\\n \\\n t3_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 3.0);\\\n t3_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 3.0);\\\n t3_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 3.0);\\\n \\\n t4_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 4.0);\\\n t4_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 4.0);\\\n t4_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 4.0);\\\n \\\n t5_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 5.0);\\\n t5_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 5.0);\\\n t5_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 5.0);\\\n \\\n t6_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 6.0);\\\n t6_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 6.0);\\\n t6_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 6.0);\\\n \\\n t7_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 7.0);\\\n t7_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 7.0);\\\n t7_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 7.0);\\\n \\\n if(mix > 0.99){\\\n gl_FragColor = color_a;\\\n return;\\\n }\\\n if(mix < 0.01){\\\n gl_FragColor = color_b;\\\n return;\\\n }\\\n if(pointInTriangle(v_texCoord, t0_p0, t0_p1, t0_p2) || pointInTriangle(v_texCoord, t1_p0, t1_p1, t1_p2) || pointInTriangle(v_texCoord, t2_p0, t2_p1, t2_p2) || pointInTriangle(v_texCoord, t3_p0, t3_p1, t3_p2) || pointInTriangle(v_texCoord, t4_p0, t4_p1, t4_p2) || pointInTriangle(v_texCoord, t5_p0, t5_p1, t5_p2) || pointInTriangle(v_texCoord, t6_p0, t6_p1, t6_p2) || pointInTriangle(v_texCoord, t7_p0, t7_p1, t7_p2)){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default starWipe;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/starWipe.js","let combine = {\n \"title\":\"Combine\",\n \"description\": \"A basic effect which renders the input to the output, Typically used as a combine node for layering up media with alpha transparency.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float a;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"a\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default combine;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/combine.js","let colorThreshold = {\n \"title\":\"Color Threshold\",\n \"description\": \"Turns all pixels with a greater value than the specified threshold transparent.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float a;\\\n uniform vec3 colorAlphaThreshold;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n if (color[0] > colorAlphaThreshold[0] && color[1]> colorAlphaThreshold[1] && color[2]> colorAlphaThreshold[2]){\\\n color = vec4(0.0,0.0,0.0,0.0);\\\n }\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"a\":{\"type\":\"uniform\", \"value\":0.0},\n \"colorAlphaThreshold\":{\"type\":\"uniform\", \"value\":[0.0,0.55,0.0]}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default colorThreshold;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/colorThreshold.js","let monochrome = {\n \"title\":\"Monochrome\",\n \"description\": \"Change images to a single chroma (e.g can be used to make a black & white filter). Input color mix and output color mix can be adjusted.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform vec3 inputMix;\\\n uniform vec3 outputMix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n float mono = color[0]*inputMix[0] + color[1]*inputMix[1] + color[2]*inputMix[2];\\\n color[0] = mono * outputMix[0];\\\n color[1] = mono * outputMix[1];\\\n color[2] = mono * outputMix[2];\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"inputMix\":{\"type\":\"uniform\", \"value\":[0.4,0.6,0.2]},\n \"outputMix\":{\"type\":\"uniform\", \"value\":[1.0,1.0,1.0]}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default monochrome;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/monochrome.js","let horizontal_blur = {\n \"title\":\"Horizontal Blur\",\n \"description\": \"A horizontal blur effect. Adpated from http://xissburg.com/faster-gaussian-blur-in-glsl/\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n uniform float blurAmount;\\\n varying vec2 v_texCoord;\\\n varying vec2 v_blurTexCoords[14];\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n v_blurTexCoords[ 0] = v_texCoord + vec2(-0.028 * blurAmount, 0.0);\\\n v_blurTexCoords[ 1] = v_texCoord + vec2(-0.024 * blurAmount, 0.0);\\\n v_blurTexCoords[ 2] = v_texCoord + vec2(-0.020 * blurAmount, 0.0);\\\n v_blurTexCoords[ 3] = v_texCoord + vec2(-0.016 * blurAmount, 0.0);\\\n v_blurTexCoords[ 4] = v_texCoord + vec2(-0.012 * blurAmount, 0.0);\\\n v_blurTexCoords[ 5] = v_texCoord + vec2(-0.008 * blurAmount, 0.0);\\\n v_blurTexCoords[ 6] = v_texCoord + vec2(-0.004 * blurAmount, 0.0);\\\n v_blurTexCoords[ 7] = v_texCoord + vec2( 0.004 * blurAmount, 0.0);\\\n v_blurTexCoords[ 8] = v_texCoord + vec2( 0.008 * blurAmount, 0.0);\\\n v_blurTexCoords[ 9] = v_texCoord + vec2( 0.012 * blurAmount, 0.0);\\\n v_blurTexCoords[10] = v_texCoord + vec2( 0.016 * blurAmount, 0.0);\\\n v_blurTexCoords[11] = v_texCoord + vec2( 0.020 * blurAmount, 0.0);\\\n v_blurTexCoords[12] = v_texCoord + vec2( 0.024 * blurAmount, 0.0);\\\n v_blurTexCoords[13] = v_texCoord + vec2( 0.028 * blurAmount, 0.0);\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n varying vec2 v_blurTexCoords[14];\\\n void main(){\\\n gl_FragColor = vec4(0.0);\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 0])*0.0044299121055113265;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 1])*0.00895781211794;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 2])*0.0215963866053;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 3])*0.0443683338718;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 4])*0.0776744219933;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 5])*0.115876621105;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 6])*0.147308056121;\\\n gl_FragColor += texture2D(u_image, v_texCoord )*0.159576912161;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 7])*0.147308056121;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 8])*0.115876621105;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 9])*0.0776744219933;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[10])*0.0443683338718;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[11])*0.0215963866053;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[12])*0.00895781211794;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[13])*0.0044299121055113265;\\\n }\",\n \"properties\":{\n \"blurAmount\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default horizontal_blur;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/horizontalBlur.js","let verticalBlur = {\n \"title\":\"Vertical Blur\",\n \"description\": \"A vertical blur effect. Adpated from http://xissburg.com/faster-gaussian-blur-in-glsl/\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n uniform float blurAmount;\\\n varying vec2 v_blurTexCoords[14];\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n v_blurTexCoords[ 0] = v_texCoord + vec2(0.0,-0.028 * blurAmount);\\\n v_blurTexCoords[ 1] = v_texCoord + vec2(0.0,-0.024 * blurAmount);\\\n v_blurTexCoords[ 2] = v_texCoord + vec2(0.0,-0.020 * blurAmount);\\\n v_blurTexCoords[ 3] = v_texCoord + vec2(0.0,-0.016 * blurAmount);\\\n v_blurTexCoords[ 4] = v_texCoord + vec2(0.0,-0.012 * blurAmount);\\\n v_blurTexCoords[ 5] = v_texCoord + vec2(0.0,-0.008 * blurAmount);\\\n v_blurTexCoords[ 6] = v_texCoord + vec2(0.0,-0.004 * blurAmount);\\\n v_blurTexCoords[ 7] = v_texCoord + vec2(0.0, 0.004 * blurAmount);\\\n v_blurTexCoords[ 8] = v_texCoord + vec2(0.0, 0.008 * blurAmount);\\\n v_blurTexCoords[ 9] = v_texCoord + vec2(0.0, 0.012 * blurAmount);\\\n v_blurTexCoords[10] = v_texCoord + vec2(0.0, 0.016 * blurAmount);\\\n v_blurTexCoords[11] = v_texCoord + vec2(0.0, 0.020 * blurAmount);\\\n v_blurTexCoords[12] = v_texCoord + vec2(0.0, 0.024 * blurAmount);\\\n v_blurTexCoords[13] = v_texCoord + vec2(0.0, 0.028 * blurAmount);\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n varying vec2 v_blurTexCoords[14];\\\n void main(){\\\n gl_FragColor = vec4(0.0);\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 0])*0.0044299121055113265;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 1])*0.00895781211794;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 2])*0.0215963866053;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 3])*0.0443683338718;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 4])*0.0776744219933;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 5])*0.115876621105;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 6])*0.147308056121;\\\n gl_FragColor += texture2D(u_image, v_texCoord )*0.159576912161;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 7])*0.147308056121;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 8])*0.115876621105;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 9])*0.0776744219933;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[10])*0.0443683338718;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[11])*0.0215963866053;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[12])*0.00895781211794;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[13])*0.0044299121055113265;\\\n }\",\n \"properties\":{\n \"blurAmount\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default verticalBlur;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/verticalBlur.js","let aaf_video_flop = {\n \"title\":\"AAF Video Flop Effect\",\n \"description\": \"A flop effect based on the AAF spec. Mirrors the image in the y-axis\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n void main(){\\\n vec2 coord = vec2(1.0 - v_texCoord[0] ,v_texCoord[1]);\\\n vec4 color = texture2D(u_image, coord);\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_flop;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_flop.js","let aaf_video_flip = {\n \"title\":\"AAF Video Scale Effect\",\n \"description\": \"A flip effect based on the AAF spec. Mirrors the image in the x-axis\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n void main(){\\\n vec2 coord = vec2(v_texCoord[0] ,1.0 - v_texCoord[1]);\\\n vec4 color = texture2D(u_image, coord);\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_flip;\n\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_flip.js","let aaf_video_position = {\n \"title\":\"AAF Video Position Effect\",\n \"description\": \"A position effect based on the AAF spec.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float positionOffsetX;\\\n uniform float positionOffsetY;\\\n varying vec2 v_texCoord;\\\n varying float v_progress;\\\n void main(){\\\n vec2 pos = vec2(v_texCoord[0] - positionOffsetX/2.0, v_texCoord[1] - positionOffsetY/2.0);\\\n vec4 color = texture2D(u_image, pos);\\\n if (pos[0] < 0.0 || pos[0] > 1.0 || pos[1] < 0.0 || pos[1] > 1.0){\\\n color = vec4(0.0,0.0,0.0,0.0);\\\n }\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"positionOffsetX\":{\"type\":\"uniform\", \"value\":0.0},\n \"positionOffsetY\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_position;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_position.js","let aaf_video_crop = {\n \"title\":\"AAF Video Crop Effect\",\n \"description\": \"A crop effect based on the AAF spec.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float cropLeft;\\\n uniform float cropRight;\\\n uniform float cropTop;\\\n uniform float cropBottom;\\\n varying vec2 v_texCoord;\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n if (v_texCoord[0] < (cropLeft+1.0)/2.0) color = vec4(0.0,0.0,0.0,0.0);\\\n if (v_texCoord[0] > (cropRight+1.0)/2.0) color = vec4(0.0,0.0,0.0,0.0);\\\n if (v_texCoord[1] < (-cropBottom+1.0)/2.0) color = vec4(0.0,0.0,0.0,0.0);\\\n if (v_texCoord[1] > (-cropTop+1.0)/2.0) color = vec4(0.0,0.0,0.0,0.0);\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"cropLeft\":{\"type\":\"uniform\", \"value\":-1.0},\n \"cropRight\":{\"type\":\"uniform\", \"value\":1.0},\n \"cropTop\":{\"type\":\"uniform\", \"value\": -1.0},\n \"cropBottom\":{\"type\":\"uniform\", \"value\": 1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_crop;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_crop.js","let staticDissolve = {\n \"title\":\"Static Dissolve\",\n \"description\": \"A static dissolve effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n uniform float currentTime;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n float rand(vec2 co, float currentTime){\\\n return fract(sin(dot(co.xy,vec2(12.9898,78.233))+currentTime) * 43758.5453);\\\n }\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n if (clamp(rand(v_texCoord, currentTime), 0.01, 1.001) > mix){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default staticDissolve;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/staticDissolve.js","let staticEffect = {\n \"title\":\"Static\",\n \"description\": \"A static effect to add pseudo random noise to a video\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float currentTime;\\\n uniform float amount;\\\n varying vec2 v_texCoord;\\\n uniform vec3 weight;\\\n float rand(vec2 co, float currentTime){\\\n return fract(sin(dot(co.xy,vec2(12.9898,78.233))+currentTime) * 43758.5453);\\\n }\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n color[0] = color[0] + (2.0*(clamp(rand(v_texCoord, currentTime), 0.01, 1.001)-0.5)) * weight[0] * amount;\\\n color[1] = color[1] + (2.0*(clamp(rand(v_texCoord, currentTime), 0.01, 1.001)-0.5)) * weight[1] * amount;\\\n color[2] = color[2] + (2.0*(clamp(rand(v_texCoord, currentTime), 0.01, 1.001)-0.5)) * weight[2] *amount;\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"weight\":{\"type\":\"uniform\", \"value\":[1.0,1.0,1.0]},\n \"amount\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default staticEffect;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/staticEffect.js","let dreamfade = {\n \"title\":\"Dream-Fade\",\n \"description\": \"A wobbly dream effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n float wobble = 1.0 - abs((mix*2.0)-1.0);\\\n vec2 pos = vec2(v_texCoord[0] + ((sin(v_texCoord[1]*(10.0*wobble*3.14) + wobble*10.0)/13.0)), v_texCoord[1]);\\\n vec4 color_a = texture2D(u_image_a, pos);\\\n vec4 color_b = texture2D(u_image_b, pos);\\\n color_a[0] *= (1.0 - mix);\\\n color_a[1] *= (1.0 - mix);\\\n color_a[2] *= (1.0 - mix);\\\n color_a[3] *= (1.0 - mix);\\\n color_b[0] *= mix;\\\n color_b[1] *= mix;\\\n color_b[2] *= mix;\\\n color_b[3] *= mix;\\\n gl_FragColor = color_a + color_b;\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default dreamfade;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/dreamfade.js","const opacity = {\n \"title\": \"Opacity\",\n \"description\": \"Sets the opacity of an input.\",\n \"vertexShader\": `\n attribute vec2 a_position;\n attribute vec2 a_texCoord;\n varying vec2 v_texCoord;\n void main() {\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\n v_texCoord = a_texCoord;\n }`,\n \"fragmentShader\": `\n precision mediump float;\n uniform sampler2D u_image;\n uniform float opacity;\n varying vec2 v_texCoord;\n varying float v_opacity;\n void main(){\n vec4 color = texture2D(u_image, v_texCoord);\n color[3] *= opacity;\n gl_FragColor = color;\n }`,\n \"properties\": {\n \"opacity\": {\"type\": \"uniform\", \"value\": 0.7},\n },\n \"inputs\": [\"u_image\"],\n};\n\nexport default opacity;\n\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/opacity.js","let crop = {\n \"title\":\"Primer Simple Crop\",\n \"description\": \"A simple crop processors for primer\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float x;\\\n uniform float y;\\\n uniform float width;\\\n uniform float height;\\\n varying vec2 v_texCoord;\\\n varying float v_progress;\\\n void main(){\\\n vec2 pos = (((v_texCoord)*vec2(width, height)) + vec2(0, 1.0-height)) +vec2(x,-y);\\\n vec4 color = texture2D(u_image, pos);\\\n if (pos[0] < 0.0 || pos[0] > 1.0 || pos[1] < 0.0 || pos[1] > 1.0){\\\n color = vec4(0.0,0.0,0.0,0.0);\\\n }\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"x\":{type:\"uniform\", value:0.0},\n \"y\":{type:\"uniform\", value:0.0},\n \"width\":{type:\"uniform\", value:1.0},\n \"height\":{type:\"uniform\", value:1.0},\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default crop;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/crop.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nclass GraphNode {\n /**\n * Base class from which all processing and source nodes are derrived.\n */\n constructor(gl, renderGraph, inputNames, limitConnections=false){\n this._renderGraph = renderGraph;\n this._limitConnections = limitConnections;\n this._inputNames = inputNames;\n this._destroyed = false;\n\n //Setup WebGL output texture\n this._gl = gl;\n this._renderGraph = renderGraph;\n this._rendered =false;\n this._displayName = \"GraphNode\";\n }\n\n /**\n * Get a string representation of the class name.\n *\n * @return String A string of the class name.\n */ \n get displayName(){\n return this._displayName;\n }\n\n /**\n * Get the names of the inputs to this node.\n *\n * @return {String[]} An array of the names of the inputs ot the node.\n */ \n get inputNames(){\n return this._inputNames.slice();\n }\n\n /**\n * The maximum number of connections that can be made to this node. If there is not limit this will return Infinity.\n *\n * @return {number} The number of connections which can be made to this node.\n */\n get maximumConnections(){\n if (this._limitConnections ===false) return Infinity;\n return this._inputNames.length;\n }\n\n /**\n * Get an array of all the nodes which connect to this node.\n *\n * @return {GraphNode[]} An array of nodes which connect to this node.\n */\n get inputs(){\n let result = this._renderGraph.getInputsForNode(this);\n result = result.filter(function(n){return n !== undefined;});\n return result;\n }\n \n /**\n * Get an array of all the nodes which this node outputs to.\n *\n * @return {GraphNode[]} An array of nodes which this node connects to.\n */\n get outputs(){\n return this._renderGraph.getOutputsForNode(this);\n }\n\n /**\n * Get whether the node has been destroyed or not.\n *\n * @return {boolean} A true/false value of whather the node has been destoryed or not.\n */\n get destroyed(){\n return this._destroyed;\n }\n\n\n /**\n * Connect this node to the targetNode\n * \n * @param {GraphNode} targetNode - the node to connect.\n * @param {(number| String)} [targetPort] - the port on the targetNode to connect to, this can be an index, a string identifier, or undefined (in which case the next available port will be connected to).\n * \n */\n connect(targetNode, targetPort){\n return (this._renderGraph.registerConnection(this, targetNode, targetPort));\n }\n \n /**\n * Disconnect this node from the targetNode. If targetNode is undefind remove all out-bound connections.\n *\n * @param {GraphNode} [targetNode] - the node to disconnect from. If undefined, disconnect from all nodes.\n *\n */\n disconnect(targetNode){\n if (targetNode === undefined){\n let toRemove = this._renderGraph.getOutputsForNode(this);\n toRemove.forEach((target) => this._renderGraph.unregisterConnection(this, target));\n if (toRemove.length > 0) return true;\n return false;\n }\n return this._renderGraph.unregisterConnection(this, targetNode);\n }\n\n /**\n * Destory this node, removing it from the graph.\n */\n destroy(){\n this.disconnect();\n for (let input of this.inputs){\n input.disconnect(this);\n }\n this._destroyed = true;\n }\n}\n\nexport default GraphNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/graphnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport SourceNode, { SOURCENODESTATE } from \"./sourcenode\";\n\nclass ImageNode extends SourceNode {\n /**\n * Initialise an instance of an ImageNode.\n * This should not be called directly, but created through a call to videoContext.createImageNode();\n */\n constructor(src, gl, renderGraph, currentTime, preloadTime = 4, attributes = {}){\n super(src, gl, renderGraph, currentTime);\n this._preloadTime = preloadTime;\n this._attributes = attributes;\n this._textureUploaded = false;\n this._displayName = \"ImageNode\";\n }\n\n get elementURL(){\n return this._elementURL;\n }\n\n _load(){\n\n if (this._element !== undefined){\n for (var key in this._attributes) {\n this._element[key] = this._attributes[key];\n }\n return;\n }\n if (this._isResponsibleForElementLifeCycle){\n super._load();\n this._element = new Image();\n this._element.setAttribute(\"crossorigin\", \"anonymous\");\n this._element.src = this._elementURL;\n this._element.onload = () => {\n this._ready = true;\n this._triggerCallbacks(\"loaded\");\n };\n this._element.onerror = () => {\n console.error(\"ImageNode failed to load. url:\", this._elementURL);\n };\n\n for (let key in this._attributes) {\n this._element[key] = this._attributes[key];\n }\n }\n this._element.onerror = () => {\n console.debug(\"Error with element\", this._element);\n this._state = SOURCENODESTATE.error;\n //Event though there's an error ready should be set to true so the node can output transparenn\n this._ready = true;\n this._triggerCallbacks(\"error\");\n };\n }\n\n _unload(){\n super._unload();\n if (this._isResponsibleForElementLifeCycle){\n this._element.src = \"\";\n this._element.onerror = undefined;\n this._element = undefined;\n delete this._element;\n }\n this._ready = false;\n }\n\n _seek(time){\n super._seek(time);\n if (this.state === SOURCENODESTATE.playing || this.state === SOURCENODESTATE.paused){\n if (this._element === undefined) this._load();\n }\n if((this._state === SOURCENODESTATE.sequenced || this._state === SOURCENODESTATE.ended) && this._element !== undefined){\n this._unload();\n }\n }\n\n _update(currentTime){\n //if (!super._update(currentTime)) return false;\n if (this._textureUploaded){\n super._update(currentTime, false);\n }else{\n super._update(currentTime);\n }\n \n if (this._startTime - this._currentTime < this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();\n\n if (this._state === SOURCENODESTATE.playing){\n return true;\n } else if (this._state === SOURCENODESTATE.paused){\n return true;\n }\n else if (this._state === SOURCENODESTATE.ended && this._element !== undefined){\n this._unload();\n return false;\n }\n\n }\n\n}\n\nexport default ImageNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/SourceNodes/imagenode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport SourceNode, { SOURCENODESTATE } from \"./sourcenode\";\n\nclass CanvasNode extends SourceNode {\n /**\n * Initialise an instance of a CanvasNode.\n * This should not be called directly, but created through a call to videoContext.createCanvasNode();\n */\n constructor(canvas, gl, renderGraph, currentTime, preloadTime = 4){\n super(canvas, gl, renderGraph, currentTime);\n this._preloadTime = preloadTime;\n this._displayName = \"CanvasNode\";\n }\n\n _load(){\n super._load();\n this._ready = true;\n this._triggerCallbacks(\"loaded\"); \n }\n\n _unload(){\n super._unload();\n this._ready = false;\n }\n\n _seek(time){\n super._seek(time);\n if (this.state === SOURCENODESTATE.playing || this.state === SOURCENODESTATE.paused){\n if (this._element === undefined) this._load();\n this._ready = false;\n }\n if((this._state === SOURCENODESTATE.sequenced || this._state === SOURCENODESTATE.ended) && this._element !== undefined){\n this._unload();\n }\n }\n \n _update(currentTime){\n //if (!super._update(currentTime)) return false;\n super._update(currentTime);\n if (this._startTime - this._currentTime < this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();\n\n if (this._state === SOURCENODESTATE.playing){\n return true;\n } else if (this._state === SOURCENODESTATE.paused){\n return true;\n }\n else if (this._state === SOURCENODESTATE.ended && this._element !== undefined){\n this._unload();\n return false;\n }\n\n }\n\n}\n\nexport default CanvasNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/SourceNodes/canvasnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport ProcessingNode from \"./processingnode\";\nimport { createElementTexutre } from \"../utils.js\";\n\nclass CompositingNode extends ProcessingNode{\n /**\n * Initialise an instance of a Compositing Node. You should not instantiate this directly, but use VideoContest.createCompositingNode().\n */\n constructor(gl, renderGraph, definition){\n let placeholderTexture = createElementTexutre(gl);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));\n super(gl, renderGraph, definition, definition.inputs, false);\n this._placeholderTexture = placeholderTexture;\n this._displayName = \"CompositingNode\";\n }\n\n _render(){\n let gl = this._gl; \n gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this._texture,0);\n gl.clearColor(0, 0, 0, 0); // green;\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\n this.inputs.forEach((node) => {\n if (node === undefined)return;\n super._render();\n\n //map the input textures input the node\n var texture = node._texture;\n let textureOffset = 0;\n\n for(let mapping of this._inputTextureUnitMapping ){\n gl.activeTexture(mapping.textureUnit);\n let textureLocation = gl.getUniformLocation(this._program, mapping.name);\n gl.uniform1i(textureLocation, this._parameterTextureCount + textureOffset);\n textureOffset += 1;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n }\n\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n });\n \n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n}\n\nexport default CompositingNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ProcessingNodes/compositingnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport GraphNode from \"../graphnode\";\nimport { compileShader, createShaderProgram, createElementTexutre, updateTexture } from \"../utils.js\";\nimport { RenderException } from \"../exceptions.js\";\n\nclass ProcessingNode extends GraphNode{\n /**\n * Initialise an instance of a ProcessingNode.\n *\n * This class is not used directly, but is extended to create CompositingNodes, TransitionNodes, and EffectNodes.\n */\n constructor(gl, renderGraph, definition, inputNames, limitConnections){\n super(gl, renderGraph, inputNames, limitConnections);\n this._vertexShader = compileShader(gl, definition.vertexShader, gl.VERTEX_SHADER);\n this._fragmentShader = compileShader(gl, definition.fragmentShader, gl.FRAGMENT_SHADER);\n this._definition = definition;\n this._properties = {};//definition.properties;\n //copy definition properties\n for(let propertyName in definition.properties){\n let propertyValue = definition.properties[propertyName].value;\n //if an array then shallow copy it\n if(Object.prototype.toString.call(propertyValue) === \"[object Array]\"){\n propertyValue = definition.properties[propertyName].value.slice();\n }\n let propertyType = definition.properties[propertyName].type;\n this._properties[propertyName] = {type:propertyType, value:propertyValue};\n }\n\n this._inputTextureUnitMapping =[];\n this._maxTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n this._boundTextureUnits = 0;\n this._parameterTextureCount = 0;\n this._inputTextureCount = 0;\n this._texture = createElementTexutre(gl);\n gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGBA, gl.canvas.width, gl.canvas.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n //compile the shader\n this._program = createShaderProgram(gl, this._vertexShader, this._fragmentShader);\n\n //create and setup the framebuffer\n this._framebuffer = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this._texture,0);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n //create properties on this object for the passed properties\n for (let propertyName in this._properties){\n Object.defineProperty(this, propertyName, {\n get:function(){return this._properties[propertyName].value;},\n set:function(passedValue){this._properties[propertyName].value = passedValue;}\n });\n }\n\n //create texutres for any texture properties\n for (let propertyName in this._properties){\n let propertyValue = this._properties[propertyName].value;\n if (propertyValue instanceof Image){\n this._properties[propertyName].texture = createElementTexutre(gl);\n this._properties[propertyName].texutreUnit = gl.TEXTURE0 + this._boundTextureUnits;\n this._boundTextureUnits += 1;\n this._parameterTextureCount +=1;\n if (this._boundTextureUnits > this._maxTextureUnits){\n throw new RenderException(\"Trying to bind more than available textures units to shader\");\n }\n }\n }\n\n //calculate texutre units for input textures\n for(let inputName of definition.inputs){\n this._inputTextureUnitMapping.push({name:inputName, textureUnit:gl.TEXTURE0 + this._boundTextureUnits});\n this._boundTextureUnits += 1;\n this._inputTextureCount += 1;\n if (this._boundTextureUnits > this._maxTextureUnits){\n throw new RenderException(\"Trying to bind more than available textures units to shader\");\n }\n }\n\n\n //find the locations of the properties in the compiled shader\n for (let propertyName in this._properties){\n if (this._properties[propertyName].type === \"uniform\"){\n this._properties[propertyName].location = this._gl.getUniformLocation(this._program, propertyName);\n }\n }\n this._currentTimeLocation = this._gl.getUniformLocation(this._program, \"currentTime\");\n this._currentTime = 0;\n\n\n //Other setup\n let positionLocation = gl.getAttribLocation(this._program, \"a_position\");\n let buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.enableVertexAttribArray(positionLocation);\n gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);\n gl.bufferData(\n gl.ARRAY_BUFFER,\n new Float32Array([\n 1.0, 1.0,\n 0.0, 1.0,\n 1.0, 0.0,\n 1.0, 0.0,\n 0.0, 1.0,\n 0.0, 0.0]),\n gl.STATIC_DRAW);\n let texCoordLocation = gl.getAttribLocation(this._program, \"a_texCoord\");\n gl.enableVertexAttribArray(texCoordLocation);\n gl.vertexAttribPointer(texCoordLocation, 2, gl.FLOAT, false, 0, 0);\n this._displayName = \"ProcessingNode\";\n\n }\n\n /**\n * Sets the passed processing node property to the passed value.\n * @param {string} name - The name of the processing node parameter to modify.\n * @param {Object} value - The value to set it to.\n *\n * @example \n * var ctx = new VideoContext();\n * var monoNode = ctx.effect(VideoContext.DEFINITIONS.MONOCHROME);\n * monoNode.setProperty(\"inputMix\", [1.0,0.0,0.0]); //Just use red channel\n */\n setProperty(name, value){\n this._properties[name].value = value;\n }\n\n /**\n * Sets the passed processing node property to the passed value.\n * @param {string} name - The name of the processing node parameter to get.\n *\n * @example \n * var ctx = new VideoContext();\n * var monoNode = ctx.effect(VideoContext.DEFINITIONS.MONOCHROME);\n * console.log(monoNode.getProperty(\"inputMix\")); //Will output [0.4,0.6,0.2], the default value from the effect definition.\n * \n */\n getProperty(name){\n return this._properties[name].value;\n }\n\n /**\n * Destroy and clean-up the node.\n */\n destroy(){\n super.destroy();\n //destrpy texutres for any texture properties\n for (let propertyName in this._properties){\n let propertyValue = this._properties[propertyName].value;\n if (propertyValue instanceof Image){\n this._gl.deleteTexture(this._properties[propertyName].texture);\n this._texture = undefined;\n }\n }\n //Destroy main\n this._gl.deleteTexture(this._texture);\n this._texture = undefined;\n //Detach shaders\n this._gl.detachShader(this._program, this._vertexShader);\n this._gl.detachShader(this._program, this._fragmentShader);\n //Delete shaders\n this._gl.deleteShader(this._vertexShader);\n this._gl.deleteShader(this._fragmentShader);\n //Delete program\n this._gl.deleteProgram(this._program);\n //Delete Framebuffer\n this._gl.deleteFramebuffer(this._framebuffer);\n }\n\n _update(currentTime){\n this._currentTime = currentTime;\n }\n\n _seek(currentTime){\n this._currentTime = currentTime;\n }\n\n _render(){\n this._rendered = true;\n let gl = this._gl;\n gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);\n\n gl.useProgram(this._program);\n\n //upload the default uniforms\n gl.uniform1f(this._currentTimeLocation, parseFloat(this._currentTime));\n\n //upload/update the custom uniforms\n let textureOffset = 0;\n\n for (let propertyName in this._properties){\n let propertyValue = this._properties[propertyName].value;\n let propertyType = this._properties[propertyName].type;\n let propertyLocation = this._properties[propertyName].location;\n if (propertyType !== \"uniform\") continue;\n\n if (typeof propertyValue === \"number\"){\n gl.uniform1f(propertyLocation, propertyValue);\n }\n else if( Object.prototype.toString.call(propertyValue) === \"[object Array]\"){\n if(propertyValue.length === 1){\n gl.uniform1fv(propertyLocation, propertyValue);\n } else if(propertyValue.length === 2){\n gl.uniform2fv(propertyLocation, propertyValue);\n } else if(propertyValue.length === 3){\n gl.uniform3fv(propertyLocation, propertyValue);\n } else if(propertyValue.length === 4){\n gl.uniform4fv(propertyLocation, propertyValue);\n } else{\n console.debug(\"Shader parameter\", propertyName, \"is too long an array:\", propertyValue);\n }\n } else if(propertyValue instanceof Image){\n let texture = this._properties[propertyName].texture;\n let textureUnit = this._properties[propertyName].texutreUnit;\n updateTexture(gl, texture, propertyValue);\n\n gl.activeTexture(textureUnit);\n gl.uniform1i(propertyLocation, textureOffset);\n textureOffset += 1;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n }\n else{\n //TODO - add tests for textures\n /*gl.activeTexture(gl.TEXTURE0 + textureOffset);\n gl.uniform1i(parameterLoctation, textureOffset);\n gl.bindTexture(gl.TEXTURE_2D, textures[textureOffset-1]);*/\n }\n }\n\n }\n}\n\nexport default ProcessingNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ProcessingNodes/processingnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nexport function ConnectException(message){\n this.message = message;\n this.name = \"ConnectionException\";\n}\n\nexport function RenderException(message){\n this.message = message;\n this.name = \"RenderException\";\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/exceptions.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport ProcessingNode from \"../ProcessingNodes/processingnode\";\n\nclass DestinationNode extends ProcessingNode {\n /**\n * Initialise an instance of a DestinationNode. \n *\n * There should only be a single instance of a DestinationNode per VideoContext instance. An VideoContext's destination can be accessed like so: videoContext.desitnation.\n * \n * You should not instantiate this directly.\n */\n constructor(gl, renderGraph){ \n \n let vertexShader = \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\";\n\n let fragmentShader = \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n varying float v_progress;\\\n void main(){\\\n gl_FragColor = texture2D(u_image, v_texCoord);\\\n }\";\n\n let deffinition = {fragmentShader:fragmentShader, vertexShader:vertexShader, properties:{}, inputs:[\"u_image\"]};\n\n super(gl, renderGraph, deffinition, deffinition.inputs, false);\n this._displayName = \"DestinationNode\";\n }\n\n _render(){\n let gl = this._gl; \n\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n gl.enable(gl.BLEND);\n gl.clearColor(0, 0, 0, 0.0); // green;\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n this.inputs.forEach((node)=>{\n super._render();\n //map the input textures input the node\n var texture = node._texture;\n let textureOffset = 0;\n\n for(let mapping of this._inputTextureUnitMapping ){\n gl.activeTexture(mapping.textureUnit);\n let textureLocation = gl.getUniformLocation(this._program, mapping.name);\n gl.uniform1i(textureLocation, this._parameterTextureCount + textureOffset);\n textureOffset += 1;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n }\n\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n });\n }\n}\n\nexport default DestinationNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/DestinationNode/destinationnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport ProcessingNode from \"./processingnode\";\nimport { createElementTexutre } from \"../utils.js\";\n\nclass EffectNode extends ProcessingNode{\n /**\n * Initialise an instance of an EffectNode. You should not instantiate this directly, but use VideoContest.createEffectNode().\n */\n constructor(gl, renderGraph, definition){\n let placeholderTexture = createElementTexutre(gl);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));\n\n super(gl, renderGraph, definition, definition.inputs, true);\n \n this._placeholderTexture = placeholderTexture;\n this._displayName = \"EffectNode\";\n }\n \n _render(){\n let gl = this._gl;\n gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this._texture,0);\n gl.clearColor(0, 0, 0, 0); // green;\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n super._render();\n\n let inputs = this._renderGraph.getInputsForNode(this);\n let textureOffset = 0;\n\n for (var i = 0; i < this._inputTextureUnitMapping.length; i++) {\n let inputTexture = this._placeholderTexture; \n let textureUnit = this._inputTextureUnitMapping[i].textureUnit;\n let textureName = this._inputTextureUnitMapping[i].name;\n if (i < inputs.length && inputs[i] !== undefined){\n inputTexture = inputs[i]._texture;\n }\n\n gl.activeTexture(textureUnit);\n let textureLocation = gl.getUniformLocation(this._program, textureName);\n gl.uniform1i(textureLocation, this._parameterTextureCount + textureOffset);\n textureOffset += 1;\n gl.bindTexture(gl.TEXTURE_2D, inputTexture);\n }\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n}\n\nexport default EffectNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ProcessingNodes/effectnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport EffectNode from \"./effectnode\";\n\nclass TransitionNode extends EffectNode{\n /**\n * Initialise an instance of a TransitionNode. You should not instantiate this directly, but use VideoContest.createTransitonNode().\n */\n constructor(gl, renderGraph, definition){\n super(gl, renderGraph, definition);\n this._transitions = {};\n \n //save a version of the original property values\n this._initialPropertyValues = {};\n for (let propertyName in this._properties){\n this._initialPropertyValues[propertyName] = this._properties[propertyName].value;\n }\n this._displayName = \"TransitionNode\";\n }\n\n _doesTransitionFitOnTimeline(testTransition){\n if (this._transitions[testTransition.property] === undefined) return true;\n for (let transition of this._transitions[testTransition.property]) {\n if (testTransition.start > transition.start && testTransition.start < transition.end)return false;\n if (testTransition.end > transition.start && testTransition.end < transition.end)return false;\n if(transition.start > testTransition.start && transition.start < testTransition.end) return false;\n if(transition.end > testTransition.start && transition.end < testTransition.end) return false;\n }\n return true;\n }\n\n _insertTransitionInTimeline(transition){\n if (this._transitions[transition.property] === undefined) this._transitions[transition.property] = [];\n this._transitions[transition.property].push(transition);\n\n this._transitions[transition.property].sort(function(a,b){\n return a.start - b.start;\n });\n }\n\n /**\n * Create a transition on the timeline.\n * \n * @param {number} startTime - The time at which the transition should start (relative to currentTime of video context).\n * @param {number} endTime - The time at which the transition should be completed by (relative to currentTime of video context).\n * @param {number} currentValue - The value to start the transition at.\n * @param {number} targetValue - The value to transition to by endTime.\n * @param {String} propertyName - The name of the property to clear transitions on, if undefined default to \"mix\".\n * \n * @return {Boolean} returns True if a transition is successfully added, false otherwise.\n */\n transition(startTime, endTime, currentValue, targetValue, propertyName=\"mix\"){\n let transition = {start:startTime + this._currentTime, end:endTime + this._currentTime, current:currentValue, target:targetValue, property:propertyName};\n if (!this._doesTransitionFitOnTimeline(transition))return false;\n this._insertTransitionInTimeline(transition);\n return true;\n }\n\n\n /**\n * Create a transition on the timeline at an absolute time.\n * \n * @param {number} startTime - The time at which the transition should start (relative to time 0).\n * @param {number} endTime - The time at which the transition should be completed by (relative to time 0).\n * @param {number} currentValue - The value to start the transition at.\n * @param {number} targetValue - The value to transition to by endTime.\n * @param {String} propertyName - The name of the property to clear transitions on, if undefined default to \"mix\".\n * \n * @return {Boolean} returns True if a transition is successfully added, false otherwise.\n */\n transitionAt(startTime, endTime, currentValue, targetValue, propertyName=\"mix\"){\n let transition = {start:startTime, end:endTime, current:currentValue, target:targetValue, property:propertyName};\n if (!this._doesTransitionFitOnTimeline(transition))return false;\n this._insertTransitionInTimeline(transition);\n return true;\n }\n\n /**\n * Clear all transistions on the passed property. If no property is defined clear all transitions on the node.\n * \n * @param {String} propertyName - The name of the property to clear transitions on, if undefined clear all transitions on the node.\n */\n clearTransitions(propertyName){\n if (propertyName === undefined){\n this._transitions = {};\n }else{\n this._transitions[propertyName] = [];\n }\n }\n \n /**\n * Clear a transistion on the passed property that the specified time lies within.\n * \n * @param {String} propertyName - The name of the property to clear a transition on.\n * @param {number} time - A time which lies within the property you're trying to clear.\n *\n * @return {Boolean} returns True if a transition is removed, false otherwise.\n */\n clearTransition(propertyName, time){\n let transitionIndex = undefined;\n for (var i = 0; i < this._transitions[propertyName].length; i++) {\n let transition = this._transitions[propertyName][i];\n if (time > transition.start && time < transition.end){\n transitionIndex = i;\n }\n }\n if(transitionIndex !== undefined){\n this._transitions[propertyName].splice(transitionIndex, 1);\n return true;\n }\n return false;\n }\n\n _update(currentTime){\n super._update(currentTime);\n for (let propertyName in this._transitions){\n let value = this[propertyName];\n if (this._transitions[propertyName].length > 0){\n value = this._transitions[propertyName][0].current;\n }\n let transitionActive = false;\n\n for (var i = 0; i < this._transitions[propertyName].length; i++) {\n let transition = this._transitions[propertyName][i];\n if (currentTime > transition.end){\n value = transition.target;\n continue;\n }\n\n if (currentTime > transition.start && currentTime < transition.end){\n let difference = transition.target - transition.current;\n let progress = (this._currentTime - transition.start)/(transition.end - transition.start);\n transitionActive = true;\n this[propertyName] = transition.current + (difference * progress);\n break;\n }\n }\n\n if(!transitionActive)this[propertyName] = value;\n }\n }\n}\n\nexport default TransitionNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ProcessingNodes/transitionnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport { ConnectException } from \"./exceptions.js\";\n\n\nclass RenderGraph {\n /**\n * Manages the rendering graph.\n */\n constructor(){\n this.connections = [];\n }\n\n /**\n * Get a list of nodes which are connected to the output of the passed node.\n * \n * @param {GraphNode} node - the node to get the outputs for.\n * @return {GraphNode[]} An array of the nodes which are connected to the output.\n */\n getOutputsForNode(node){\n let results = [];\n this.connections.forEach(function(connection){\n if (connection.source === node){\n results.push(connection.destination);\n }\n });\n return results;\n }\n \n /**\n * Get a list of nodes which are connected, by input name, to the given node. Array contains objects of the form: {\"source\":sourceNode, \"type\":\"name\", \"name\":inputName, \"destination\":destinationNode}.\n *\n * @param {GraphNode} node - the node to get the named inputs for.\n * @return {Object[]} An array of objects representing the nodes and connection type, which are connected to the named inputs for the node.\n */\n getNamedInputsForNode(node){\n let results = [];\n this.connections.forEach(function(connection){\n if (connection.destination === node && connection.type === \"name\"){\n results.push(connection);\n }\n });\n return results;\n }\n\n /**\n * Get a list of nodes which are connected, by z-index name, to the given node. Array contains objects of the form: {\"source\":sourceNode, \"type\":\"zIndex\", \"zIndex\":0, \"destination\":destinationNode}.\n * \n * @param {GraphNode} node - the node to get the z-index refernced inputs for.\n * @return {Object[]} An array of objects representing the nodes and connection type, which are connected by z-Index for the node.\n */\n getZIndexInputsForNode(node){\n let results = [];\n this.connections.forEach(function(connection){\n if (connection.destination === node && connection.type === \"zIndex\"){\n results.push(connection);\n }\n });\n results.sort(function(a,b){\n return a.zIndex - b.zIndex;\n });\n return results; \n }\n\n /**\n * Get a list of nodes which are connected as inputs to the given node. The length of the return array is always equal to the number of inputs for the node, with undefined taking the place of any inputs not connected.\n * \n * @param {GraphNode} node - the node to get the inputs for.\n * @return {GraphNode[]} An array of GraphNodes which are connected to the node.\n */\n getInputsForNode(node){\n let inputNames = node.inputNames; \n let results = [];\n let namedInputs = this.getNamedInputsForNode(node);\n let indexedInputs = this.getZIndexInputsForNode(node);\n\n if(node._limitConnections === true){\n for (let i = 0; i < inputNames.length; i++) {\n results[i] = undefined;\n }\n \n for(let connection of namedInputs){\n let index = inputNames.indexOf(connection.name);\n results[index] = connection.source;\n }\n let indexedInputsIndex = 0;\n for (let i = 0; i < results.length; i++) {\n if (results[i] === undefined && indexedInputs[indexedInputsIndex]!== undefined){\n results[i] = indexedInputs[indexedInputsIndex].source;\n indexedInputsIndex += 1;\n }\n }\n }else{\n for(let connection of namedInputs){\n results.push(connection.source);\n }\n for(let connection of indexedInputs){\n results.push(connection.source);\n }\n }\n return results;\n }\n\n /**\n * Check if a named input on a node is available to connect too.\n * @param {GraphNode} node - the node to check.\n * @param {String} inputName - the named input to check.\n */\n isInputAvailable(node, inputName){\n if (node._inputNames.indexOf(inputName) === -1) return false;\n for(let connection of this.connections){\n if (connection.type === \"name\"){\n if (connection.destination === node && connection.name === inputName){\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * Register a connection between two nodes.\n * \n * @param {GraphNode} sourceNode - the node to connect from.\n * @param {GraphNode} destinationNode - the node to connect to.\n * @param {(String | number)} [target] - the target port of the conenction, this could be a string to specfiy a specific named port, a number to specify a port by index, or undefined, in which case the next available port will be connected to.\n * @return {boolean} Will return true if connection succeeds otherwise will throw a ConnectException.\n */\n registerConnection(sourceNode, destinationNode, target){\n if (destinationNode.inputs.length >= destinationNode.inputNames.length && destinationNode._limitConnections === true){\n throw new ConnectException(\"Node has reached max number of inputs, can't connect\");\n }\n \n if (destinationNode._limitConnections === false){\n //check if connection is already made, if so raise a warning\n const inputs = this.getInputsForNode(destinationNode);\n if (inputs.includes(sourceNode)){\n console.debug(\"WARNING - node connected mutliple times, removing previous connection\");\n this.unregisterConnection(sourceNode, destinationNode);\n }\n }\n\n if (typeof target === \"number\"){\n //target is a specific\n this.connections.push({\"source\":sourceNode, \"type\":\"zIndex\", \"zIndex\":target, \"destination\":destinationNode});\n } else if (typeof target === \"string\" && destinationNode._limitConnections){\n //target is a named port\n\n //make sure named port is free\n if (this.isInputAvailable(destinationNode, target)){\n this.connections.push({\"source\":sourceNode, \"type\":\"name\", \"name\":target, \"destination\":destinationNode});\n }else{\n throw new ConnectException(\"Port \"+target+\" is already connected to\");\n }\n\n } else{\n //target is undefined so just make it a high zIndex\n let indexedConns = this.getZIndexInputsForNode(destinationNode);\n let index = 0;\n if (indexedConns.length > 0)index = indexedConns[indexedConns.length-1].zIndex +1;\n this.connections.push({\"source\":sourceNode, \"type\":\"zIndex\", \"zIndex\":index, \"destination\":destinationNode});\n }\n return true;\n }\n \n /**\n * Remove a connection between two nodes.\n * @param {GraphNode} sourceNode - the node to unregsiter connection from.\n * @param {GraphNode} destinationNode - the node to register connection to.\n * @return {boolean} Will return true if removing connection succeeds, or false if there was no connectionsction to remove.\n */\n unregisterConnection(sourceNode, destinationNode){\n let toRemove = [];\n \n this.connections.forEach(function(connection){\n if (connection.source === sourceNode && connection.destination === destinationNode){\n toRemove.push(connection);\n }\n });\n\n if (toRemove.length === 0) return false;\n\n toRemove.forEach((removeNode) => {\n let index = this.connections.indexOf(removeNode);\n this.connections.splice(index, 1);\n });\n\n return true;\n }\n\n static outputEdgesFor(node, connections){\n let results = [];\n for(let conn of connections){\n if (conn.source === node){\n results.push(conn);\n }\n }\n return results;\n }\n\n static inputEdgesFor(node, connections){\n let results = [];\n for(let conn of connections){\n if (conn.destination === node){\n results.push(conn);\n }\n }\n return results;\n }\n\n static getInputlessNodes(connections){\n let inputLess = [];\n for (let conn of connections){\n inputLess.push(conn.source);\n }\n for (let conn of connections){\n let index = inputLess.indexOf(conn.destination);\n if (index !== -1){\n inputLess.splice(index, 1);\n }\n }\n return inputLess;\n }\n}\n\nexport default RenderGraph;\n\n\n\n// WEBPACK FOOTER //\n// ./src/rendergraph.js","function stripHash (url){\n if (url.port === \"\" || url.port === undefined){\n return `${url.protocol}//${url.hostname}${url.pathname}`;\n } else {\n return `${url.protocol}//${url.hostname}:${url.port}${url.pathname}`;\n }\n}\n\nclass VideoElementCache {\n\n constructor(cache_size = 3) {\n this._elements = [];\n this._elementsInitialised = false;\n for (let i = 0; i < cache_size; i++) {\n let element = this._createElement(); \n this._elements.push(element);\n }\n }\n\n\n _createElement(){\n let videoElement = document.createElement(\"video\");\n videoElement.setAttribute(\"crossorigin\", \"anonymous\");\n videoElement.setAttribute(\"webkit-playsinline\", \"\");\n videoElement.setAttribute(\"playsinline\", \"\");\n videoElement.src = \"\";\n return videoElement;\n }\n\n init(){\n if (!this._elementsInitialised){\n for(let element of this._elements){\n try {\n element.play().then(()=>{\n }, (e)=>{\n if (e.name !== \"NotSupportedError\")throw(e);\n });\n } catch(e) {\n //console.log(e.name);\n }\n } \n }\n this._elementsInitialised = true;\n }\n\n get() {\n //Try and get an already intialised element.\n for (let element of this._elements) {\n // For some reason an uninitialised videoElement has its sr attribute set to the windows href. Hence the below check.\n if ((element.src === \"\" || element.src === undefined || element.src === stripHash(window.location)) && element.srcObject == null )return element;\n }\n //Fallback to creating a new element if non exists.\n console.debug(\"No available video element in the cache, creating a new one. This may break mobile, make your initial cache larger.\");\n let element = this._createElement();\n this._elements.push(element);\n this._elementsInitialised = false;\n return element;\n }\n\n get length(){\n return this._elements.length;\n }\n\n get unused(){\n let count = 0;\n for (let element of this._elements) {\n // For some reason an uninitialised videoElement has its sr attribute set to the windows href. Hence the below check.\n if ((element.src === \"\" || element.src === undefined || element.src === stripHash(window.location)) && element.srcObject == null )count += 1;\n }\n return count;\n }\n\n}\n\nexport default VideoElementCache;\n\n\n// WEBPACK FOOTER //\n// ./src/videoelementcache.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 1f6f6efa3622032d049e","webpack:///./src/videocontext.js","webpack:///./src/SourceNodes/videonode.js","webpack:///./src/SourceNodes/sourcenode.js","webpack:///./src/utils.js","webpack:///./src/Definitions/definitions.js","webpack:///./src/Definitions/aaf_video_scale.js","webpack:///./src/Definitions/crossfade.js","webpack:///./src/Definitions/horizontalWipe.js","webpack:///./src/Definitions/verticalWipe.js","webpack:///./src/Definitions/randomDissolve.js","webpack:///./src/Definitions/toColorAndBackFade.js","webpack:///./src/Definitions/starWipe.js","webpack:///./src/Definitions/combine.js","webpack:///./src/Definitions/colorThreshold.js","webpack:///./src/Definitions/monochrome.js","webpack:///./src/Definitions/horizontalBlur.js","webpack:///./src/Definitions/verticalBlur.js","webpack:///./src/Definitions/aaf_video_flop.js","webpack:///./src/Definitions/aaf_video_flip.js","webpack:///./src/Definitions/aaf_video_position.js","webpack:///./src/Definitions/aaf_video_crop.js","webpack:///./src/Definitions/staticDissolve.js","webpack:///./src/Definitions/staticEffect.js","webpack:///./src/Definitions/dreamfade.js","webpack:///./src/Definitions/opacity.js","webpack:///./src/Definitions/crop.js","webpack:///./src/graphnode.js","webpack:///./src/SourceNodes/imagenode.js","webpack:///./src/SourceNodes/canvasnode.js","webpack:///./src/ProcessingNodes/compositingnode.js","webpack:///./src/ProcessingNodes/processingnode.js","webpack:///./src/exceptions.js","webpack:///./src/DestinationNode/destinationnode.js","webpack:///./src/ProcessingNodes/effectnode.js","webpack:///./src/ProcessingNodes/transitionnode.js","webpack:///./src/rendergraph.js","webpack:///./src/videoelementcache.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;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AC;AACrI,iBAAI,OAAO,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;AACpC,iBAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC7B,iBAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;AAClC,oBAAO,OAAO,CAAC;UAClB;;;cAES,eAAE;AACR,oBAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;UAChC;;;cAES,eAAE;AACR,iBAAI,KAAK,GAAG,CAAC,CAAC;;;;;;AACd,uCAAoB,IAAI,CAAC,SAAS,mIAAE;yBAA3B,OAAO;;;AAEZ,yBAAI,CAAC,OAAO,CAAC,GAAG,KAAK,EAAE,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAM,OAAO,CAAC,SAAS,IAAI,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC;kBACjJ;;;;;;;;;;;;;;;;AACD,oBAAO,KAAK,CAAC;UAChB;;;YA9DC,iBAAiB;;;sBAkER,iBAAiB","file":"videocontext.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VideoContext\"] = factory();\n\telse\n\t\troot[\"VideoContext\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 1f6f6efa3622032d049e","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport VideoNode from \"./SourceNodes/videonode.js\";\nimport ImageNode from \"./SourceNodes/imagenode.js\";\nimport CanvasNode from \"./SourceNodes/canvasnode.js\";\nimport { SOURCENODESTATE } from \"./SourceNodes/sourcenode.js\";\nimport CompositingNode from \"./ProcessingNodes/compositingnode.js\";\nimport DestinationNode from \"./DestinationNode/destinationnode.js\";\nimport EffectNode from \"./ProcessingNodes/effectnode.js\";\nimport TransitionNode from \"./ProcessingNodes/transitionnode.js\";\nimport RenderGraph from \"./rendergraph.js\";\nimport VideoElementCache from \"./videoelementcache.js\";\nimport { createSigmaGraphDataFromRenderGraph, visualiseVideoContextTimeline, visualiseVideoContextGraph, createControlFormForNode, UpdateablesManager, exportToJSON, importSimpleEDL, snapshot, generateRandomId } from \"./utils.js\";\nimport DEFINITIONS from \"./Definitions/definitions.js\";\n\nlet updateablesManager = new UpdateablesManager();\n\n/**\n * VideoContext.\n * @module VideoContext\n */\nexport default class VideoContext{\n /**\n * 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.\n *\n * @param {Canvas} canvas - the canvas element to render the output to.\n * @param {function} initErrorCallback - a callback for if initialising the canvas failed.\n * @param {Object} options - a nuber of custom options which can be set on the VideoContext, generally best left as default.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement, function(){console.error(\"Sorry, your browser dosen\\'t support WebGL\");});\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(10);\n * ctx.play();\n *\n */\n constructor(canvas, initErrorCallback, options={\"preserveDrawingBuffer\":true, \"manualUpdate\":false, \"endOnLastSourceEnd\":true, useVideoElementCache:true, videoElementCacheSize:6, webglContextAttributes: {preserveDrawingBuffer: true, alpha: false }}){\n this._canvas = canvas;\n let manualUpdate = false;\n this.endOnLastSourceEnd = true;\n let webglContextAttributes = {preserveDrawingBuffer: true, alpha: false };\n\n if (\"manualUpdate\" in options) manualUpdate = options.manualUpdate;\n if (\"endOnLastSourceEnd\" in options) this._endOnLastSourceEnd = options.endOnLastSourceEnd;\n if (\"webglContextAttributes\" in options) webglContextAttributes = options.webglContextAttributes;\n\n if (webglContextAttributes.alpha === undefined) webglContextAttributes.alpha = false;\n if (webglContextAttributes.alpha === true){\n console.error(\"webglContextAttributes.alpha must be false for correct opeation\");\n }\n\n\n this._gl = canvas.getContext(\"experimental-webgl\", webglContextAttributes);\n if(this._gl === null){\n console.error(\"Failed to intialise WebGL.\");\n if(initErrorCallback)initErrorCallback();\n return;\n }\n\n // Initialise the video element cache\n if(options.useVideoElementCache === undefined) options.useVideoElementCache = true;\n this._useVideoElementCache = options.useVideoElementCache;\n if (this._useVideoElementCache){\n if (!options.videoElementCacheSize) options.videoElementCacheSize = 5;\n this._videoElementCache = new VideoElementCache(options.videoElementCacheSize);\n }\n \n // Create a unique ID for this VideoContext which can be used in the debugger.\n if(this._canvas.id) {\n if (typeof this._canvas.id === \"string\" || this._canvas.id instanceof String){\n this._id = canvas.id;\n }\n }\n if(this._id === undefined) this._id = generateRandomId();\n if (window.__VIDEOCONTEXT_REFS__ === undefined) window.__VIDEOCONTEXT_REFS__ = {};\n window.__VIDEOCONTEXT_REFS__[this._id] = this;\n\n\n this._renderGraph = new RenderGraph();\n this._sourceNodes = [];\n this._processingNodes = [];\n this._timeline = [];\n this._currentTime = 0;\n this._state = VideoContext.STATE.PAUSED;\n this._playbackRate = 1.0;\n this._volume = 1.0;\n this._sourcesPlaying = undefined;\n this._destinationNode = new DestinationNode(this._gl, this._renderGraph);\n\n this._callbacks = new Map();\n this._callbacks.set(\"stalled\", []);\n this._callbacks.set(\"update\", []);\n this._callbacks.set(\"ended\", []);\n this._callbacks.set(\"content\", []);\n this._callbacks.set(\"nocontent\", []);\n\n this._timelineCallbacks = [];\n\n if(!manualUpdate){\n updateablesManager.register(this);\n }\n }\n\n /**\n * Reurns an ID assigned to the VideoContext instance. This will either be the same id as the underlying canvas element,\n * or a uniquley generated one.\n */\n get id(){\n return this._id;\n }\n\n /**\n * Set the ID of the VideoContext instance. This should be unique.\n */\n set id(newID){\n delete window.__VIDEOCONTEXT_REFS__[this._id];\n if (window.__VIDEOCONTEXT_REFS__[newID] !== undefined) console.warn(\"Warning; setting id to that of an existing VideoContext instance.\");\n window.__VIDEOCONTEXT_REFS__[newID] = this;\n this._id = newID;\n }\n\n /**\n * Register a callback to happen at a specific point in time.\n * @param {number} time - the time at which to trigger the callback.\n * @param {Function} func - the callback to register.\n * @param {number} ordering - the order in which to call the callback if more than one is registered for the same time.\n */\n registerTimelineCallback(time, func, ordering= 0){\n this._timelineCallbacks.push({\"time\":time, \"func\":func, \"ordering\":ordering});\n }\n\n\n /**\n * Unregister a callback which happens at a specific point in time.\n * @param {Function} func - the callback to unregister.\n */\n unregisterTimelineCallback(func){\n let toRemove = [];\n for(let callback of this._timelineCallbacks){\n if (callback.func === func){\n toRemove.push(callback);\n }\n }\n for (let callback of toRemove){\n let index = this._timelineCallbacks.indexOf(callback);\n this._timelineCallbacks.splice(index, 1);\n }\n }\n\n /**\n * Regsiter a callback to listen to one of the following events: \"stalled\", \"update\", \"ended\", \"content\", \"nocontent\"\n *\n * \"stalled\" happend anytime playback is stopped due to unavailbale data for playing assets (i.e video still loading)\n * . \"update\" is called any time a frame is rendered to the screen. \"ended\" is called once plackback has finished\n * (i.e ctx.currentTime == ctx.duration). \"content\" is called a the start of a time region where there is content\n * playing out of one or more sourceNodes. \"nocontent\" is called at the start of any time region where the\n * VideoContext is still playing, but there are currently no activly playing soureces.\n *\n * @param {String} type - the event to register against (\"stalled\", \"update\", or \"ended\").\n * @param {Function} func - the callback to register.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * ctx.registerCallback(\"stalled\", function(){console.log(\"Playback stalled\");});\n * ctx.registerCallback(\"update\", function(){console.log(\"new frame\");});\n * ctx.registerCallback(\"ended\", function(){console.log(\"Playback ended\");});\n */\n registerCallback(type, func){\n if (!this._callbacks.has(type)) return false;\n this._callbacks.get(type).push(func);\n }\n\n /**\n * Remove a previously registed callback\n *\n * @param {Function} func - the callback to remove.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n *\n * //the callback\n * var updateCallback = function(){console.log(\"new frame\")};\n *\n * //register the callback\n * ctx.registerCallback(\"update\", updateCallback);\n * //then unregister it\n * ctx.unregisterCallback(updateCallback);\n *\n */\n unregisterCallback(func){\n for(let funcArray of this._callbacks.values()){\n let index = funcArray.indexOf(func);\n if (index !== -1){\n funcArray.splice(index, 1);\n return true;\n }\n }\n return false;\n }\n\n _callCallbacks(type){\n let funcArray = this._callbacks.get(type);\n for (let func of funcArray){\n func(this._currentTime);\n }\n }\n\n /**\n * Get the canvas that the VideoContext is using.\n *\n * @return {HTMLElement} The canvas that the VideoContext is using.\n *\n */\n get element(){\n return this._canvas;\n }\n\n /**\n * Get the current state.\n *\n * This will be either\n * - VideoContext.STATE.PLAYING: current sources on timeline are active\n * - VideoContext.STATE.PAUSED: all sources are paused\n * - VideoContext.STATE.STALLED: one or more sources is unable to play\n * - VideoContext.STATE.ENDED: all sources have finished playing\n * - VideoContext.STATE.BROKEN: the render graph is in a broken state\n * @return {number} The number representing the state.\n *\n */\n get state(){\n return this._state;\n }\n\n /**\n * Set the progress through the internal timeline.\n * Setting this can be used as a way to implement a scrubaable timeline.\n *\n * @param {number} currentTime - this is the currentTime to set the context to.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(20);\n * ctx.currentTime = 10; // seek 10 seconds in\n * ctx.play();\n *\n */\n set currentTime(currentTime){\n if (currentTime < this.duration && this._state === VideoContext.STATE.ENDED) this._state = VideoContext.STATE.PAUSED;\n\n if (typeof currentTime === \"string\" || currentTime instanceof String){\n currentTime = parseFloat(currentTime);\n }\n\n for (let i = 0; i < this._sourceNodes.length; i++) {\n this._sourceNodes[i]._seek(currentTime);\n }\n for (let i = 0; i < this._processingNodes.length; i++) {\n this._processingNodes[i]._seek(currentTime);\n }\n this._currentTime = currentTime;\n }\n\n /**\n * Get how far through the internal timeline has been played.\n *\n * Getting this value will give the current playhead position. Can be used for updating timelines.\n * @return {number} The time in seconds through the current playlist.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(10);\n * ctx.play();\n * setTimeout(function(){console.log(ctx.currentTime);},1000); //should print roughly 1.0\n *\n */\n get currentTime(){\n return this._currentTime;\n }\n\n /**\n * Get the time at which the last node in the current internal timeline finishes playing.\n *\n * @return {number} The end time in seconds of the last video node to finish playing.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * console.log(ctx.duration); //prints 0\n *\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(10);\n *\n * console.log(ctx.duration); //prints 10\n *\n * ctx.play();\n */\n get duration(){\n let maxTime = 0;\n for (let i = 0; i < this._sourceNodes.length; i++) {\n if (this._sourceNodes[i].state !== SOURCENODESTATE.waiting &&this._sourceNodes[i]._stopTime > maxTime){\n maxTime = this._sourceNodes[i]._stopTime;\n }\n }\n return maxTime;\n }\n\n\n /**\n * Get the final node in the render graph which represents the canvas to display content on to.\n *\n * This proprety is read-only and there can only ever be one destination node. Other nodes can connect to this but you cannot connect this node to anything.\n *\n * @return {DestinationNode} A graph node represnting the canvas to display the content on.\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.start(0);\n * videoNode.stop(10);\n * videoNode.connect(ctx.destination);\n *\n */\n get destination(){\n return this._destinationNode;\n }\n\n /**\n * Set the playback rate of the VideoContext instance.\n * This will alter the playback speed of all media elements played through the VideoContext.\n *\n * @param {number} rate - this is the playback rate.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.start(0);\n * videoNode.stop(10);\n * videoNode.connect(ctx.destination);\n * ctx.playbackRate = 2;\n * ctx.play(); // Double playback rate means this will finish playing in 5 seconds.\n */\n set playbackRate(rate){\n if (rate <= 0){\n throw new RangeError(\"playbackRate must be greater than 0\");\n }\n for (let node of this._sourceNodes) {\n if (node.constructor.name === \"VideoNode\"){\n node._globalPlaybackRate = rate;\n node._playbackRateUpdated = true;\n }\n }\n this._playbackRate = rate;\n }\n\n\n /**\n * Return the current playbackRate of the video context.\n * @return {number} A value representing the playbackRate. 1.0 by default.\n */\n get playbackRate(){\n return this._playbackRate;\n }\n\n\n /**\n * Set the volume of all VideoNode's created in the VideoContext.\n * @param {number} volume - the volume to apply to the video nodes.\n */\n set volume(vol){\n for (let node of this._sourceNodes){\n if(node instanceof VideoNode){\n node.volume = vol;\n }\n }\n this._volume = vol;\n }\n\n /**\n * Return the current volume of the video context.\n * @return {number} A value representing the volume. 1.0 by default.\n */\n get volume(){\n return this._volume;\n }\n\n /**\n * Start the VideoContext playing\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(10);\n * ctx.play();\n */\n play(){\n console.debug(\"VideoContext - playing\");\n //Initialise the video elemnt cache\n if (this._videoElementCache)this._videoElementCache.init();\n // set the state.\n this._state = VideoContext.STATE.PLAYING;\n return true;\n }\n\n /**\n * Pause playback of the VideoContext\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n * videoNode.connect(ctx.destination);\n * videoNode.start(0);\n * videoNode.stop(20);\n * ctx.currentTime = 10; // seek 10 seconds in\n * ctx.play();\n * setTimeout(function(){ctx.pause();}, 1000); //pause playback after roughly one second.\n */\n pause(){\n console.debug(\"VideoContext - pausing\");\n this._state = VideoContext.STATE.PAUSED;\n return true;\n }\n\n\n /**\n * Create a new node representing a video source\n *\n * @param {string|Video} - The URL or video element to create the video from.\n * @sourceOffset {number} - Offset into the start of the source video to start playing from.\n * @preloadTime {number} - How many seconds before the video is to be played to start loading it.\n * @videoElementAttributes {Object} - A dictionary of attributes to map onto the underlying video element.\n * @return {VideoNode} A new video node.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(\"video.mp4\");\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var videoElement = document.getElementById(\"video\");\n * var ctx = new VideoContext(canvasElement);\n * var videoNode = ctx.video(videoElement);\n */\n video(src, sourceOffset=0, preloadTime=4, videoElementAttributes={}){\n let videoNode = new VideoNode(src, this._gl, this._renderGraph, this._currentTime, this._playbackRate, sourceOffset, preloadTime, this._videoElementCache, videoElementAttributes);\n this._sourceNodes.push(videoNode);\n return videoNode;\n }\n\n /**\n * @depricated\n */\n createVideoSourceNode(src, sourceOffset=0, preloadTime=4, videoElementAttributes={}){\n this._depricate(\"Warning: createVideoSourceNode will be depricated in v1.0, please switch to using VideoContext.video()\");\n return this.video(src, sourceOffset, preloadTime, videoElementAttributes);\n }\n\n\n /**\n * Create a new node representing an image source\n * @param {string|Image} src - The url or image element to create the image node from.\n * @param {number} [preloadTime] - How long before a node is to be displayed to attmept to load it.\n * @param {Object} [imageElementAttributes] - Any attributes to be given to the underlying image element.\n * @return {ImageNode} A new image node.\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n * var imageNode = ctx.image(\"image.png\");\n *\n * @example\n * var canvasElement = document.getElementById(\"canvas\");\n * var imageElement = document.getElementById(\"image\");\n * var ctx = new VideoContext(canvasElement);\n * var imageNode = ctx.image(imageElement);\n */\n image(src, preloadTime=4, imageElementAttributes={}){\n let imageNode = new ImageNode(src, this._gl, this._renderGraph, this._currentTime, preloadTime, imageElementAttributes);\n this._sourceNodes.push(imageNode);\n return imageNode;\n }\n\n /**\n * @depricated\n */\n createImageSourceNode(src, sourceOffset=0, preloadTime=4, imageElementAttributes={}){\n this._depricate(\"Warning: createImageSourceNode will be depricated in v1.0, please switch to using VideoContext.image()\");\n return this.image(src, sourceOffset, preloadTime, imageElementAttributes);\n }\n\n\n /**\n * Create a new node representing a canvas source\n * @param {Canvas} src - The canvas element to create the canvas node from.\n * @return {CanvasNode} A new canvas node.\n */\n canvas(canvas){\n let canvasNode = new CanvasNode(canvas, this._gl, this._renderGraph, this._currentTime);\n this._sourceNodes.push(canvasNode);\n return canvasNode;\n }\n\n /**\n * @depricated\n */\n createCanvasSourceNode(canvas, sourceOffset=0, preloadTime=4){\n this._depricate(\"Warning: createCanvasSourceNode will be depricated in v1.0, please switch to using VideoContext.canvas()\");\n return this.canvas(canvas, sourceOffset, preloadTime);\n }\n\n\n /**\n * Create a new effect node.\n * @param {Object} definition - this is an object defining the shaders, inputs, and properties of the compositing node to create. Builtin definitions can be found by accessing VideoContext.DEFINITIONS.\n * @return {EffectNode} A new effect node created from the passed definition\n */\n effect(definition){\n let effectNode = new EffectNode(this._gl, this._renderGraph, definition);\n this._processingNodes.push(effectNode);\n return effectNode;\n }\n\n /**\n * @depricated\n */\n createEffectNode(definition){\n this._depricate(\"Warning: createEffectNode will be depricated in v1.0, please switch to using VideoContext.effect()\");\n return this.effect(definition);\n }\n\n /**\n * Create a new compositiing node.\n *\n * Compositing nodes are used for operations such as combining multiple video sources into a single track/connection for further processing in the graph.\n *\n * A compositing node is slightly different to other processing nodes in that it only has one input in it's definition but can have unlimited connections made to it.\n * The shader in the definition is run for each input in turn, drawing them to the output buffer. This means there can be no interaction between the spearte inputs to a compositing node, as they are individually processed in seperate shader passes.\n *\n * @param {Object} definition - this is an object defining the shaders, inputs, and properties of the compositing node to create. Builtin definitions can be found by accessing VideoContext.DEFINITIONS\n *\n * @return {CompositingNode} A new compositing node created from the passed definition.\n *\n * @example\n *\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n *\n * //A simple compositing node definition which just renders all the inputs to the output buffer.\n * var combineDefinition = {\n * vertexShader : \"\\\n * attribute vec2 a_position;\\\n * attribute vec2 a_texCoord;\\\n * varying vec2 v_texCoord;\\\n * void main() {\\\n * gl_Position = vec4(vec2(2.0,2.0)*vec2(1.0, 1.0), 0.0, 1.0);\\\n * v_texCoord = a_texCoord;\\\n * }\",\n * fragmentShader : \"\\\n * precision mediump float;\\\n * uniform sampler2D u_image;\\\n * uniform float a;\\\n * varying vec2 v_texCoord;\\\n * varying float v_progress;\\\n * void main(){\\\n * vec4 color = texture2D(u_image, v_texCoord);\\\n * gl_FragColor = color;\\\n * }\",\n * properties:{\n * \"a\":{type:\"uniform\", value:0.0},\n * },\n * inputs:[\"u_image\"]\n * };\n * //Create the node, passing in the definition.\n * var trackNode = videoCtx.compositor(combineDefinition);\n *\n * //create two videos which will play at back to back\n * var videoNode1 = ctx.video(\"video1.mp4\");\n * videoNode1.play(0);\n * videoNode1.stop(10);\n * var videoNode2 = ctx.video(\"video2.mp4\");\n * videoNode2.play(10);\n * videoNode2.stop(20);\n *\n * //Connect the nodes to the combine node. This will give a single connection representing the two videos which can\n * //be connected to other effects such as LUTs, chromakeyers, etc.\n * videoNode1.connect(trackNode);\n * videoNode2.connect(trackNode);\n *\n * //Don't do anything exciting, just connect it to the output.\n * trackNode.connect(ctx.destination);\n *\n */\n compositor(definition){\n let compositingNode = new CompositingNode(this._gl, this._renderGraph, definition);\n this._processingNodes.push(compositingNode);\n return compositingNode;\n }\n\n /**\n * @depricated\n */\n createCompositingNode(definition){\n this._depricate(\"Warning: createCompositingNode will be depricated in v1.0, please switch to using VideoContext.compositor()\");\n return this.compositor(definition);\n }\n\n\n\n /**\n * Create a new transition node.\n *\n * Transistion nodes are a type of effect node which have parameters which can be changed as events on the timeline.\n *\n * For example a transition node which cross-fades between two videos could have a \"mix\" property which sets the\n * progress through the transistion. Rather than having to write your own code to adjust this property at specfic\n * points in time a transition node has a \"transition\" function which takes a startTime, stopTime, targetValue, and a\n * propertyName (which will be \"mix\"). This will linearly interpolate the property from the curernt value to\n * tragetValue between the startTime and stopTime.\n *\n * @param {Object} definition - this is an object defining the shaders, inputs, and properties of the transition node to create.\n * @return {TransitionNode} A new transition node created from the passed definition.\n * @example\n *\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement);\n *\n * //A simple cross-fade node definition which cross-fades between two videos based on the mix property.\n * var crossfadeDefinition = {\n * vertexShader : \"\\\n * attribute vec2 a_position;\\\n * attribute vec2 a_texCoord;\\\n * varying vec2 v_texCoord;\\\n * void main() {\\\n * gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n * v_texCoord = a_texCoord;\\\n * }\",\n * fragmentShader : \"\\\n * precision mediump float;\\\n * uniform sampler2D u_image_a;\\\n * uniform sampler2D u_image_b;\\\n * uniform float mix;\\\n * varying vec2 v_texCoord;\\\n * varying float v_mix;\\\n * void main(){\\\n * vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n * vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n * color_a[0] *= mix;\\\n * color_a[1] *= mix;\\\n * color_a[2] *= mix;\\\n * color_a[3] *= mix;\\\n * color_b[0] *= (1.0 - mix);\\\n * color_b[1] *= (1.0 - mix);\\\n * color_b[2] *= (1.0 - mix);\\\n * color_b[3] *= (1.0 - mix);\\\n * gl_FragColor = color_a + color_b;\\\n * }\",\n * properties:{\n * \"mix\":{type:\"uniform\", value:0.0},\n * },\n * inputs:[\"u_image_a\",\"u_image_b\"]\n * };\n *\n * //Create the node, passing in the definition.\n * var transitionNode = videoCtx.transition(crossfadeDefinition);\n *\n * //create two videos which will overlap by two seconds\n * var videoNode1 = ctx.video(\"video1.mp4\");\n * videoNode1.play(0);\n * videoNode1.stop(10);\n * var videoNode2 = ctx.video(\"video2.mp4\");\n * videoNode2.play(8);\n * videoNode2.stop(18);\n *\n * //Connect the nodes to the transistion node.\n * videoNode1.connect(transitionNode);\n * videoNode2.connect(transitionNode);\n *\n * //Set-up a transition which happens at the crossover point of the playback of the two videos\n * transitionNode.transition(8,10,1.0,\"mix\");\n *\n * //Connect the transition node to the output\n * transitionNode.connect(ctx.destination);\n *\n * //start playback\n * ctx.play();\n */\n transition(definition){\n let transitionNode = new TransitionNode(this._gl, this._renderGraph, definition);\n this._processingNodes.push(transitionNode);\n return transitionNode;\n }\n\n /**\n * @depricated\n */\n createTransitionNode(definition){\n this._depricate(\"Warning: createTransitionNode will be depricated in v1.0, please switch to using VideoContext.transition()\");\n return this.transition(definition);\n }\n\n\n\n\n _isStalled(){\n for (let i = 0; i < this._sourceNodes.length; i++) {\n let sourceNode = this._sourceNodes[i];\n if (!sourceNode._isReady()){\n return true;\n }\n }\n return false;\n }\n\n\n /**\n * This allows manual calling of the update loop of the videoContext.\n *\n * @param {Number} dt - The difference in seconds between this and the previous calling of update.\n * @example\n *\n * var canvasElement = document.getElementById(\"canvas\");\n * var ctx = new VideoContext(canvasElement, undefined, {\"manualUpdate\" : true});\n *\n * var previousTime;\n * function update(time){\n * if (previousTime === undefined) previousTime = time;\n * var dt = (time - previousTime)/1000;\n * ctx.update(dt);\n * previousTime = time;\n * requestAnimationFrame(update);\n * }\n * update();\n *\n */\n update(dt){\n this._update(dt);\n }\n\n\n _update(dt){\n //Remove any destroyed nodes\n this._sourceNodes = this._sourceNodes.filter(sourceNode=>{\n if (!sourceNode.destroyed) return sourceNode;\n });\n\n this._processingNodes = this._processingNodes.filter(processingNode=>{\n if (!processingNode.destroyed) return processingNode;\n });\n\n\n if (this._state === VideoContext.STATE.PLAYING || this._state === VideoContext.STATE.STALLED || this._state === VideoContext.STATE.PAUSED) {\n this._callCallbacks(\"update\");\n\n if (this._state !== VideoContext.STATE.PAUSED){\n if (this._isStalled()){\n this._callCallbacks(\"stalled\");\n this._state = VideoContext.STATE.STALLED;\n }else{\n this._state = VideoContext.STATE.PLAYING;\n }\n }\n\n if(this._state === VideoContext.STATE.PLAYING){\n //Handle timeline callbacks.\n let activeCallbacks = new Map();\n for(let callback of this._timelineCallbacks){\n if (callback.time >= this.currentTime && callback.time < (this._currentTime + dt * this._playbackRate)){\n //group the callbacks by time\n if(!activeCallbacks.has(callback.time)) activeCallbacks.set(callback.time, []);\n activeCallbacks.get(callback.time).push(callback);\n }\n }\n\n\n //Sort the groups of callbacks by the times of the groups\n let timeIntervals = Array.from(activeCallbacks.keys());\n timeIntervals.sort(function(a, b){\n return a - b;\n });\n\n for (let t of timeIntervals){\n let callbacks = activeCallbacks.get(t);\n callbacks.sort(function(a,b){\n return a.ordering - b.ordering;\n });\n for(let callback of callbacks){\n callback.func();\n }\n }\n\n this._currentTime += dt * this._playbackRate;\n if(this._currentTime > this.duration && this._endOnLastSourceEnd){\n //Do an update od the sourcenodes in case anything in the \"ended\" callbacks modifes currentTime and sources haven't had a chance to stop.\n for (let i = 0; i < this._sourceNodes.length; i++) {\n this._sourceNodes[i]._update(this._currentTime);\n }\n this._state = VideoContext.STATE.ENDED;\n this._callCallbacks(\"ended\");\n }\n }\n\n let sourcesPlaying = false;\n\n for (let i = 0; i < this._sourceNodes.length; i++) {\n let sourceNode = this._sourceNodes[i];\n\n if(this._state === VideoContext.STATE.STALLED){\n if (sourceNode._isReady() && sourceNode._state === SOURCENODESTATE.playing) sourceNode._pause();\n }\n if(this._state === VideoContext.STATE.PAUSED){\n sourceNode._pause();\n }\n if(this._state === VideoContext.STATE.PLAYING){\n sourceNode._play();\n }\n sourceNode._update(this._currentTime);\n if (sourceNode._state === SOURCENODESTATE.paused || sourceNode._state === SOURCENODESTATE.playing){\n sourcesPlaying = true;\n }\n }\n\n\n if (sourcesPlaying !== this._sourcesPlaying && this._state === VideoContext.STATE.PLAYING){\n if (sourcesPlaying === true){\n this._callCallbacks(\"content\");\n }else{\n this._callCallbacks(\"nocontent\");\n }\n this._sourcesPlaying = sourcesPlaying;\n }\n\n\n /*\n * Itterate the directed acyclic graph using Khan's algorithm (KHAAAAAN!).\n *\n * This has highlighted a bunch of ineffencies in the rendergraph class about how its stores connections.\n * Mainly the fact that to get inputs for a node you have to iterate the full list of connections rather than\n * a node owning it's connections.\n * The trade off with changing this is making/removing connections becomes more costly performance wise, but\n * this is deffinately worth while because getting the connnections is a much more common operation.\n *\n * TL;DR Future matt - refactor this.\n *\n */\n let sortedNodes = [];\n let connections = this._renderGraph.connections.slice();\n let nodes = RenderGraph.getInputlessNodes(connections);\n\n\n while (nodes.length > 0) {\n let node = nodes.pop();\n sortedNodes.push(node);\n for (let edge of RenderGraph.outputEdgesFor(node, connections)){\n let index = connections.indexOf(edge);\n if (index > -1) connections.splice(index, 1);\n if (RenderGraph.inputEdgesFor(edge.destination, connections).length === 0){\n nodes.push(edge.destination);\n }\n }\n }\n\n for (let node of sortedNodes){\n if (this._sourceNodes.indexOf(node) === -1){\n node._update(this._currentTime);\n node._render();\n }\n }\n }\n }\n\n /**\n * Destroy all nodes in the graph and reset the timeline. After calling this any created nodes will be unusable.\n */\n reset(){\n for (let callback of this._callbacks){\n this.unregisterCallback(callback);\n }\n for (let node of this._sourceNodes){\n node.destroy();\n }\n for (let node of this._processingNodes){\n node.destroy();\n }\n this._update(0);\n this._sourceNodes = [];\n this._processingNodes = [];\n this._timeline = [];\n this._currentTime = 0;\n this._state = VideoContext.STATE.PAUSED;\n this._playbackRate = 1.0;\n this._sourcesPlaying = undefined;\n this._callbacks.set(\"stalled\", []);\n this._callbacks.set(\"update\", []);\n this._callbacks.set(\"ended\", []);\n this._callbacks.set(\"content\", []);\n this._callbacks.set(\"nocontent\", []);\n this._timelineCallbacks = [];\n }\n\n _depricate(msg){\n console.log(msg);\n }\n\n static get DEFINITIONS() {\n return DEFINITIONS;\n }\n\n /**\n * Get a JS Object containing the state of the VideoContext instance and all the created nodes.\n */\n snapshot () {\n return snapshot(this);\n }\n}\n\n//playing - all sources are active\n//paused - all sources are paused\n//stalled - one or more sources is unable to play\n//ended - all sources have finished playing\n//broken - the render graph is in a broken state\nVideoContext.STATE = {};\nVideoContext.STATE.PLAYING = 0;\nVideoContext.STATE.PAUSED = 1;\nVideoContext.STATE.STALLED = 2;\nVideoContext.STATE.ENDED = 3;\nVideoContext.STATE.BROKEN = 4;\n\nVideoContext.visualiseVideoContextTimeline = visualiseVideoContextTimeline;\nVideoContext.visualiseVideoContextGraph = visualiseVideoContextGraph;\nVideoContext.createControlFormForNode = createControlFormForNode;\nVideoContext.createSigmaGraphDataFromRenderGraph = createSigmaGraphDataFromRenderGraph;\nVideoContext.exportToJSON = exportToJSON;\nVideoContext.updateablesManager = updateablesManager;\nVideoContext.importSimpleEDL = importSimpleEDL;\n\n\n\n// WEBPACK FOOTER //\n// ./src/videocontext.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport SourceNode, { SOURCENODESTATE } from \"./sourcenode\";\n\nclass VideoNode extends SourceNode {\n /**\n * Initialise an instance of a VideoNode.\n * This should not be called directly, but created through a call to videoContext.createVideoNode();\n */\n constructor(src, gl, renderGraph, currentTime, globalPlaybackRate=1.0, sourceOffset=0, preloadTime = 4, videoElementCache=undefined, attributes = {}){\n super(src, gl, renderGraph, currentTime);\n this._preloadTime = preloadTime;\n this._sourceOffset = sourceOffset;\n this._globalPlaybackRate = globalPlaybackRate;\n this._videoElementCache = videoElementCache;\n this._playbackRate = 1.0;\n this._volume = 1.0;\n this._playbackRateUpdated = true;\n this._attributes = attributes;\n this._loopElement = false;\n this._isElementPlaying = false;\n if (this._attributes.loop){\n this._loopElement = this._attributes.loop;\n }\n this._displayName = \"VideoNode\";\n }\n\n set playbackRate(playbackRate){\n this._playbackRate = playbackRate;\n this._playbackRateUpdated = true;\n }\n\n set stretchPaused(stretchPaused){\n super.stretchPaused = stretchPaused;\n if(this._element){\n if (this._stretchPaused){\n this._element.pause();\n } else{\n if(this._state === SOURCENODESTATE.playing){\n this._element.play();\n }\n }\n }\n }\n\n get stretchPaused(){\n return this._stretchPaused;\n }\n\n get playbackRate(){\n return this._playbackRate;\n }\n\n get elementURL(){\n return this._elementURL;\n }\n\n set volume(volume){\n this._volume = volume;\n if(this._element !== undefined) this._element.volume = this._volume;\n }\n\n _load(){\n super._load();\n if (this._element !== undefined){\n\n for (var key in this._attributes) {\n this._element[key] = this._attributes[key];\n }\n\n if (this._element.readyState > 3 && !this._element.seeking){\n if(this._loopElement === false){\n if (this._stopTime === Infinity || this._stopTime == undefined){\n this._stopTime = this._startTime + this._element.duration;\n this._triggerCallbacks(\"durationchange\", this.duration);\n }\n }\n if(this._ready !== true){\n this._triggerCallbacks(\"loaded\");\n this._playbackRateUpdated = true;\n\n }\n\n this._ready = true;\n\n } else{\n if(this._state !== SOURCENODESTATE.error){\n this._ready = false;\n }\n }\n return;\n }\n if (this._isResponsibleForElementLifeCycle){\n if (this._videoElementCache){\n this._element = this._videoElementCache.get();\n }else{\n this._element = document.createElement(\"video\");\n this._element.setAttribute(\"crossorigin\", \"anonymous\");\n this._element.setAttribute(\"webkit-playsinline\", \"\");\n this._element.setAttribute(\"playsinline\", \"\");\n this._playbackRateUpdated = true;\n }\n this._element.volume = this._volume;\n if (window.MediaStream !== undefined && this._elementURL instanceof MediaStream){\n this._element.srcObject = this._elementURL;\n } else {\n this._element.src = this._elementURL;\n }\n\n for (let key in this._attributes) {\n this._element[key] = this._attributes[key];\n }\n }\n if (this._element){\n let currentTimeOffset = 0;\n if (this._currentTime > this._startTime) currentTimeOffset = this._currentTime - this._startTime;\n this._element.currentTime = this._sourceOffset + currentTimeOffset;\n this._element.onerror = () => {\n if (this._element === undefined) return;\n console.debug(\"Error with element\", this._element);\n this._state = SOURCENODESTATE.error;\n //Event though there's an error ready should be set to true so the node can output transparenn\n this._ready = true;\n this._triggerCallbacks(\"error\");\n };\n }else{\n //If the element doesn't exist for whatever reason enter the error state.\n this._state = SOURCENODESTATE.error;\n this._ready = true;\n this._triggerCallbacks(\"error\");\n }\n }\n\n _unload(){\n super._unload();\n if (this._isResponsibleForElementLifeCycle && this._element !== undefined){\n this._element.src = \"\";\n this._element.srcObject = undefined;\n for (let key in this._attributes){\n this._element.removeAttribute(key);\n }\n this._element = undefined;\n if(!this._videoElementCache) delete this._element;\n }\n this._ready = false;\n this._isElementPlaying = false;\n }\n\n _seek(time){\n super._seek(time);\n if (this.state === SOURCENODESTATE.playing || this.state === SOURCENODESTATE.paused){\n if (this._element === undefined) this._load();\n let relativeTime = this._currentTime - this._startTime + this._sourceOffset;\n this._element.currentTime = relativeTime;\n this._ready = false;\n }\n if((this._state === SOURCENODESTATE.sequenced || this._state === SOURCENODESTATE.ended) && this._element !== undefined){\n this._unload();\n }\n }\n\n _update(currentTime){\n //if (!super._update(currentTime)) return false;\n super._update(currentTime);\n //check if the video has ended\n if(this._element !== undefined){\n if (this._element.ended){\n this._state = SOURCENODESTATE.ended;\n this._triggerCallbacks(\"ended\");\n }\n }\n\n if (this._startTime - this._currentTime <= this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();\n\n if (this._state === SOURCENODESTATE.playing){\n if (this._playbackRateUpdated)\n {\n this._element.playbackRate = this._globalPlaybackRate * this._playbackRate;\n this._playbackRateUpdated = false;\n }\n if (!this._isElementPlaying){\n this._element.play();\n if (this._stretchPaused){\n this._element.pause();\n }\n this._isElementPlaying = true;\n }\n return true;\n } else if (this._state === SOURCENODESTATE.paused){\n this._element.pause();\n this._isElementPlaying = false;\n return true;\n }\n else if (this._state === SOURCENODESTATE.ended && this._element !== undefined){\n this._element.pause();\n if (this._isElementPlaying){\n this._unload();\n }\n return false;\n }\n }\n\n clearTimelineState(){\n super.clearTimelineState();\n if (this._element !== undefined) {\n this._element.pause();\n this._isElementPlaying = false;\n }\n this._unload();\n }\n\n destroy(){\n if (this._element) this._element.pause();\n super.destroy();\n }\n\n}\n\nexport default VideoNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/SourceNodes/videonode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport { updateTexture, clearTexture, createElementTexutre } from \"../utils.js\";\nimport GraphNode from \"../graphnode\";\n\nlet STATE = {\"waiting\":0, \"sequenced\":1, \"playing\":2, \"paused\":3, \"ended\":4, \"error\":5};\n\nclass SourceNode extends GraphNode{\n /**\n * Initialise an instance of a SourceNode.\n * This is the base class for other Nodes which generate media to be passed into the processing pipeline.\n */\n constructor(src, gl, renderGraph, currentTime){\n super(gl,renderGraph, [], true);\n this._element = undefined;\n this._elementURL = undefined;\n this._isResponsibleForElementLifeCycle = true;\n\n if (typeof src === \"string\" || (window.MediaStream !== undefined && src instanceof MediaStream)){\n //create the node from the passed URL or MediaStream\n this._elementURL = src;\n }else{\n //use the passed element to create the SourceNode\n this._element = src;\n this._isResponsibleForElementLifeCycle = false;\n }\n\n this._state = STATE.waiting;\n this._currentTime = currentTime;\n this._startTime = NaN;\n this._stopTime = Infinity;\n this._ready = false;\n this._loadCalled = false;\n this._stretchPaused = false;\n this._texture = createElementTexutre(gl);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));\n this._callbacks = [];\n this._renderPaused = false;\n this._displayName = \"SourceNode\";\n\n }\n\n /**\n * Returns the state of the node.\n * 0 - Waiting, start() has not been called on it yet.\n * 1 - Sequenced, start() has been called but it is not playing yet.\n * 2 - Playing, the node is playing.\n * 3 - Paused, the node is paused.\n * 4 - Ended, playback of the node has finished.\n *\n * @example\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n * console.log(videoNode.state); //will output 0 (for waiting)\n * videoNode.start(5);\n * console.log(videoNode.state); //will output 1 (for sequenced)\n * videoNode.stop(10);\n * ctx.play();\n * console.log(videoNode.state); //will output 2 (for playing)\n * ctx.paused();\n * console.log(videoNode.state); //will output 3 (for paused)\n */\n get state(){\n return this._state;\n }\n\n\n /**\n * Returns the underlying DOM element which represents this source node.\n * Note: If a source node is created with a url rather than passing in an existing element then this will return undefined until the source node preloads the element.\n *\n * @return {Element} The underlying DOM element representing the media for the node. If the lifecycle of the video is owned UNSIGNED_BYTE the node itself, this can return undefined if the element hasn't been loaded yet.\n *\n * @example\n * //Accessing the Element on a VideoNode created via a URL\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n * videoNode.start(0);\n * videoNode.stop(5);\n * //When the node starts playing the element should exist so set it's volume to 0\n * videoNode.regsiterCallback(\"play\", function(){videoNode.element.volume = 0;});\n *\n *\n * @example\n * //Accessing the Element on a VideoNode created via an already existing element\n * var ctx = new VideoContext();\n * var videoElement = document.createElement(\"video\");\n * var videoNode = ctx.createVideoSourceNode(videoElement);\n * videoNode.start(0);\n * videoNode.stop(5);\n * //The elemnt can be accessed any time because it's lifecycle is managed outside of the VideoContext\n * videoNode.element.volume = 0;\n *\n */\n get element(){\n return this._element;\n }\n\n\n /**\n * Returns the duration of the node on a timeline. If no start time is set will return undefiend, if no stop time is set will return Infinity.\n *\n * @return {number} The duration of the node in seconds.\n *\n * @example\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n * videoNode.start(5);\n * videoNode.stop(10);\n * console.log(videoNode.duration); //will output 10\n */\n get duration(){\n if (isNaN(this._startTime)) return undefined;\n if (this._stopTime === Infinity) return Infinity;\n return this._stopTime - this._startTime;\n }\n\n set stretchPaused(stretchPaused){\n this._stretchPaused = stretchPaused;\n }\n\n get stretchPaused(){\n return this._stretchPaused;\n }\n\n _load(){\n if (!this._loadCalled){\n this._triggerCallbacks(\"load\");\n this._loadCalled = true;\n }\n }\n\n _unload (){\n this._triggerCallbacks(\"destroy\");\n this._loadCalled = false;\n }\n\n /**\n * Register callbacks against one of these events: \"load\", \"destroy\", \"seek\", \"pause\", \"play\", \"ended\", \"durationchange\", \"loaded\", \"error\"\n *\n * @param {String} type - the type of event to register the callback against.\n * @param {function} func - the function to call.\n *\n * @example\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n *\n * videoNode.registerCallback(\"load\", function(){\"video is loading\"});\n * videoNode.registerCallback(\"play\", function(){\"video is playing\"});\n * videoNode.registerCallback(\"ended\", function(){\"video has eneded\"});\n *\n */\n registerCallback(type, func){\n this._callbacks.push({type:type, func:func});\n }\n\n /**\n * Remove callback.\n *\n * @param {function} [func] - the callback to remove, if undefined will remove all callbacks for this node.\n *\n * @example\n * var ctx = new VideoContext();\n * var videoNode = ctx.createVideoSourceNode('video.mp4');\n *\n * videoNode.registerCallback(\"load\", function(){\"video is loading\"});\n * videoNode.registerCallback(\"play\", function(){\"video is playing\"});\n * videoNode.registerCallback(\"ended\", function(){\"video has eneded\"});\n * videoNode.unregisterCallback(); //remove all of the three callbacks.\n *\n */\n unregisterCallback(func){\n let toRemove = [];\n for(let callback of this._callbacks){\n if (func === undefined){\n toRemove.push(callback);\n } else if (callback.func === func){\n toRemove.push(callback);\n }\n }\n for(let callback of toRemove){\n let index = this._callbacks.indexOf(callback);\n this._callbacks.splice(index, 1);\n }\n }\n\n _triggerCallbacks(type, data){\n for(let callback of this._callbacks){\n if (callback.type === type){\n if (data!== undefined){\n callback.func(this, data);\n }else{\n callback.func(this);\n }\n }\n }\n }\n\n /**\n * Start playback at VideoContext.currentTime plus passed time. If passed time is negative, will play as soon as possible.\n *\n * @param {number} time - the time from the currentTime of the VideoContext which to start playing, if negative will play as soon as possible.\n * @return {boolean} Will return true is seqeuncing has succeded, or false if it is already sequenced.\n */\n start(time){\n if (this._state !== STATE.waiting){\n console.debug(\"SourceNode is has already been sequenced. Can't sequence twice.\");\n return false;\n }\n\n this._startTime = this._currentTime + time;\n this._state = STATE.sequenced;\n return true;\n }\n\n /**\n * Start playback at an absolute time ont the VideoContext's timeline.\n *\n * @param {number} time - the time on the VideoContexts timeline to start playing.\n * @return {boolean} Will return true is seqeuncing has succeded, or false if it is already sequenced.\n */\n startAt(time){\n if (this._state !== STATE.waiting){\n console.debug(\"SourceNode is has already been sequenced. Can't sequence twice.\");\n return false;\n }\n this._startTime = time;\n this._state = STATE.sequenced;\n return true;\n }\n\n\n get startTime(){\n return this._startTime;\n }\n\n\n /**\n * Stop playback at VideoContext.currentTime plus passed time. If passed time is negative, will play as soon as possible.\n *\n * @param {number} time - the time from the currentTime of the video context which to stop playback.\n * @return {boolean} Will return true is seqeuncing has succeded, or false if the playback has already ended or if start hasn't been called yet, or if time is less than the start time.\n */\n stop(time){\n if (this._state === STATE.ended){\n console.debug(\"SourceNode has already ended. Cannot call stop.\");\n return false;\n } else if (this._state === STATE.waiting){\n console.debug(\"SourceNode must have start called before stop is called\");\n return false;\n }\n if (this._currentTime + time <= this._startTime){\n console.debug(\"SourceNode must have a stop time after it's start time, not before.\");\n return false;\n }\n this._stopTime = this._currentTime + time;\n this._stretchPaused = false;\n this._triggerCallbacks(\"durationchange\", this.duration);\n return true;\n }\n\n /**\n * Stop playback at an absolute time ont the VideoContext's timeline.\n *\n * @param {number} time - the time on the VideoContexts timeline to stop playing.\n * @return {boolean} Will return true is seqeuncing has succeded, or false if the playback has already ended or if start hasn't been called yet, or if time is less than the start time.\n */\n stopAt(time){\n if (this._state === STATE.ended){\n console.debug(\"SourceNode has already ended. Cannot call stop.\");\n return false;\n } else if (this._state === STATE.waiting){\n console.debug(\"SourceNode must have start called before stop is called\");\n return false;\n }\n if (time <= this._startTime){\n console.debug(\"SourceNode must have a stop time after it's start time, not before.\");\n return false;\n }\n this._stopTime = time;\n this._stretchPaused = false;\n this._triggerCallbacks(\"durationchange\", this.duration);\n return true;\n }\n\n\n get stopTime(){\n return this._stopTime;\n }\n\n\n _seek(time){\n this._renderPaused = false;\n\n this._triggerCallbacks(\"seek\", time);\n\n if (this._state === STATE.waiting) return;\n if (time < this._startTime){\n clearTexture(this._gl, this._texture);\n this._state = STATE.sequenced;\n }\n if (time >= this._startTime && this._state !== STATE.paused){\n this._state = STATE.playing;\n }\n if (time >= this._stopTime){\n clearTexture(this._gl, this._texture);\n this._triggerCallbacks(\"ended\");\n this._state = STATE.ended;\n }\n //update the current time\n this._currentTime = time;\n }\n\n _pause(){\n if(this._state === STATE.playing || (this._currentTime === 0 && this._startTime === 0)){\n this._triggerCallbacks(\"pause\");\n this._state = STATE.paused;\n this._renderPaused = false;\n }\n }\n _play(){\n\n if(this._state === STATE.paused){\n this._triggerCallbacks(\"play\");\n this._state = STATE.playing;\n }\n }\n\n _isReady(){\n if (this._state === STATE.playing || this._state === STATE.paused || this._state === STATE.error){\n return this._ready;\n }\n return true;\n }\n\n _update(currentTime, triggerTextureUpdate=true){\n this._rendered = true;\n let timeDelta = currentTime - this._currentTime;\n\n //update the current time\n this._currentTime = currentTime;\n\n //update the state\n if (this._state === STATE.waiting || this._state === STATE.ended || this._state === STATE.error) return false;\n\n this._triggerCallbacks(\"render\", currentTime);\n\n\n if (currentTime < this._startTime){\n clearTexture(this._gl, this._texture);\n this._state = STATE.sequenced;\n }\n\n\n if (currentTime >= this._startTime && this._state !== STATE.paused && this._state !== STATE.error){\n if (this._state !== STATE.playing) this._triggerCallbacks(\"play\");\n this._state = STATE.playing;\n }\n\n if (currentTime >= this._stopTime){\n clearTexture(this._gl, this._texture);\n this._triggerCallbacks(\"ended\");\n this._state = STATE.ended;\n }\n\n //update this source nodes texture\n if (this._element === undefined || this._ready === false) return true;\n\n if (!this._renderPaused && this._state === STATE.paused) {\n if(triggerTextureUpdate)updateTexture(this._gl, this._texture, this._element);\n this._renderPaused = true;\n }\n if(this._state === STATE.playing){\n if(triggerTextureUpdate)updateTexture(this._gl, this._texture, this._element);\n if(this._stretchPaused){\n this._stopTime += timeDelta;\n }\n }\n\n return true;\n }\n\n /**\n * Clear any timeline state the node currently has, this puts the node in the \"waiting\" state, as if neither start nor stop had been called.\n */\n clearTimelineState(){\n this._startTime = NaN;\n this._stopTime = Infinity;\n this._state = STATE.waiting;\n }\n\n /**\n * Destroy and clean-up the node.\n */\n destroy(){\n this._unload();\n super.destroy();\n this.unregisterCallback();\n delete this._element;\n this._elementURL = undefined;\n this._state = STATE.waiting;\n this._currentTime = 0;\n this._startTime = NaN;\n this._stopTime = Infinity;\n this._ready = false;\n this._loadCalled = false;\n this._gl.deleteTexture(this._texture);\n this._texture = undefined;\n }\n}\n\nexport {STATE as SOURCENODESTATE};\n\nexport default SourceNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/SourceNodes/sourcenode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport DEFINITIONS from \"./Definitions/definitions.js\";\nimport { SOURCENODESTATE } from \"./SourceNodes/sourcenode.js\";\n\n/*\n* Utility function to compile a WebGL Vertex or Fragment shader.\n*\n* @param {WebGLRenderingContext} gl - the webgl context fo which to build the shader.\n* @param {String} shaderSource - A string of shader code to compile.\n* @param {number} shaderType - Shader type, either WebGLRenderingContext.VERTEX_SHADER or WebGLRenderingContext.FRAGMENT_SHADER.\n*\n* @return {WebGLShader} A compiled shader.\n*\n*/\nexport function compileShader(gl, shaderSource, shaderType) {\n let shader = gl.createShader(shaderType);\n gl.shaderSource(shader, shaderSource);\n gl.compileShader(shader);\n let success = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if (!success) {\n throw \"could not compile shader:\" + gl.getShaderInfoLog(shader);\n }\n return shader;\n}\n\n/*\n* Create a shader program from a passed vertex and fragment shader source string.\n*\n* @param {WebGLRenderingContext} gl - the webgl context fo which to build the shader.\n* @param {WebGLShader} vertexShader - A compiled vertex shader.\n* @param {WebGLShader} fragmentShader - A compiled fragment shader.\n*\n* @return {WebGLProgram} A compiled & linkde shader program.\n*/\nexport function createShaderProgram(gl, vertexShader, fragmentShader){\n let program = gl.createProgram();\n\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n gl.linkProgram(program);\n\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)){\n throw {\"error\":4,\"msg\":\"Can't link shader program for track\", toString:function(){return this.msg;}};\n }\n return program;\n}\n\nexport function createElementTexutre(gl){\n let texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n // Set the parameters so we can render any size image.\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n //Initialise the texture untit to clear.\n //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, type);\n\n return texture;\n}\n\nexport function updateTexture(gl, texture, element){\n if(element.readyState !== undefined && element.readyState === 0) return;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, element);\n}\n\nexport function clearTexture(gl, texture){\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));\n}\n\n\nexport function generateRandomId(){\n const appearanceAdjective = [\"adorable\", \"alert\", \"average\", \"beautiful\", \"blonde\", \"bloody\", \"blushing\", \"bright\", \"clean\", \"clear\", \"cloudy\", \"colourful\", \"concerned\",\"crowded\", \"curious\", \"cute\", \"dark\", \"dirty\", \"drab\", \"distinct\", \"dull\", \"elegant\", \"fancy\", \"filthy\", \"glamorous\", \"gleaming\", \"graceful\", \"grotesque\", \"homely\", \"light\", \"misty\", \"motionless\", \"muddy\", \"plain\", \"poised\", \"quaint\", \"scary\", \"shiny\", \"smoggy\", \"sparkling\", \"spotless\", \"stormy\", \"strange\", \"ugly\", \"unsightly\", \"unusual\"];\n const conditionAdjective = [\"alive\", \"brainy\", \"broken\", \"busy\", \"careful\",\"cautious\", \"clever\", \"crazy\", \"damaged\", \"dead\", \"difficult\",\"easy\",\"fake\", \"false\",\"famous\", \"forward\", \"fragile\",\"guilty\", \"helpful\",\"helpless\",\"important\", \"impossible\",\"infamous\",\"innocent\", \"inquisitive\", \"mad\", \"modern\", \"open\", \"outgoing\", \"outstanding\",\"poor\", \"powerful\",\"puzzled\", \"real\", \"rich\", \"right\", \"robust\",\"sane\", \"scary\", \"shy\", \"sleepy\",\"stupid\", \"super\", \"tame\", \"thick\",\"tired\",\"wild\", \"wrong\"];\n const nounAnimal = [\"manatee\", \"gila monster\", \"nematode\", \"seahorse\", \"slug\", \"koala bear\", \"giant tortoise\",\"garden snail\", \"starfish\", \"sloth\", \"american woodcock\", \"coral\", \"swallowtail butterfly\", \"house sparrow\", \"sea anemone\"];\n\n function randomChoice(array){\n return array[Math.floor(Math.random() * array.length)];\n }\n\n function capitalize(word){\n word = word.replace(/\\b\\w/g, l => l.toUpperCase());\n return word;\n }\n\n let name = randomChoice(appearanceAdjective) + \" \" + randomChoice(conditionAdjective) + \" \" + randomChoice(nounAnimal);\n name = capitalize(name);\n name = name.replace(/ /g, \"-\");\n return name;\n}\n\n\nexport function exportToJSON(vc) {\n console.warn(\"VideoContext.exportToJSON has been deprecated. Please use VideoContext.snapshot instead.\");\n return JSON.stringify(snapshotNodes(vc));\n}\n\nexport function snapshot(vc) {\n return {\n nodes: snapshotNodes(vc),\n videoContext: snapshotVideoContext(vc)\n };\n}\n\nfunction snapshotVideoContext(vc) {\n return {\n currentTime: vc.currentTime,\n duration: vc.duration,\n state: vc.state,\n playbackRate: vc.playbackRate,\n };\n}\n\nlet warningExportSourceLogged = false;\nfunction snapshotNodes(vc){\n\n function qualifyURL(url) {\n var a = document.createElement(\"a\");\n a.href = url;\n return a.href;\n }\n\n function getInputIDs(node, vc){\n let inputs = [];\n for (let input of node.inputs){\n if (input === undefined)continue;\n let inputID;\n let inputIndex = node.inputs.indexOf(input);\n let index = vc._processingNodes.indexOf(input);\n if (index > -1){\n inputID = \"processor\" + index;\n } else{\n let index = vc._sourceNodes.indexOf(input);\n if(index > -1){\n inputID = \"source\" + index;\n } else {\n console.log(\"Warning, can't find input\",input);\n }\n }\n inputs.push({id:inputID, index:inputIndex});\n }\n return inputs;\n }\n\n let result = {};\n\n\n let sourceNodeStateMapping = [];\n for (let state in SOURCENODESTATE){\n sourceNodeStateMapping[SOURCENODESTATE[state]] = state;\n }\n\n for(let index in vc._sourceNodes){\n let source = vc._sourceNodes[index];\n let id = \"source\" + index;\n let node_url = \"\";\n\n if(!source._isResponsibleForElementLifeCycle){\n if (!warningExportSourceLogged){\n console.debug(\"Warning - Trying to export source created from an element not a URL. URL of export will be set to the elements src attribute and may be incorrect\", source);\n warningExportSourceLogged = true;\n }\n node_url = source.element.src;\n } else {\n node_url = qualifyURL(source._elementURL);\n }\n\n let node = {\n type: source.displayName,\n url: node_url,\n start: source.startTime,\n stop: source.stopTime,\n state: sourceNodeStateMapping[source.state],\n };\n if (node.type === \"VideoNode\") {\n node.currentTime = null;\n if(source.element && source.element.currentTime) {\n node.currentTime = source.element.currentTime;\n }\n }\n\n if (source._sourceOffset){\n node.sourceOffset = source._sourceOffset;\n }\n result[id] = node;\n }\n\n for (let index in vc._processingNodes){\n let processor = vc._processingNodes[index];\n let id = \"processor\" + index;\n let node = {\n type: processor.displayName,\n definition: processor._definition,\n inputs: getInputIDs(processor, vc),\n properties:{}\n };\n\n for(let property in node.definition.properties){\n node.properties[property] = processor[property];\n }\n\n if (node.type === \"TransitionNode\"){\n node.transitions = processor._transitions;\n }\n\n result[id] = node;\n }\n\n result[\"destination\"] = {\n type:\"Destination\",\n inputs: getInputIDs(vc.destination, vc)\n };\n\n return result;\n}\n\nexport function createControlFormForNode(node, nodeName){\n let rootDiv = document.createElement(\"div\");\n\n if (nodeName !== undefined){\n var title = document.createElement(\"h2\");\n title.innerHTML = nodeName;\n rootDiv.appendChild(title);\n }\n\n for(let propertyName in node._properties){\n let propertyParagraph = document.createElement(\"p\");\n let propertyTitleHeader = document.createElement(\"h3\");\n propertyTitleHeader.innerHTML = propertyName;\n propertyParagraph.appendChild(propertyTitleHeader);\n\n let propertyValue = node._properties[propertyName].value;\n if (typeof propertyValue === \"number\"){\n let range = document.createElement(\"input\");\n range.setAttribute(\"type\", \"range\");\n range.setAttribute(\"min\", \"0\");\n range.setAttribute(\"max\", \"1\");\n range.setAttribute(\"step\", \"0.01\");\n range.setAttribute(\"value\", propertyValue,toString());\n\n let number = document.createElement(\"input\");\n number.setAttribute(\"type\", \"number\");\n number.setAttribute(\"min\", \"0\");\n number.setAttribute(\"max\", \"1\");\n number.setAttribute(\"step\", \"0.01\");\n number.setAttribute(\"value\", propertyValue,toString());\n\n let mouseDown = false;\n range.onmousedown =function(){mouseDown=true;};\n range.onmouseup =function(){mouseDown=false;};\n range.onmousemove = function(){\n if(mouseDown){\n node[propertyName] = parseFloat(range.value);\n number.value = range.value;\n }\n };\n range.onchange = function(){\n node[propertyName] = parseFloat(range.value);\n number.value = range.value;\n };\n number.onchange =function(){\n node[propertyName] = parseFloat(number.value);\n range.value = number.value;\n };\n propertyParagraph.appendChild(range);\n propertyParagraph.appendChild(number);\n }\n else if(Object.prototype.toString.call(propertyValue) === \"[object Array]\"){\n for (var i = 0; i < propertyValue.length; i++) {\n let range = document.createElement(\"input\");\n range.setAttribute(\"type\", \"range\");\n range.setAttribute(\"min\", \"0\");\n range.setAttribute(\"max\", \"1\");\n range.setAttribute(\"step\", \"0.01\");\n range.setAttribute(\"value\", propertyValue[i],toString());\n\n let number = document.createElement(\"input\");\n number.setAttribute(\"type\", \"number\");\n number.setAttribute(\"min\", \"0\");\n number.setAttribute(\"max\", \"1\");\n number.setAttribute(\"step\", \"0.01\");\n number.setAttribute(\"value\", propertyValue,toString());\n\n let index = i;\n let mouseDown = false;\n range.onmousedown =function(){mouseDown=true;};\n range.onmouseup =function(){mouseDown=false;};\n range.onmousemove = function(){\n if(mouseDown){\n node[propertyName][index] = parseFloat(range.value);\n number.value = range.value;\n }\n };\n range.onchange = function(){\n node[propertyName][index] = parseFloat(range.value);\n number.value = range.value;\n };\n\n number.onchange = function(){\n node[propertyName][index] = parseFloat(number.value);\n range.value = number.value;\n };\n propertyParagraph.appendChild(range);\n propertyParagraph.appendChild(number);\n }\n }\n\n rootDiv.appendChild(propertyParagraph);\n }\n return rootDiv;\n}\n\n\nfunction calculateNodeDepthFromDestination(videoContext){\n let destination = videoContext.destination;\n let depthMap= new Map();\n depthMap.set(destination, 0);\n\n function itterateBackwards(node, depth=0){\n for (let n of node.inputs){\n let d = depth + 1;\n if (depthMap.has(n)){\n if (d > depthMap.get(n)){\n depthMap.set(n, d);\n }\n } else{\n depthMap.set(n,d);\n }\n itterateBackwards(n, depthMap.get(n));\n }\n }\n\n itterateBackwards(destination);\n return depthMap;\n}\n\n\n\n\nexport function visualiseVideoContextGraph(videoContext, canvas){\n let ctx = canvas.getContext(\"2d\");\n let w = canvas.width;\n let h = canvas.height;\n ctx.clearRect(0,0,w,h);\n\n let nodeDepths = calculateNodeDepthFromDestination(videoContext);\n let depths = nodeDepths.values();\n depths = Array.from(depths).sort(function(a, b){return b-a;});\n let maxDepth = depths[0];\n\n let xStep = w / (maxDepth+1);\n\n let nodeHeight = (h / videoContext._sourceNodes.length)/3;\n let nodeWidth = nodeHeight * 1.618;\n\n\n function calculateNodePos(node, nodeDepths, xStep, nodeHeight){\n let depth = nodeDepths.get(node);\n nodeDepths.values();\n\n let count = 0;\n for(let nodeDepth of nodeDepths){\n if (nodeDepth[0] === node) break;\n if (nodeDepth[1] === depth) count += 1;\n }\n return {x:(xStep*nodeDepths.get(node)), y:nodeHeight*1.5*count + 50};\n }\n\n\n // \"video\":[\"#572A72\", \"#3C1255\"],\n // \"image\":[\"#7D9F35\", \"#577714\"],\n // \"canvas\":[\"#AA9639\", \"#806D15\"]\n\n for (let i = 0; i < videoContext._renderGraph.connections.length; i++) {\n let conn = videoContext._renderGraph.connections[i];\n let source = calculateNodePos(conn.source, nodeDepths, xStep, nodeHeight);\n let destination = calculateNodePos(conn.destination, nodeDepths, xStep, nodeHeight);\n if (source !== undefined && destination !== undefined){\n ctx.beginPath();\n //ctx.moveTo(source.x + nodeWidth/2, source.y + nodeHeight/2);\n let x1 = source.x + nodeWidth/2;\n let y1 = source.y + nodeHeight/2;\n let x2 = destination.x + nodeWidth/2;\n let y2 = destination.y + nodeHeight/2;\n let dx = x2 - x1;\n let dy = y2 - y1;\n\n let angle = Math.PI/2 - Math.atan2(dx,dy);\n\n let distance = Math.sqrt(Math.pow(x1-x2,2) + Math.pow(y1-y2,2));\n\n let midX = Math.min(x1, x2) + (Math.max(x1,x2) - Math.min(x1, x2))/2;\n let midY = Math.min(y1, y2) + (Math.max(y1,y2) - Math.min(y1, y2))/2;\n\n let testX = (Math.cos(angle + Math.PI/2))*distance/1.5 + midX;\n let testY = (Math.sin(angle + Math.PI/2))*distance/1.5 + midY;\n // console.log(testX, testY);\n\n ctx.arc(testX, testY, distance/1.2, angle-Math.PI+0.95, angle-0.95);\n\n //ctx.arcTo(source.x + nodeWidth/2 ,source.y + nodeHeight/2,destination.x + nodeWidth/2,destination.y + nodeHeight/2,100);\n //ctx.lineTo(midX, midY);\n ctx.stroke();\n //ctx.endPath();\n }\n }\n\n\n for(let node of nodeDepths.keys()){\n let pos = calculateNodePos(node, nodeDepths, xStep, nodeHeight);\n let color = \"#AA9639\";\n let text = \"\";\n if (node.displayName === \"CompositingNode\"){\n color = \"#000000\";\n }\n if (node.displayName === \"DestinationNode\"){\n color = \"#7D9F35\";\n text=\"Output\";\n }\n if (node.displayName === \"VideoNode\"){\n color = \"#572A72\";\n text = \"Video\";\n }\n if (node.displayName === \"CanvasNode\"){\n color = \"#572A72\";\n text = \"Canvas\";\n }\n if (node.displayName === \"ImageNode\"){\n color = \"#572A72\";\n text = \"Image\";\n }\n ctx.beginPath();\n ctx.fillStyle = color;\n ctx.fillRect(pos.x, pos.y, nodeWidth, nodeHeight);\n ctx.fill();\n\n\n ctx.fillStyle = \"#000\";\n ctx.textAlign = \"center\";\n ctx.font = \"10px Arial\";\n ctx.fillText(text,pos.x+nodeWidth/2, pos.y+nodeHeight/2+2.5);\n ctx.fill();\n }\n\n return;\n}\n\n\n\n\nexport function createSigmaGraphDataFromRenderGraph(videoContext){\n\n function idForNode(node){\n if (videoContext._sourceNodes.indexOf(node) !== -1){\n let id = \"source \" + node.displayName+ \" \"+videoContext._sourceNodes.indexOf(node);\n return id;\n }\n let id = \"processor \" + node.displayName + \" \"+videoContext._processingNodes.indexOf(node);\n return id;\n }\n\n let graph = {\n nodes:[\n {\n id: idForNode(videoContext.destination),\n label:\"Destination Node\",\n x:2.5,\n y:0.5,\n size:2,\n node: videoContext.destination\n }],\n edges:[]\n };\n\n for (let i = 0; i < videoContext._sourceNodes.length; i++) {\n let sourceNode = videoContext._sourceNodes[i];\n let y = i * (1.0 / videoContext._sourceNodes.length);\n graph.nodes.push({\n id: idForNode(sourceNode),\n label:\"Source \"+ i.toString(),\n x:0,\n y: y,\n size:2,\n color:\"#572A72\",\n node:sourceNode\n });\n }\n for (let i = 0; i < videoContext._processingNodes.length; i++) {\n let processingNode = videoContext._processingNodes[i];\n graph.nodes.push({\n id: idForNode(processingNode),\n x: Math.random() *2.5,\n y: Math.random(),\n size:2,\n node: processingNode\n });\n }\n\n for (let i = 0; i < videoContext._renderGraph.connections.length; i++) {\n let conn = videoContext._renderGraph.connections[i];\n graph.edges.push({\n \"id\":\"e\"+i.toString(),\n \"source\": idForNode(conn.source),\n \"target\": idForNode(conn.destination)\n });\n }\n\n\n\n return graph;\n}\n\n\nexport function importSimpleEDL(ctx, playlist){\n // Create a \"track\" node to connect all the clips to.\n let trackNode = ctx.compositor(DEFINITIONS.COMBINE);\n\n // Create a source node for each of the clips.\n for (let clip of playlist){\n let node;\n if (clip.type === \"video\"){\n node = ctx.video(clip.src, clip.sourceStart);\n } else if (clip.type === \"image\"){\n node = ctx.image(clip.src, clip.sourceStart);\n }else {\n console.debug(\"Clip type \\\"\" + clip.type + \"\\\" not recognised, skipping.\");\n continue;\n }\n node.startAt(clip.start);\n node.stopAt(clip.start + clip.duration);\n node.connect(trackNode);\n }\n return trackNode;\n}\n\nexport function visualiseVideoContextTimeline(videoContext, canvas, currentTime){\n let ctx = canvas.getContext(\"2d\");\n let w = canvas.width;\n let h = canvas.height;\n let trackHeight = h / videoContext._sourceNodes.length;\n let playlistDuration = videoContext.duration;\n\n if (currentTime > playlistDuration && !videoContext.endOnLastSourceEnd) playlistDuration = currentTime;\n\n if (videoContext.duration === Infinity){\n let total = 0;\n for (let i = 0; i < videoContext._sourceNodes.length; i++) {\n let sourceNode = videoContext._sourceNodes[i];\n if(sourceNode._stopTime !== Infinity) total += sourceNode._stopTime;\n }\n\n if (total > videoContext.currentTime){\n playlistDuration = total+5;\n }else{\n playlistDuration = videoContext.currentTime+5;\n }\n }\n let pixelsPerSecond = w / playlistDuration;\n let mediaSourceStyle = {\n \"video\":[\"#572A72\", \"#3C1255\"],\n \"image\":[\"#7D9F35\", \"#577714\"],\n \"canvas\":[\"#AA9639\", \"#806D15\"]\n };\n\n\n ctx.clearRect(0,0,w,h);\n ctx.fillStyle = \"#999\";\n\n for(let node of videoContext._processingNodes){\n if (node.displayName !== \"TransitionNode\") continue;\n for(let propertyName in node._transitions){\n for(let transition of node._transitions[propertyName]){\n let tW = (transition.end - transition.start) * pixelsPerSecond;\n let tH = h;\n let tX = transition.start * pixelsPerSecond;\n let tY = 0;\n ctx.fillStyle = \"rgba(0,0,0, 0.3)\";\n ctx.fillRect(tX, tY, tW, tH);\n ctx.fill();\n }\n }\n }\n\n\n for (let i = 0; i < videoContext._sourceNodes.length; i++) {\n let sourceNode = videoContext._sourceNodes[i];\n let duration = sourceNode._stopTime - sourceNode._startTime;\n if(duration=== Infinity) duration = videoContext.currentTime;\n let start = sourceNode._startTime;\n\n let msW = duration * pixelsPerSecond;\n let msH = trackHeight;\n let msX = start * pixelsPerSecond;\n let msY = trackHeight * i;\n ctx.fillStyle = mediaSourceStyle.video[i%mediaSourceStyle.video.length];\n\n\n ctx.fillRect(msX,msY,msW,msH);\n ctx.fill();\n }\n\n\n\n if (currentTime !== undefined){\n ctx.fillStyle = \"#000\";\n ctx.fillRect(currentTime*pixelsPerSecond, 0, 1, h);\n }\n}\n\n\n\n\nexport class UpdateablesManager{\n constructor(){\n this._updateables = [];\n this._useWebworker = false;\n this._active = false;\n this._previousRAFTime = undefined;\n this._previousWorkerTime = undefined;\n\n this._webWorkerString = \"\\\n var running = false;\\\n function tick(){\\\n postMessage(Date.now());\\\n if (running){\\\n setTimeout(tick, 1000/20);\\\n }\\\n }\\\n self.addEventListener('message',function(msg){\\\n var data = msg.data;\\\n if (data === 'start'){\\\n running = true;\\\n tick();\\\n }\\\n if (data === 'stop') running = false;\\\n });\";\n this._webWorker = undefined;\n }\n\n _initWebWorker(){\n window.URL = window.URL || window.webkitURL;\n let blob = new Blob([this._webWorkerString], {type: \"application/javascript\"});\n this._webWorker = new Worker(URL.createObjectURL(blob));\n this._webWorker.onmessage = (msg)=>{\n let time = msg.data;\n this._updateWorkerTime(time);\n };\n }\n\n _lostVisibility(){\n this._previousWorkerTime = Date.now();\n this._useWebworker = true;\n if (!this._webWorker){\n this._initWebWorker();\n }\n this._webWorker.postMessage(\"start\");\n }\n\n _gainedVisibility(){\n this._useWebworker = false;\n this._previousRAFTime = undefined;\n if(this._webWorker) this._webWorker.postMessage(\"stop\");\n requestAnimationFrame(this._updateRAFTime.bind(this));\n }\n\n _init(){\n if(!window.Worker)return;\n\n //If page visibility API not present fallback to using \"focus\" and \"blur\" event listeners.\n if (typeof document.hidden === \"undefined\") {\n window.addEventListener(\"focus\", this._gainedVisibility.bind(this));\n window.addEventListener(\"blur\", this._lostVisibility.bind(this));\n return;\n }\n //Otherwise we can use the visibility API to do the loose/gain focus properly\n document.addEventListener(\"visibilitychange\", ()=>{\n if (document.hidden === true) {\n this._lostVisibility();\n } else {\n this._gainedVisibility();\n }\n }, false);\n\n requestAnimationFrame(this._updateRAFTime.bind(this));\n }\n\n _updateWorkerTime(time){\n let dt = (time - this._previousWorkerTime) / 1000;\n if (dt !== 0) this._update(dt);\n this._previousWorkerTime = time;\n }\n\n _updateRAFTime(time){\n if (this._previousRAFTime === undefined)this._previousRAFTime = time;\n let dt = (time - this._previousRAFTime) / 1000;\n if (dt !== 0) this._update(dt);\n this._previousRAFTime = time;\n if(!this._useWebworker)requestAnimationFrame(this._updateRAFTime.bind(this));\n }\n\n _update(dt){\n for(let i = 0; i < this._updateables.length; i++){\n this._updateables[i]._update(parseFloat(dt));\n\n }\n }\n\n register(updateable){\n this._updateables.push(updateable);\n if (this._active === false){\n this._active = true;\n this._init();\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","import aaf_video_scale from \"./aaf_video_scale.js\";\nimport crossfade from \"./crossfade.js\";\nimport horizontalWipe from \"./horizontalWipe.js\";\nimport verticalWipe from \"./verticalWipe.js\";\nimport randomDissolve from \"./randomDissolve.js\";\nimport toColorAndBackFade from \"./toColorAndBackFade.js\";\nimport starWipe from \"./starWipe.js\";\nimport combine from \"./combine.js\";\nimport colorThreshold from \"./colorThreshold.js\";\nimport monochrome from \"./monochrome.js\";\nimport horizontalBlur from \"./horizontalBlur.js\";\nimport verticalBlur from \"./verticalBlur.js\";\nimport aaf_video_flop from \"./aaf_video_flop.js\";\nimport aaf_video_flip from \"./aaf_video_flip.js\";\nimport aaf_video_position from \"./aaf_video_position.js\";\nimport aaf_video_crop from \"./aaf_video_crop.js\";\nimport staticDissolve from \"./staticDissolve.js\";\nimport staticEffect from \"./staticEffect.js\";\nimport dreamfade from \"./dreamfade.js\";\nimport opacity from \"./opacity.js\";\nimport crop from \"./crop.js\";\n\nlet DEFINITIONS = {\n AAF_VIDEO_SCALE: aaf_video_scale,\n CROSSFADE: crossfade,\n DREAMFADE: dreamfade,\n HORIZONTAL_WIPE:horizontalWipe,\n VERTICAL_WIPE:verticalWipe,\n RANDOM_DISSOLVE:randomDissolve,\n STATIC_DISSOLVE:staticDissolve,\n STATIC_EFFECT:staticEffect,\n TO_COLOR_AND_BACK: toColorAndBackFade,\n STAR_WIPE:starWipe,\n COMBINE: combine,\n COLORTHRESHOLD: colorThreshold,\n MONOCHROME: monochrome,\n HORIZONTAL_BLUR:horizontalBlur,\n VERTICAL_BLUR:verticalBlur,\n AAF_VIDEO_CROP: aaf_video_crop,\n AAF_VIDEO_POSITION: aaf_video_position,\n AAF_VIDEO_FLIP: aaf_video_flip,\n AAF_VIDEO_FLOP: aaf_video_flop,\n OPACITY: opacity,\n CROP: crop\n};\n\nexport default DEFINITIONS;\n\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/definitions.js","let aaf_video_scale = {\n \"title\":\"AAF Video Scale Effect\",\n \"description\": \"A scale effect based on the AAF spec.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float scaleX;\\\n uniform float scaleY;\\\n varying vec2 v_texCoord;\\\n varying float v_progress;\\\n void main(){\\\n vec2 pos = vec2(v_texCoord[0]*1.0/scaleX - (1.0/scaleX/2.0 -0.5), v_texCoord[1]*1.0/scaleY - (1.0/scaleY/2.0 -0.5));\\\n vec4 color = texture2D(u_image, pos);\\\n if (pos[0] < 0.0 || pos[0] > 1.0 || pos[1] < 0.0 || pos[1] > 1.0){\\\n color = vec4(0.0,0.0,0.0,0.0);\\\n }\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"scaleX\":{\"type\":\"uniform\", \"value\":1.0},\n \"scaleY\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_scale;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_scale.js","let crossfade = {\n \"title\":\"Cross-Fade\",\n \"description\": \"A cross-fade effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n color_a[0] *= (1.0 - mix);\\\n color_a[1] *= (1.0 - mix);\\\n color_a[2] *= (1.0 - mix);\\\n color_a[3] *= (1.0 - mix);\\\n color_b[0] *= mix;\\\n color_b[1] *= mix;\\\n color_b[2] *= mix;\\\n color_b[3] *= mix;\\\n gl_FragColor = color_a + color_b;\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default crossfade;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/crossfade.js","let horizontal_wipe = {\n \"title\":\"Horizontal Wipe\",\n \"description\": \"A horizontal wipe effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n if (v_texCoord[0] > mix){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default horizontal_wipe;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/horizontalWipe.js","let verticalWipe = {\n \"title\":\"vertical Wipe\",\n \"description\": \"A vertical wipe effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n if (v_texCoord[1] > mix){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default verticalWipe;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/verticalWipe.js","let randomDissolve = {\n \"title\":\"Random Dissolve\",\n \"description\": \"A random dissolve effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n float rand(vec2 co){\\\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\\\n }\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n if (clamp(rand(v_texCoord), 0.01, 1.001) > mix){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default randomDissolve;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/randomDissolve.js","let toColorAndBackFade = {\n \"title\":\"To Color And Back Fade\",\n \"description\": \"A fade to black and back effect. Setting mix to 0.5 is a fully solid color frame. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n uniform vec4 color;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n float mix_amount = (mix *2.0) - 1.0;\\\n if(mix_amount < 0.0){\\\n gl_FragColor = abs(mix_amount) * color_a + (1.0 - abs(mix_amount)) * color;\\\n } else {\\\n gl_FragColor = mix_amount * color_b + (1.0 - mix_amount) * color;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0},\n \"color\":{\"type\":\"uniform\", \"value\":[0.0,0.0,0.0,0.0]}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\nexport default toColorAndBackFade;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/toColorAndBackFade.js","let starWipe = {\n \"title\":\"Star Wipe Fade\",\n \"description\": \"A classic star wipe transistion. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n float sign (vec2 p1, vec2 p2, vec2 p3){\\\n return (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]);\\\n }\\\n bool pointInTriangle(vec2 pt, vec2 v1, vec2 v2, vec2 v3){\\\n bool b1, b2, b3;\\\n b1 = sign(pt, v1, v2) < 0.0;\\\n b2 = sign(pt, v2, v3) < 0.0;\\\n b3 = sign(pt, v3, v1) < 0.0;\\\n return ((b1 == b2) && (b2 == b3));\\\n }\\\n vec2 rotatePointAboutPoint(vec2 point, vec2 pivot, float angle){\\\n float s = sin(angle);\\\n float c = cos(angle);\\\n float x = point[0] - pivot[0];\\\n float y = point[1] - pivot[1];\\\n float new_x = x * c - y * s;\\\n float new_y = x * s + y * c;\\\n return vec2(new_x + pivot[0], new_y+pivot[1]);\\\n }\\\n \\\n void main(){\\\n vec4 color_a = texture2D(u_image_b, v_texCoord);\\\n vec4 color_b = texture2D(u_image_a, v_texCoord);\\\n vec2 t0_p0,t0_p1,t0_p2,t1_p0,t1_p1,t1_p2,t2_p0,t2_p1,t2_p2,t3_p0,t3_p1,t3_p2;\\\n vec2 t4_p0,t4_p1,t4_p2,t5_p0,t5_p1,t5_p2,t6_p0,t6_p1,t6_p2,t7_p0,t7_p1,t7_p2;\\\n \\\n \\\n t0_p0 = vec2(0.0, 0.25) * clamp(mix,0.0,1.0) * 2.0 + vec2(0.5,0.5);\\\n t0_p1 = vec2(0.0, -0.25) * clamp(mix,0.0,1.0) * 2.0 + vec2(0.5,0.5);\\\n t0_p2 = vec2(1.0, 0.0) * clamp(mix,0.0,1.0) * 2.0 + vec2(0.5,0.5);\\\n \\\n t1_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854);\\\n t1_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854);\\\n t1_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854);\\\n \\\n t2_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 2.0);\\\n t2_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 2.0);\\\n t2_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 2.0);\\\n \\\n t3_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 3.0);\\\n t3_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 3.0);\\\n t3_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 3.0);\\\n \\\n t4_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 4.0);\\\n t4_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 4.0);\\\n t4_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 4.0);\\\n \\\n t5_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 5.0);\\\n t5_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 5.0);\\\n t5_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 5.0);\\\n \\\n t6_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 6.0);\\\n t6_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 6.0);\\\n t6_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 6.0);\\\n \\\n t7_p0 = rotatePointAboutPoint(t0_p0, vec2(0.5,0.5), 0.7854 * 7.0);\\\n t7_p1 = rotatePointAboutPoint(t0_p1, vec2(0.5,0.5), 0.7854 * 7.0);\\\n t7_p2 = rotatePointAboutPoint(t0_p2, vec2(0.5,0.5), 0.7854 * 7.0);\\\n \\\n if(mix > 0.99){\\\n gl_FragColor = color_a;\\\n return;\\\n }\\\n if(mix < 0.01){\\\n gl_FragColor = color_b;\\\n return;\\\n }\\\n if(pointInTriangle(v_texCoord, t0_p0, t0_p1, t0_p2) || pointInTriangle(v_texCoord, t1_p0, t1_p1, t1_p2) || pointInTriangle(v_texCoord, t2_p0, t2_p1, t2_p2) || pointInTriangle(v_texCoord, t3_p0, t3_p1, t3_p2) || pointInTriangle(v_texCoord, t4_p0, t4_p1, t4_p2) || pointInTriangle(v_texCoord, t5_p0, t5_p1, t5_p2) || pointInTriangle(v_texCoord, t6_p0, t6_p1, t6_p2) || pointInTriangle(v_texCoord, t7_p0, t7_p1, t7_p2)){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default starWipe;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/starWipe.js","let combine = {\n \"title\":\"Combine\",\n \"description\": \"A basic effect which renders the input to the output, Typically used as a combine node for layering up media with alpha transparency.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float a;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"a\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default combine;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/combine.js","let colorThreshold = {\n \"title\":\"Color Threshold\",\n \"description\": \"Turns all pixels with a greater value than the specified threshold transparent.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float a;\\\n uniform vec3 colorAlphaThreshold;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n if (color[0] > colorAlphaThreshold[0] && color[1]> colorAlphaThreshold[1] && color[2]> colorAlphaThreshold[2]){\\\n color = vec4(0.0,0.0,0.0,0.0);\\\n }\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"a\":{\"type\":\"uniform\", \"value\":0.0},\n \"colorAlphaThreshold\":{\"type\":\"uniform\", \"value\":[0.0,0.55,0.0]}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default colorThreshold;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/colorThreshold.js","let monochrome = {\n \"title\":\"Monochrome\",\n \"description\": \"Change images to a single chroma (e.g can be used to make a black & white filter). Input color mix and output color mix can be adjusted.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform vec3 inputMix;\\\n uniform vec3 outputMix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n float mono = color[0]*inputMix[0] + color[1]*inputMix[1] + color[2]*inputMix[2];\\\n color[0] = mono * outputMix[0];\\\n color[1] = mono * outputMix[1];\\\n color[2] = mono * outputMix[2];\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"inputMix\":{\"type\":\"uniform\", \"value\":[0.4,0.6,0.2]},\n \"outputMix\":{\"type\":\"uniform\", \"value\":[1.0,1.0,1.0]}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default monochrome;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/monochrome.js","let horizontal_blur = {\n \"title\":\"Horizontal Blur\",\n \"description\": \"A horizontal blur effect. Adpated from http://xissburg.com/faster-gaussian-blur-in-glsl/\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n uniform float blurAmount;\\\n varying vec2 v_texCoord;\\\n varying vec2 v_blurTexCoords[14];\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n v_blurTexCoords[ 0] = v_texCoord + vec2(-0.028 * blurAmount, 0.0);\\\n v_blurTexCoords[ 1] = v_texCoord + vec2(-0.024 * blurAmount, 0.0);\\\n v_blurTexCoords[ 2] = v_texCoord + vec2(-0.020 * blurAmount, 0.0);\\\n v_blurTexCoords[ 3] = v_texCoord + vec2(-0.016 * blurAmount, 0.0);\\\n v_blurTexCoords[ 4] = v_texCoord + vec2(-0.012 * blurAmount, 0.0);\\\n v_blurTexCoords[ 5] = v_texCoord + vec2(-0.008 * blurAmount, 0.0);\\\n v_blurTexCoords[ 6] = v_texCoord + vec2(-0.004 * blurAmount, 0.0);\\\n v_blurTexCoords[ 7] = v_texCoord + vec2( 0.004 * blurAmount, 0.0);\\\n v_blurTexCoords[ 8] = v_texCoord + vec2( 0.008 * blurAmount, 0.0);\\\n v_blurTexCoords[ 9] = v_texCoord + vec2( 0.012 * blurAmount, 0.0);\\\n v_blurTexCoords[10] = v_texCoord + vec2( 0.016 * blurAmount, 0.0);\\\n v_blurTexCoords[11] = v_texCoord + vec2( 0.020 * blurAmount, 0.0);\\\n v_blurTexCoords[12] = v_texCoord + vec2( 0.024 * blurAmount, 0.0);\\\n v_blurTexCoords[13] = v_texCoord + vec2( 0.028 * blurAmount, 0.0);\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n varying vec2 v_blurTexCoords[14];\\\n void main(){\\\n gl_FragColor = vec4(0.0);\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 0])*0.0044299121055113265;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 1])*0.00895781211794;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 2])*0.0215963866053;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 3])*0.0443683338718;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 4])*0.0776744219933;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 5])*0.115876621105;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 6])*0.147308056121;\\\n gl_FragColor += texture2D(u_image, v_texCoord )*0.159576912161;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 7])*0.147308056121;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 8])*0.115876621105;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 9])*0.0776744219933;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[10])*0.0443683338718;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[11])*0.0215963866053;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[12])*0.00895781211794;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[13])*0.0044299121055113265;\\\n }\",\n \"properties\":{\n \"blurAmount\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default horizontal_blur;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/horizontalBlur.js","let verticalBlur = {\n \"title\":\"Vertical Blur\",\n \"description\": \"A vertical blur effect. Adpated from http://xissburg.com/faster-gaussian-blur-in-glsl/\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n uniform float blurAmount;\\\n varying vec2 v_blurTexCoords[14];\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n v_blurTexCoords[ 0] = v_texCoord + vec2(0.0,-0.028 * blurAmount);\\\n v_blurTexCoords[ 1] = v_texCoord + vec2(0.0,-0.024 * blurAmount);\\\n v_blurTexCoords[ 2] = v_texCoord + vec2(0.0,-0.020 * blurAmount);\\\n v_blurTexCoords[ 3] = v_texCoord + vec2(0.0,-0.016 * blurAmount);\\\n v_blurTexCoords[ 4] = v_texCoord + vec2(0.0,-0.012 * blurAmount);\\\n v_blurTexCoords[ 5] = v_texCoord + vec2(0.0,-0.008 * blurAmount);\\\n v_blurTexCoords[ 6] = v_texCoord + vec2(0.0,-0.004 * blurAmount);\\\n v_blurTexCoords[ 7] = v_texCoord + vec2(0.0, 0.004 * blurAmount);\\\n v_blurTexCoords[ 8] = v_texCoord + vec2(0.0, 0.008 * blurAmount);\\\n v_blurTexCoords[ 9] = v_texCoord + vec2(0.0, 0.012 * blurAmount);\\\n v_blurTexCoords[10] = v_texCoord + vec2(0.0, 0.016 * blurAmount);\\\n v_blurTexCoords[11] = v_texCoord + vec2(0.0, 0.020 * blurAmount);\\\n v_blurTexCoords[12] = v_texCoord + vec2(0.0, 0.024 * blurAmount);\\\n v_blurTexCoords[13] = v_texCoord + vec2(0.0, 0.028 * blurAmount);\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n varying vec2 v_blurTexCoords[14];\\\n void main(){\\\n gl_FragColor = vec4(0.0);\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 0])*0.0044299121055113265;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 1])*0.00895781211794;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 2])*0.0215963866053;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 3])*0.0443683338718;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 4])*0.0776744219933;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 5])*0.115876621105;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 6])*0.147308056121;\\\n gl_FragColor += texture2D(u_image, v_texCoord )*0.159576912161;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 7])*0.147308056121;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 8])*0.115876621105;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[ 9])*0.0776744219933;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[10])*0.0443683338718;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[11])*0.0215963866053;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[12])*0.00895781211794;\\\n gl_FragColor += texture2D(u_image, v_blurTexCoords[13])*0.0044299121055113265;\\\n }\",\n \"properties\":{\n \"blurAmount\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default verticalBlur;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/verticalBlur.js","let aaf_video_flop = {\n \"title\":\"AAF Video Flop Effect\",\n \"description\": \"A flop effect based on the AAF spec. Mirrors the image in the y-axis\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n void main(){\\\n vec2 coord = vec2(1.0 - v_texCoord[0] ,v_texCoord[1]);\\\n vec4 color = texture2D(u_image, coord);\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_flop;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_flop.js","let aaf_video_flip = {\n \"title\":\"AAF Video Scale Effect\",\n \"description\": \"A flip effect based on the AAF spec. Mirrors the image in the x-axis\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n void main(){\\\n vec2 coord = vec2(v_texCoord[0] ,1.0 - v_texCoord[1]);\\\n vec4 color = texture2D(u_image, coord);\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_flip;\n\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_flip.js","let aaf_video_position = {\n \"title\":\"AAF Video Position Effect\",\n \"description\": \"A position effect based on the AAF spec.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float positionOffsetX;\\\n uniform float positionOffsetY;\\\n varying vec2 v_texCoord;\\\n varying float v_progress;\\\n void main(){\\\n vec2 pos = vec2(v_texCoord[0] - positionOffsetX/2.0, v_texCoord[1] - positionOffsetY/2.0);\\\n vec4 color = texture2D(u_image, pos);\\\n if (pos[0] < 0.0 || pos[0] > 1.0 || pos[1] < 0.0 || pos[1] > 1.0){\\\n color = vec4(0.0,0.0,0.0,0.0);\\\n }\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"positionOffsetX\":{\"type\":\"uniform\", \"value\":0.0},\n \"positionOffsetY\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_position;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_position.js","let aaf_video_crop = {\n \"title\":\"AAF Video Crop Effect\",\n \"description\": \"A crop effect based on the AAF spec.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float cropLeft;\\\n uniform float cropRight;\\\n uniform float cropTop;\\\n uniform float cropBottom;\\\n varying vec2 v_texCoord;\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n if (v_texCoord[0] < (cropLeft+1.0)/2.0) color = vec4(0.0,0.0,0.0,0.0);\\\n if (v_texCoord[0] > (cropRight+1.0)/2.0) color = vec4(0.0,0.0,0.0,0.0);\\\n if (v_texCoord[1] < (-cropBottom+1.0)/2.0) color = vec4(0.0,0.0,0.0,0.0);\\\n if (v_texCoord[1] > (-cropTop+1.0)/2.0) color = vec4(0.0,0.0,0.0,0.0);\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"cropLeft\":{\"type\":\"uniform\", \"value\":-1.0},\n \"cropRight\":{\"type\":\"uniform\", \"value\":1.0},\n \"cropTop\":{\"type\":\"uniform\", \"value\": -1.0},\n \"cropBottom\":{\"type\":\"uniform\", \"value\": 1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default aaf_video_crop;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/aaf_video_crop.js","let staticDissolve = {\n \"title\":\"Static Dissolve\",\n \"description\": \"A static dissolve effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n uniform float currentTime;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n float rand(vec2 co, float currentTime){\\\n return fract(sin(dot(co.xy,vec2(12.9898,78.233))+currentTime) * 43758.5453);\\\n }\\\n void main(){\\\n vec4 color_a = texture2D(u_image_a, v_texCoord);\\\n vec4 color_b = texture2D(u_image_b, v_texCoord);\\\n if (clamp(rand(v_texCoord, currentTime), 0.01, 1.001) > mix){\\\n gl_FragColor = color_a;\\\n } else {\\\n gl_FragColor = color_b;\\\n }\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default staticDissolve;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/staticDissolve.js","let staticEffect = {\n \"title\":\"Static\",\n \"description\": \"A static effect to add pseudo random noise to a video\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float currentTime;\\\n uniform float amount;\\\n varying vec2 v_texCoord;\\\n uniform vec3 weight;\\\n float rand(vec2 co, float currentTime){\\\n return fract(sin(dot(co.xy,vec2(12.9898,78.233))+currentTime) * 43758.5453);\\\n }\\\n void main(){\\\n vec4 color = texture2D(u_image, v_texCoord);\\\n color[0] = color[0] + (2.0*(clamp(rand(v_texCoord, currentTime), 0.01, 1.001)-0.5)) * weight[0] * amount;\\\n color[1] = color[1] + (2.0*(clamp(rand(v_texCoord, currentTime), 0.01, 1.001)-0.5)) * weight[1] * amount;\\\n color[2] = color[2] + (2.0*(clamp(rand(v_texCoord, currentTime), 0.01, 1.001)-0.5)) * weight[2] *amount;\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"weight\":{\"type\":\"uniform\", \"value\":[1.0,1.0,1.0]},\n \"amount\":{\"type\":\"uniform\", \"value\":1.0}\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default staticEffect;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/staticEffect.js","let dreamfade = {\n \"title\":\"Dream-Fade\",\n \"description\": \"A wobbly dream effect. Typically used as a transistion.\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image_a;\\\n uniform sampler2D u_image_b;\\\n uniform float mix;\\\n varying vec2 v_texCoord;\\\n varying float v_mix;\\\n void main(){\\\n float wobble = 1.0 - abs((mix*2.0)-1.0);\\\n vec2 pos = vec2(v_texCoord[0] + ((sin(v_texCoord[1]*(10.0*wobble*3.14) + wobble*10.0)/13.0)), v_texCoord[1]);\\\n vec4 color_a = texture2D(u_image_a, pos);\\\n vec4 color_b = texture2D(u_image_b, pos);\\\n color_a[0] *= (1.0 - mix);\\\n color_a[1] *= (1.0 - mix);\\\n color_a[2] *= (1.0 - mix);\\\n color_a[3] *= (1.0 - mix);\\\n color_b[0] *= mix;\\\n color_b[1] *= mix;\\\n color_b[2] *= mix;\\\n color_b[3] *= mix;\\\n gl_FragColor = color_a + color_b;\\\n }\",\n \"properties\":{\n \"mix\":{\"type\":\"uniform\", \"value\":0.0}\n },\n \"inputs\":[\"u_image_a\",\"u_image_b\"]\n};\n\nexport default dreamfade;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/dreamfade.js","const opacity = {\n \"title\": \"Opacity\",\n \"description\": \"Sets the opacity of an input.\",\n \"vertexShader\": `\n attribute vec2 a_position;\n attribute vec2 a_texCoord;\n varying vec2 v_texCoord;\n void main() {\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\n v_texCoord = a_texCoord;\n }`,\n \"fragmentShader\": `\n precision mediump float;\n uniform sampler2D u_image;\n uniform float opacity;\n varying vec2 v_texCoord;\n varying float v_opacity;\n void main(){\n vec4 color = texture2D(u_image, v_texCoord);\n color[3] *= opacity;\n gl_FragColor = color;\n }`,\n \"properties\": {\n \"opacity\": {\"type\": \"uniform\", \"value\": 0.7},\n },\n \"inputs\": [\"u_image\"],\n};\n\nexport default opacity;\n\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/opacity.js","let crop = {\n \"title\":\"Primer Simple Crop\",\n \"description\": \"A simple crop processors for primer\",\n \"vertexShader\" : \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\",\n \"fragmentShader\" : \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n uniform float x;\\\n uniform float y;\\\n uniform float width;\\\n uniform float height;\\\n varying vec2 v_texCoord;\\\n varying float v_progress;\\\n void main(){\\\n vec2 pos = (((v_texCoord)*vec2(width, height)) + vec2(0, 1.0-height)) +vec2(x,-y);\\\n vec4 color = texture2D(u_image, pos);\\\n if (pos[0] < 0.0 || pos[0] > 1.0 || pos[1] < 0.0 || pos[1] > 1.0){\\\n color = vec4(0.0,0.0,0.0,0.0);\\\n }\\\n gl_FragColor = color;\\\n }\",\n \"properties\":{\n \"x\":{type:\"uniform\", value:0.0},\n \"y\":{type:\"uniform\", value:0.0},\n \"width\":{type:\"uniform\", value:1.0},\n \"height\":{type:\"uniform\", value:1.0},\n },\n \"inputs\":[\"u_image\"]\n};\n\nexport default crop;\n\n\n// WEBPACK FOOTER //\n// ./src/Definitions/crop.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nclass GraphNode {\n /**\n * Base class from which all processing and source nodes are derrived.\n */\n constructor(gl, renderGraph, inputNames, limitConnections=false){\n this._renderGraph = renderGraph;\n this._limitConnections = limitConnections;\n this._inputNames = inputNames;\n this._destroyed = false;\n\n //Setup WebGL output texture\n this._gl = gl;\n this._renderGraph = renderGraph;\n this._rendered =false;\n this._displayName = \"GraphNode\";\n }\n\n /**\n * Get a string representation of the class name.\n *\n * @return String A string of the class name.\n */ \n get displayName(){\n return this._displayName;\n }\n\n /**\n * Get the names of the inputs to this node.\n *\n * @return {String[]} An array of the names of the inputs ot the node.\n */ \n get inputNames(){\n return this._inputNames.slice();\n }\n\n /**\n * The maximum number of connections that can be made to this node. If there is not limit this will return Infinity.\n *\n * @return {number} The number of connections which can be made to this node.\n */\n get maximumConnections(){\n if (this._limitConnections ===false) return Infinity;\n return this._inputNames.length;\n }\n\n /**\n * Get an array of all the nodes which connect to this node.\n *\n * @return {GraphNode[]} An array of nodes which connect to this node.\n */\n get inputs(){\n let result = this._renderGraph.getInputsForNode(this);\n result = result.filter(function(n){return n !== undefined;});\n return result;\n }\n \n /**\n * Get an array of all the nodes which this node outputs to.\n *\n * @return {GraphNode[]} An array of nodes which this node connects to.\n */\n get outputs(){\n return this._renderGraph.getOutputsForNode(this);\n }\n\n /**\n * Get whether the node has been destroyed or not.\n *\n * @return {boolean} A true/false value of whather the node has been destoryed or not.\n */\n get destroyed(){\n return this._destroyed;\n }\n\n\n /**\n * Connect this node to the targetNode\n * \n * @param {GraphNode} targetNode - the node to connect.\n * @param {(number| String)} [targetPort] - the port on the targetNode to connect to, this can be an index, a string identifier, or undefined (in which case the next available port will be connected to).\n * \n */\n connect(targetNode, targetPort){\n return (this._renderGraph.registerConnection(this, targetNode, targetPort));\n }\n \n /**\n * Disconnect this node from the targetNode. If targetNode is undefind remove all out-bound connections.\n *\n * @param {GraphNode} [targetNode] - the node to disconnect from. If undefined, disconnect from all nodes.\n *\n */\n disconnect(targetNode){\n if (targetNode === undefined){\n let toRemove = this._renderGraph.getOutputsForNode(this);\n toRemove.forEach((target) => this._renderGraph.unregisterConnection(this, target));\n if (toRemove.length > 0) return true;\n return false;\n }\n return this._renderGraph.unregisterConnection(this, targetNode);\n }\n\n /**\n * Destory this node, removing it from the graph.\n */\n destroy(){\n this.disconnect();\n for (let input of this.inputs){\n input.disconnect(this);\n }\n this._destroyed = true;\n }\n}\n\nexport default GraphNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/graphnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport SourceNode, { SOURCENODESTATE } from \"./sourcenode\";\n\nclass ImageNode extends SourceNode {\n /**\n * Initialise an instance of an ImageNode.\n * This should not be called directly, but created through a call to videoContext.createImageNode();\n */\n constructor(src, gl, renderGraph, currentTime, preloadTime = 4, attributes = {}){\n super(src, gl, renderGraph, currentTime);\n this._preloadTime = preloadTime;\n this._attributes = attributes;\n this._textureUploaded = false;\n this._displayName = \"ImageNode\";\n }\n\n get elementURL(){\n return this._elementURL;\n }\n\n _load(){\n\n if (this._element !== undefined){\n for (var key in this._attributes) {\n this._element[key] = this._attributes[key];\n }\n return;\n }\n if (this._isResponsibleForElementLifeCycle){\n super._load();\n this._element = new Image();\n this._element.setAttribute(\"crossorigin\", \"anonymous\");\n this._element.src = this._elementURL;\n this._element.onload = () => {\n this._ready = true;\n this._triggerCallbacks(\"loaded\");\n };\n this._element.onerror = () => {\n console.error(\"ImageNode failed to load. url:\", this._elementURL);\n };\n\n for (let key in this._attributes) {\n this._element[key] = this._attributes[key];\n }\n }\n this._element.onerror = () => {\n console.debug(\"Error with element\", this._element);\n this._state = SOURCENODESTATE.error;\n //Event though there's an error ready should be set to true so the node can output transparenn\n this._ready = true;\n this._triggerCallbacks(\"error\");\n };\n }\n\n _unload(){\n super._unload();\n if (this._isResponsibleForElementLifeCycle){\n this._element.src = \"\";\n this._element.onerror = undefined;\n this._element = undefined;\n delete this._element;\n }\n this._ready = false;\n }\n\n _seek(time){\n super._seek(time);\n if (this.state === SOURCENODESTATE.playing || this.state === SOURCENODESTATE.paused){\n if (this._element === undefined) this._load();\n }\n if((this._state === SOURCENODESTATE.sequenced || this._state === SOURCENODESTATE.ended) && this._element !== undefined){\n this._unload();\n }\n }\n\n _update(currentTime){\n //if (!super._update(currentTime)) return false;\n if (this._textureUploaded){\n super._update(currentTime, false);\n }else{\n super._update(currentTime);\n }\n\n if (this._startTime - this._currentTime <= this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();\n\n if (this._state === SOURCENODESTATE.playing){\n return true;\n } else if (this._state === SOURCENODESTATE.paused){\n return true;\n }\n else if (this._state === SOURCENODESTATE.ended && this._element !== undefined){\n this._unload();\n return false;\n }\n\n }\n\n}\n\nexport default ImageNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/SourceNodes/imagenode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport SourceNode, { SOURCENODESTATE } from \"./sourcenode\";\n\nclass CanvasNode extends SourceNode {\n /**\n * Initialise an instance of a CanvasNode.\n * This should not be called directly, but created through a call to videoContext.createCanvasNode();\n */\n constructor(canvas, gl, renderGraph, currentTime, preloadTime = 4){\n super(canvas, gl, renderGraph, currentTime);\n this._preloadTime = preloadTime;\n this._displayName = \"CanvasNode\";\n }\n\n _load(){\n super._load();\n this._ready = true;\n this._triggerCallbacks(\"loaded\");\n }\n\n _unload(){\n super._unload();\n this._ready = false;\n }\n\n _seek(time){\n super._seek(time);\n if (this.state === SOURCENODESTATE.playing || this.state === SOURCENODESTATE.paused){\n if (this._element === undefined) this._load();\n this._ready = false;\n }\n if((this._state === SOURCENODESTATE.sequenced || this._state === SOURCENODESTATE.ended) && this._element !== undefined){\n this._unload();\n }\n }\n\n _update(currentTime){\n //if (!super._update(currentTime)) return false;\n super._update(currentTime);\n if (this._startTime - this._currentTime <= this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();\n\n if (this._state === SOURCENODESTATE.playing){\n return true;\n } else if (this._state === SOURCENODESTATE.paused){\n return true;\n }\n else if (this._state === SOURCENODESTATE.ended && this._element !== undefined){\n this._unload();\n return false;\n }\n\n }\n\n}\n\nexport default CanvasNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/SourceNodes/canvasnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport ProcessingNode from \"./processingnode\";\nimport { createElementTexutre } from \"../utils.js\";\n\nclass CompositingNode extends ProcessingNode{\n /**\n * Initialise an instance of a Compositing Node. You should not instantiate this directly, but use VideoContest.createCompositingNode().\n */\n constructor(gl, renderGraph, definition){\n let placeholderTexture = createElementTexutre(gl);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));\n super(gl, renderGraph, definition, definition.inputs, false);\n this._placeholderTexture = placeholderTexture;\n this._displayName = \"CompositingNode\";\n }\n\n _render(){\n let gl = this._gl; \n gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this._texture,0);\n gl.clearColor(0, 0, 0, 0); // green;\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\n this.inputs.forEach((node) => {\n if (node === undefined)return;\n super._render();\n\n //map the input textures input the node\n var texture = node._texture;\n let textureOffset = 0;\n\n for(let mapping of this._inputTextureUnitMapping ){\n gl.activeTexture(mapping.textureUnit);\n let textureLocation = gl.getUniformLocation(this._program, mapping.name);\n gl.uniform1i(textureLocation, this._parameterTextureCount + textureOffset);\n textureOffset += 1;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n }\n\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n });\n \n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n}\n\nexport default CompositingNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ProcessingNodes/compositingnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport GraphNode from \"../graphnode\";\nimport { compileShader, createShaderProgram, createElementTexutre, updateTexture } from \"../utils.js\";\nimport { RenderException } from \"../exceptions.js\";\n\nclass ProcessingNode extends GraphNode{\n /**\n * Initialise an instance of a ProcessingNode.\n *\n * This class is not used directly, but is extended to create CompositingNodes, TransitionNodes, and EffectNodes.\n */\n constructor(gl, renderGraph, definition, inputNames, limitConnections){\n super(gl, renderGraph, inputNames, limitConnections);\n this._vertexShader = compileShader(gl, definition.vertexShader, gl.VERTEX_SHADER);\n this._fragmentShader = compileShader(gl, definition.fragmentShader, gl.FRAGMENT_SHADER);\n this._definition = definition;\n this._properties = {};//definition.properties;\n //copy definition properties\n for(let propertyName in definition.properties){\n let propertyValue = definition.properties[propertyName].value;\n //if an array then shallow copy it\n if(Object.prototype.toString.call(propertyValue) === \"[object Array]\"){\n propertyValue = definition.properties[propertyName].value.slice();\n }\n let propertyType = definition.properties[propertyName].type;\n this._properties[propertyName] = {type:propertyType, value:propertyValue};\n }\n\n this._inputTextureUnitMapping =[];\n this._maxTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n this._boundTextureUnits = 0;\n this._parameterTextureCount = 0;\n this._inputTextureCount = 0;\n this._texture = createElementTexutre(gl);\n gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGBA, gl.canvas.width, gl.canvas.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n //compile the shader\n this._program = createShaderProgram(gl, this._vertexShader, this._fragmentShader);\n\n //create and setup the framebuffer\n this._framebuffer = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this._texture,0);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n //create properties on this object for the passed properties\n for (let propertyName in this._properties){\n Object.defineProperty(this, propertyName, {\n get:function(){return this._properties[propertyName].value;},\n set:function(passedValue){this._properties[propertyName].value = passedValue;}\n });\n }\n\n //create texutres for any texture properties\n for (let propertyName in this._properties){\n let propertyValue = this._properties[propertyName].value;\n if (propertyValue instanceof Image){\n this._properties[propertyName].texture = createElementTexutre(gl);\n this._properties[propertyName].texutreUnit = gl.TEXTURE0 + this._boundTextureUnits;\n this._boundTextureUnits += 1;\n this._parameterTextureCount +=1;\n if (this._boundTextureUnits > this._maxTextureUnits){\n throw new RenderException(\"Trying to bind more than available textures units to shader\");\n }\n }\n }\n\n //calculate texutre units for input textures\n for(let inputName of definition.inputs){\n this._inputTextureUnitMapping.push({name:inputName, textureUnit:gl.TEXTURE0 + this._boundTextureUnits});\n this._boundTextureUnits += 1;\n this._inputTextureCount += 1;\n if (this._boundTextureUnits > this._maxTextureUnits){\n throw new RenderException(\"Trying to bind more than available textures units to shader\");\n }\n }\n\n\n //find the locations of the properties in the compiled shader\n for (let propertyName in this._properties){\n if (this._properties[propertyName].type === \"uniform\"){\n this._properties[propertyName].location = this._gl.getUniformLocation(this._program, propertyName);\n }\n }\n this._currentTimeLocation = this._gl.getUniformLocation(this._program, \"currentTime\");\n this._currentTime = 0;\n\n\n //Other setup\n let positionLocation = gl.getAttribLocation(this._program, \"a_position\");\n let buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.enableVertexAttribArray(positionLocation);\n gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);\n gl.bufferData(\n gl.ARRAY_BUFFER,\n new Float32Array([\n 1.0, 1.0,\n 0.0, 1.0,\n 1.0, 0.0,\n 1.0, 0.0,\n 0.0, 1.0,\n 0.0, 0.0]),\n gl.STATIC_DRAW);\n let texCoordLocation = gl.getAttribLocation(this._program, \"a_texCoord\");\n gl.enableVertexAttribArray(texCoordLocation);\n gl.vertexAttribPointer(texCoordLocation, 2, gl.FLOAT, false, 0, 0);\n this._displayName = \"ProcessingNode\";\n\n }\n\n /**\n * Sets the passed processing node property to the passed value.\n * @param {string} name - The name of the processing node parameter to modify.\n * @param {Object} value - The value to set it to.\n *\n * @example \n * var ctx = new VideoContext();\n * var monoNode = ctx.effect(VideoContext.DEFINITIONS.MONOCHROME);\n * monoNode.setProperty(\"inputMix\", [1.0,0.0,0.0]); //Just use red channel\n */\n setProperty(name, value){\n this._properties[name].value = value;\n }\n\n /**\n * Sets the passed processing node property to the passed value.\n * @param {string} name - The name of the processing node parameter to get.\n *\n * @example \n * var ctx = new VideoContext();\n * var monoNode = ctx.effect(VideoContext.DEFINITIONS.MONOCHROME);\n * console.log(monoNode.getProperty(\"inputMix\")); //Will output [0.4,0.6,0.2], the default value from the effect definition.\n * \n */\n getProperty(name){\n return this._properties[name].value;\n }\n\n /**\n * Destroy and clean-up the node.\n */\n destroy(){\n super.destroy();\n //destrpy texutres for any texture properties\n for (let propertyName in this._properties){\n let propertyValue = this._properties[propertyName].value;\n if (propertyValue instanceof Image){\n this._gl.deleteTexture(this._properties[propertyName].texture);\n this._texture = undefined;\n }\n }\n //Destroy main\n this._gl.deleteTexture(this._texture);\n this._texture = undefined;\n //Detach shaders\n this._gl.detachShader(this._program, this._vertexShader);\n this._gl.detachShader(this._program, this._fragmentShader);\n //Delete shaders\n this._gl.deleteShader(this._vertexShader);\n this._gl.deleteShader(this._fragmentShader);\n //Delete program\n this._gl.deleteProgram(this._program);\n //Delete Framebuffer\n this._gl.deleteFramebuffer(this._framebuffer);\n }\n\n _update(currentTime){\n this._currentTime = currentTime;\n }\n\n _seek(currentTime){\n this._currentTime = currentTime;\n }\n\n _render(){\n this._rendered = true;\n let gl = this._gl;\n gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);\n\n gl.useProgram(this._program);\n\n //upload the default uniforms\n gl.uniform1f(this._currentTimeLocation, parseFloat(this._currentTime));\n\n //upload/update the custom uniforms\n let textureOffset = 0;\n\n for (let propertyName in this._properties){\n let propertyValue = this._properties[propertyName].value;\n let propertyType = this._properties[propertyName].type;\n let propertyLocation = this._properties[propertyName].location;\n if (propertyType !== \"uniform\") continue;\n\n if (typeof propertyValue === \"number\"){\n gl.uniform1f(propertyLocation, propertyValue);\n }\n else if( Object.prototype.toString.call(propertyValue) === \"[object Array]\"){\n if(propertyValue.length === 1){\n gl.uniform1fv(propertyLocation, propertyValue);\n } else if(propertyValue.length === 2){\n gl.uniform2fv(propertyLocation, propertyValue);\n } else if(propertyValue.length === 3){\n gl.uniform3fv(propertyLocation, propertyValue);\n } else if(propertyValue.length === 4){\n gl.uniform4fv(propertyLocation, propertyValue);\n } else{\n console.debug(\"Shader parameter\", propertyName, \"is too long an array:\", propertyValue);\n }\n } else if(propertyValue instanceof Image){\n let texture = this._properties[propertyName].texture;\n let textureUnit = this._properties[propertyName].texutreUnit;\n updateTexture(gl, texture, propertyValue);\n\n gl.activeTexture(textureUnit);\n gl.uniform1i(propertyLocation, textureOffset);\n textureOffset += 1;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n }\n else{\n //TODO - add tests for textures\n /*gl.activeTexture(gl.TEXTURE0 + textureOffset);\n gl.uniform1i(parameterLoctation, textureOffset);\n gl.bindTexture(gl.TEXTURE_2D, textures[textureOffset-1]);*/\n }\n }\n\n }\n}\n\nexport default ProcessingNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ProcessingNodes/processingnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nexport function ConnectException(message){\n this.message = message;\n this.name = \"ConnectionException\";\n}\n\nexport function RenderException(message){\n this.message = message;\n this.name = \"RenderException\";\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/exceptions.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport ProcessingNode from \"../ProcessingNodes/processingnode\";\n\nclass DestinationNode extends ProcessingNode {\n /**\n * Initialise an instance of a DestinationNode. \n *\n * There should only be a single instance of a DestinationNode per VideoContext instance. An VideoContext's destination can be accessed like so: videoContext.desitnation.\n * \n * You should not instantiate this directly.\n */\n constructor(gl, renderGraph){ \n \n let vertexShader = \"\\\n attribute vec2 a_position;\\\n attribute vec2 a_texCoord;\\\n varying vec2 v_texCoord;\\\n void main() {\\\n gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\\\n v_texCoord = a_texCoord;\\\n }\";\n\n let fragmentShader = \"\\\n precision mediump float;\\\n uniform sampler2D u_image;\\\n varying vec2 v_texCoord;\\\n varying float v_progress;\\\n void main(){\\\n gl_FragColor = texture2D(u_image, v_texCoord);\\\n }\";\n\n let deffinition = {fragmentShader:fragmentShader, vertexShader:vertexShader, properties:{}, inputs:[\"u_image\"]};\n\n super(gl, renderGraph, deffinition, deffinition.inputs, false);\n this._displayName = \"DestinationNode\";\n }\n\n _render(){\n let gl = this._gl; \n\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n gl.enable(gl.BLEND);\n gl.clearColor(0, 0, 0, 0.0); // green;\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n this.inputs.forEach((node)=>{\n super._render();\n //map the input textures input the node\n var texture = node._texture;\n let textureOffset = 0;\n\n for(let mapping of this._inputTextureUnitMapping ){\n gl.activeTexture(mapping.textureUnit);\n let textureLocation = gl.getUniformLocation(this._program, mapping.name);\n gl.uniform1i(textureLocation, this._parameterTextureCount + textureOffset);\n textureOffset += 1;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n }\n\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n });\n }\n}\n\nexport default DestinationNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/DestinationNode/destinationnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport ProcessingNode from \"./processingnode\";\nimport { createElementTexutre } from \"../utils.js\";\n\nclass EffectNode extends ProcessingNode{\n /**\n * Initialise an instance of an EffectNode. You should not instantiate this directly, but use VideoContest.createEffectNode().\n */\n constructor(gl, renderGraph, definition){\n let placeholderTexture = createElementTexutre(gl);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));\n\n super(gl, renderGraph, definition, definition.inputs, true);\n \n this._placeholderTexture = placeholderTexture;\n this._displayName = \"EffectNode\";\n }\n \n _render(){\n let gl = this._gl;\n gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this._texture,0);\n gl.clearColor(0, 0, 0, 0); // green;\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n super._render();\n\n let inputs = this._renderGraph.getInputsForNode(this);\n let textureOffset = 0;\n\n for (var i = 0; i < this._inputTextureUnitMapping.length; i++) {\n let inputTexture = this._placeholderTexture; \n let textureUnit = this._inputTextureUnitMapping[i].textureUnit;\n let textureName = this._inputTextureUnitMapping[i].name;\n if (i < inputs.length && inputs[i] !== undefined){\n inputTexture = inputs[i]._texture;\n }\n\n gl.activeTexture(textureUnit);\n let textureLocation = gl.getUniformLocation(this._program, textureName);\n gl.uniform1i(textureLocation, this._parameterTextureCount + textureOffset);\n textureOffset += 1;\n gl.bindTexture(gl.TEXTURE_2D, inputTexture);\n }\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n}\n\nexport default EffectNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ProcessingNodes/effectnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport EffectNode from \"./effectnode\";\n\nclass TransitionNode extends EffectNode{\n /**\n * Initialise an instance of a TransitionNode. You should not instantiate this directly, but use VideoContest.createTransitonNode().\n */\n constructor(gl, renderGraph, definition){\n super(gl, renderGraph, definition);\n this._transitions = {};\n \n //save a version of the original property values\n this._initialPropertyValues = {};\n for (let propertyName in this._properties){\n this._initialPropertyValues[propertyName] = this._properties[propertyName].value;\n }\n this._displayName = \"TransitionNode\";\n }\n\n _doesTransitionFitOnTimeline(testTransition){\n if (this._transitions[testTransition.property] === undefined) return true;\n for (let transition of this._transitions[testTransition.property]) {\n if (testTransition.start > transition.start && testTransition.start < transition.end)return false;\n if (testTransition.end > transition.start && testTransition.end < transition.end)return false;\n if(transition.start > testTransition.start && transition.start < testTransition.end) return false;\n if(transition.end > testTransition.start && transition.end < testTransition.end) return false;\n }\n return true;\n }\n\n _insertTransitionInTimeline(transition){\n if (this._transitions[transition.property] === undefined) this._transitions[transition.property] = [];\n this._transitions[transition.property].push(transition);\n\n this._transitions[transition.property].sort(function(a,b){\n return a.start - b.start;\n });\n }\n\n /**\n * Create a transition on the timeline.\n * \n * @param {number} startTime - The time at which the transition should start (relative to currentTime of video context).\n * @param {number} endTime - The time at which the transition should be completed by (relative to currentTime of video context).\n * @param {number} currentValue - The value to start the transition at.\n * @param {number} targetValue - The value to transition to by endTime.\n * @param {String} propertyName - The name of the property to clear transitions on, if undefined default to \"mix\".\n * \n * @return {Boolean} returns True if a transition is successfully added, false otherwise.\n */\n transition(startTime, endTime, currentValue, targetValue, propertyName=\"mix\"){\n let transition = {start:startTime + this._currentTime, end:endTime + this._currentTime, current:currentValue, target:targetValue, property:propertyName};\n if (!this._doesTransitionFitOnTimeline(transition))return false;\n this._insertTransitionInTimeline(transition);\n return true;\n }\n\n\n /**\n * Create a transition on the timeline at an absolute time.\n * \n * @param {number} startTime - The time at which the transition should start (relative to time 0).\n * @param {number} endTime - The time at which the transition should be completed by (relative to time 0).\n * @param {number} currentValue - The value to start the transition at.\n * @param {number} targetValue - The value to transition to by endTime.\n * @param {String} propertyName - The name of the property to clear transitions on, if undefined default to \"mix\".\n * \n * @return {Boolean} returns True if a transition is successfully added, false otherwise.\n */\n transitionAt(startTime, endTime, currentValue, targetValue, propertyName=\"mix\"){\n let transition = {start:startTime, end:endTime, current:currentValue, target:targetValue, property:propertyName};\n if (!this._doesTransitionFitOnTimeline(transition))return false;\n this._insertTransitionInTimeline(transition);\n return true;\n }\n\n /**\n * Clear all transistions on the passed property. If no property is defined clear all transitions on the node.\n * \n * @param {String} propertyName - The name of the property to clear transitions on, if undefined clear all transitions on the node.\n */\n clearTransitions(propertyName){\n if (propertyName === undefined){\n this._transitions = {};\n }else{\n this._transitions[propertyName] = [];\n }\n }\n \n /**\n * Clear a transistion on the passed property that the specified time lies within.\n * \n * @param {String} propertyName - The name of the property to clear a transition on.\n * @param {number} time - A time which lies within the property you're trying to clear.\n *\n * @return {Boolean} returns True if a transition is removed, false otherwise.\n */\n clearTransition(propertyName, time){\n let transitionIndex = undefined;\n for (var i = 0; i < this._transitions[propertyName].length; i++) {\n let transition = this._transitions[propertyName][i];\n if (time > transition.start && time < transition.end){\n transitionIndex = i;\n }\n }\n if(transitionIndex !== undefined){\n this._transitions[propertyName].splice(transitionIndex, 1);\n return true;\n }\n return false;\n }\n\n _update(currentTime){\n super._update(currentTime);\n for (let propertyName in this._transitions){\n let value = this[propertyName];\n if (this._transitions[propertyName].length > 0){\n value = this._transitions[propertyName][0].current;\n }\n let transitionActive = false;\n\n for (var i = 0; i < this._transitions[propertyName].length; i++) {\n let transition = this._transitions[propertyName][i];\n if (currentTime > transition.end){\n value = transition.target;\n continue;\n }\n\n if (currentTime > transition.start && currentTime < transition.end){\n let difference = transition.target - transition.current;\n let progress = (this._currentTime - transition.start)/(transition.end - transition.start);\n transitionActive = true;\n this[propertyName] = transition.current + (difference * progress);\n break;\n }\n }\n\n if(!transitionActive)this[propertyName] = value;\n }\n }\n}\n\nexport default TransitionNode;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ProcessingNodes/transitionnode.js","//Matthew Shotton, R&D User Experience,© BBC 2015\nimport { ConnectException } from \"./exceptions.js\";\n\n\nclass RenderGraph {\n /**\n * Manages the rendering graph.\n */\n constructor(){\n this.connections = [];\n }\n\n /**\n * Get a list of nodes which are connected to the output of the passed node.\n * \n * @param {GraphNode} node - the node to get the outputs for.\n * @return {GraphNode[]} An array of the nodes which are connected to the output.\n */\n getOutputsForNode(node){\n let results = [];\n this.connections.forEach(function(connection){\n if (connection.source === node){\n results.push(connection.destination);\n }\n });\n return results;\n }\n \n /**\n * Get a list of nodes which are connected, by input name, to the given node. Array contains objects of the form: {\"source\":sourceNode, \"type\":\"name\", \"name\":inputName, \"destination\":destinationNode}.\n *\n * @param {GraphNode} node - the node to get the named inputs for.\n * @return {Object[]} An array of objects representing the nodes and connection type, which are connected to the named inputs for the node.\n */\n getNamedInputsForNode(node){\n let results = [];\n this.connections.forEach(function(connection){\n if (connection.destination === node && connection.type === \"name\"){\n results.push(connection);\n }\n });\n return results;\n }\n\n /**\n * Get a list of nodes which are connected, by z-index name, to the given node. Array contains objects of the form: {\"source\":sourceNode, \"type\":\"zIndex\", \"zIndex\":0, \"destination\":destinationNode}.\n * \n * @param {GraphNode} node - the node to get the z-index refernced inputs for.\n * @return {Object[]} An array of objects representing the nodes and connection type, which are connected by z-Index for the node.\n */\n getZIndexInputsForNode(node){\n let results = [];\n this.connections.forEach(function(connection){\n if (connection.destination === node && connection.type === \"zIndex\"){\n results.push(connection);\n }\n });\n results.sort(function(a,b){\n return a.zIndex - b.zIndex;\n });\n return results; \n }\n\n /**\n * Get a list of nodes which are connected as inputs to the given node. The length of the return array is always equal to the number of inputs for the node, with undefined taking the place of any inputs not connected.\n * \n * @param {GraphNode} node - the node to get the inputs for.\n * @return {GraphNode[]} An array of GraphNodes which are connected to the node.\n */\n getInputsForNode(node){\n let inputNames = node.inputNames; \n let results = [];\n let namedInputs = this.getNamedInputsForNode(node);\n let indexedInputs = this.getZIndexInputsForNode(node);\n\n if(node._limitConnections === true){\n for (let i = 0; i < inputNames.length; i++) {\n results[i] = undefined;\n }\n \n for(let connection of namedInputs){\n let index = inputNames.indexOf(connection.name);\n results[index] = connection.source;\n }\n let indexedInputsIndex = 0;\n for (let i = 0; i < results.length; i++) {\n if (results[i] === undefined && indexedInputs[indexedInputsIndex]!== undefined){\n results[i] = indexedInputs[indexedInputsIndex].source;\n indexedInputsIndex += 1;\n }\n }\n }else{\n for(let connection of namedInputs){\n results.push(connection.source);\n }\n for(let connection of indexedInputs){\n results.push(connection.source);\n }\n }\n return results;\n }\n\n /**\n * Check if a named input on a node is available to connect too.\n * @param {GraphNode} node - the node to check.\n * @param {String} inputName - the named input to check.\n */\n isInputAvailable(node, inputName){\n if (node._inputNames.indexOf(inputName) === -1) return false;\n for(let connection of this.connections){\n if (connection.type === \"name\"){\n if (connection.destination === node && connection.name === inputName){\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * Register a connection between two nodes.\n * \n * @param {GraphNode} sourceNode - the node to connect from.\n * @param {GraphNode} destinationNode - the node to connect to.\n * @param {(String | number)} [target] - the target port of the conenction, this could be a string to specfiy a specific named port, a number to specify a port by index, or undefined, in which case the next available port will be connected to.\n * @return {boolean} Will return true if connection succeeds otherwise will throw a ConnectException.\n */\n registerConnection(sourceNode, destinationNode, target){\n if (destinationNode.inputs.length >= destinationNode.inputNames.length && destinationNode._limitConnections === true){\n throw new ConnectException(\"Node has reached max number of inputs, can't connect\");\n }\n \n if (destinationNode._limitConnections === false){\n //check if connection is already made, if so raise a warning\n const inputs = this.getInputsForNode(destinationNode);\n if (inputs.includes(sourceNode)){\n console.debug(\"WARNING - node connected mutliple times, removing previous connection\");\n this.unregisterConnection(sourceNode, destinationNode);\n }\n }\n\n if (typeof target === \"number\"){\n //target is a specific\n this.connections.push({\"source\":sourceNode, \"type\":\"zIndex\", \"zIndex\":target, \"destination\":destinationNode});\n } else if (typeof target === \"string\" && destinationNode._limitConnections){\n //target is a named port\n\n //make sure named port is free\n if (this.isInputAvailable(destinationNode, target)){\n this.connections.push({\"source\":sourceNode, \"type\":\"name\", \"name\":target, \"destination\":destinationNode});\n }else{\n throw new ConnectException(\"Port \"+target+\" is already connected to\");\n }\n\n } else{\n //target is undefined so just make it a high zIndex\n let indexedConns = this.getZIndexInputsForNode(destinationNode);\n let index = 0;\n if (indexedConns.length > 0)index = indexedConns[indexedConns.length-1].zIndex +1;\n this.connections.push({\"source\":sourceNode, \"type\":\"zIndex\", \"zIndex\":index, \"destination\":destinationNode});\n }\n return true;\n }\n \n /**\n * Remove a connection between two nodes.\n * @param {GraphNode} sourceNode - the node to unregsiter connection from.\n * @param {GraphNode} destinationNode - the node to register connection to.\n * @return {boolean} Will return true if removing connection succeeds, or false if there was no connectionsction to remove.\n */\n unregisterConnection(sourceNode, destinationNode){\n let toRemove = [];\n \n this.connections.forEach(function(connection){\n if (connection.source === sourceNode && connection.destination === destinationNode){\n toRemove.push(connection);\n }\n });\n\n if (toRemove.length === 0) return false;\n\n toRemove.forEach((removeNode) => {\n let index = this.connections.indexOf(removeNode);\n this.connections.splice(index, 1);\n });\n\n return true;\n }\n\n static outputEdgesFor(node, connections){\n let results = [];\n for(let conn of connections){\n if (conn.source === node){\n results.push(conn);\n }\n }\n return results;\n }\n\n static inputEdgesFor(node, connections){\n let results = [];\n for(let conn of connections){\n if (conn.destination === node){\n results.push(conn);\n }\n }\n return results;\n }\n\n static getInputlessNodes(connections){\n let inputLess = [];\n for (let conn of connections){\n inputLess.push(conn.source);\n }\n for (let conn of connections){\n let index = inputLess.indexOf(conn.destination);\n if (index !== -1){\n inputLess.splice(index, 1);\n }\n }\n return inputLess;\n }\n}\n\nexport default RenderGraph;\n\n\n\n// WEBPACK FOOTER //\n// ./src/rendergraph.js","function stripHash (url){\n if (url.port === \"\" || url.port === undefined){\n return `${url.protocol}//${url.hostname}${url.pathname}`;\n } else {\n return `${url.protocol}//${url.hostname}:${url.port}${url.pathname}`;\n }\n}\n\nclass VideoElementCache {\n\n constructor(cache_size = 3) {\n this._elements = [];\n this._elementsInitialised = false;\n for (let i = 0; i < cache_size; i++) {\n let element = this._createElement(); \n this._elements.push(element);\n }\n }\n\n\n _createElement(){\n let videoElement = document.createElement(\"video\");\n videoElement.setAttribute(\"crossorigin\", \"anonymous\");\n videoElement.setAttribute(\"webkit-playsinline\", \"\");\n videoElement.setAttribute(\"playsinline\", \"\");\n videoElement.src = \"\";\n return videoElement;\n }\n\n init(){\n if (!this._elementsInitialised){\n for(let element of this._elements){\n try {\n element.play().then(()=>{\n }, (e)=>{\n if (e.name !== \"NotSupportedError\")throw(e);\n });\n } catch(e) {\n //console.log(e.name);\n }\n } \n }\n this._elementsInitialised = true;\n }\n\n get() {\n //Try and get an already intialised element.\n for (let element of this._elements) {\n // For some reason an uninitialised videoElement has its sr attribute set to the windows href. Hence the below check.\n if ((element.src === \"\" || element.src === undefined || element.src === stripHash(window.location)) && element.srcObject == null )return element;\n }\n //Fallback to creating a new element if non exists.\n console.debug(\"No available video element in the cache, creating a new one. This may break mobile, make your initial cache larger.\");\n let element = this._createElement();\n this._elements.push(element);\n this._elementsInitialised = false;\n return element;\n }\n\n get length(){\n return this._elements.length;\n }\n\n get unused(){\n let count = 0;\n for (let element of this._elements) {\n // For some reason an uninitialised videoElement has its sr attribute set to the windows href. Hence the below check.\n if ((element.src === \"\" || element.src === undefined || element.src === stripHash(window.location)) && element.srcObject == null )count += 1;\n }\n return count;\n }\n\n}\n\nexport default VideoElementCache;\n\n\n// WEBPACK FOOTER //\n// ./src/videoelementcache.js"],"sourceRoot":""} \ No newline at end of file