diff --git a/src/layer/ImageOverlay.js b/src/layer/ImageOverlay.js index e8903787..161a854a 100644 --- a/src/layer/ImageOverlay.js +++ b/src/layer/ImageOverlay.js @@ -202,7 +202,10 @@ export var ImageOverlay = Layer.extend({ this._updateZIndex(); } - if (wasElementSupplied) { return; } + if (wasElementSupplied) { + this._url = img.src; + return; + } img.src = this._url; img.alt = this.options.alt; diff --git a/src/layer/VideoOverlay.js b/src/layer/VideoOverlay.js index 44df0f33..5ff41322 100644 --- a/src/layer/VideoOverlay.js +++ b/src/layer/VideoOverlay.js @@ -49,7 +49,10 @@ export var VideoOverlay = ImageOverlay.extend({ // Fired when the video has finished loading the first frame vid.onloadeddata = Util.bind(this.fire, this, 'load'); - if (wasElementSupplied) { return; } + if (wasElementSupplied) { + this._url = vid.src; + return; + } if (!Util.isArray(this._url)) { this._url = [this._url]; }