videocontext
Advanced tools
Comparing version 0.44.0 to 0.45.0
{ | ||
"name": "videocontext", | ||
"version": "0.44.0", | ||
"version": "0.45.0", | ||
"description": "A WebGL & HTML5 graph based video composition library", | ||
@@ -5,0 +5,0 @@ "keywords":["video", "context", "composition", "timeline", "html5", "webgl"], |
@@ -21,4 +21,4 @@ //Matthew Shotton, R&D User Experience,© BBC 2015 | ||
_destroy(){ | ||
super._destroy(); | ||
_unload(){ | ||
super._unload(); | ||
this._ready = false; | ||
@@ -34,3 +34,3 @@ } | ||
if((this._state === SOURCENODESTATE.sequenced || this._state === SOURCENODESTATE.ended) && this._element !== undefined){ | ||
this._destroy(); | ||
this._unload(); | ||
} | ||
@@ -50,3 +50,3 @@ } | ||
else if (this._state === SOURCENODESTATE.ended && this._element !== undefined){ | ||
this._destroy(); | ||
this._unload(); | ||
return false; | ||
@@ -53,0 +53,0 @@ } |
@@ -56,4 +56,4 @@ //Matthew Shotton, R&D User Experience,© BBC 2015 | ||
_destroy(){ | ||
super._destroy(); | ||
_unload(){ | ||
super._unload(); | ||
if (this._isResponsibleForElementLifeCycle){ | ||
@@ -74,3 +74,3 @@ this._element.src = ""; | ||
if((this._state === SOURCENODESTATE.sequenced || this._state === SOURCENODESTATE.ended) && this._element !== undefined){ | ||
this._destroy(); | ||
this._unload(); | ||
} | ||
@@ -95,3 +95,3 @@ } | ||
else if (this._state === SOURCENODESTATE.ended && this._element !== undefined){ | ||
this._destroy(); | ||
this._unload(); | ||
return false; | ||
@@ -98,0 +98,0 @@ } |
@@ -131,3 +131,3 @@ //Matthew Shotton, R&D User Experience,© BBC 2015 | ||
_destroy(){ | ||
_unload (){ | ||
this._triggerCallbacks("destroy"); | ||
@@ -138,3 +138,3 @@ this._loadCalled = false; | ||
/** | ||
* Register callbacks against one of these events: "load", "destory", "seek", "pause", "play", "ended", "durationchange", "loaded", "error" | ||
* Register callbacks against one of these events: "load", "destroy", "seek", "pause", "play", "ended", "durationchange", "loaded", "error" | ||
* | ||
@@ -396,4 +396,4 @@ * @param {String} type - the type of event to register the callback against. | ||
destroy(){ | ||
this._unload(); | ||
super.destroy(); | ||
this._triggerCallbacks("destroy"); | ||
this.unregisterCallback(); | ||
@@ -400,0 +400,0 @@ delete this._element; |
@@ -123,6 +123,7 @@ //Matthew Shotton, R&D User Experience,© BBC 2015 | ||
_destroy(){ | ||
super._destroy(); | ||
_unload(){ | ||
super._unload(); | ||
if (this._isResponsibleForElementLifeCycle && this._element !== undefined){ | ||
this._element.src = ""; | ||
this._element.srcObject = undefined; | ||
for (let key in this._attributes){ | ||
@@ -147,3 +148,3 @@ this._element.removeAttribute(key); | ||
if((this._state === SOURCENODESTATE.sequenced || this._state === SOURCENODESTATE.ended) && this._element !== undefined){ | ||
this._destroy(); | ||
this._unload(); | ||
} | ||
@@ -187,3 +188,3 @@ } | ||
if (this._isElementPlaying){ | ||
this._destroy(); | ||
this._unload(); | ||
} | ||
@@ -200,3 +201,3 @@ return false; | ||
} | ||
this._destroy(); | ||
this._unload(); | ||
} | ||
@@ -206,5 +207,3 @@ | ||
if (this._element) this._element.pause(); | ||
this._isElementPlaying = false; | ||
super.destroy(); | ||
this._destroy(); | ||
} | ||
@@ -211,0 +210,0 @@ |
@@ -0,1 +1,3 @@ | ||
const stripHash = url => `${url.protocol}//${url.hostname}:${url.port}${url.pathname}`; | ||
class VideoElementCache { | ||
@@ -42,3 +44,3 @@ | ||
// For some reason an uninitialised videoElement has its sr attribute set to the windows href. Hence the below check. | ||
if (element.src === "" || element.src === undefined || element.src === window.location.href) return element; | ||
if ((element.src === "" || element.src === undefined || element.src === stripHash(window.location)) && element.srcObject == null )return element; | ||
} | ||
@@ -61,3 +63,3 @@ //Fallback to creating a new element if non exists. | ||
// For some reason an uninitialised videoElement has its sr attribute set to the windows href. Hence the below check. | ||
if (element.src === "" || element.src === undefined || element.src === window.location.href) count += 1; | ||
if ((element.src === "" || element.src === undefined || element.src === stripHash(window.location)) && element.srcObject == null )count += 1; | ||
} | ||
@@ -64,0 +66,0 @@ return count; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6765679
25986