diff --git a/src/geo/ui/infowindow-view.js b/src/geo/ui/infowindow-view.js index e05c558..e3937b1 100644 --- a/src/geo/ui/infowindow-view.js +++ b/src/geo/ui/infowindow-view.js @@ -114,6 +114,10 @@ var Infowindow = View.extend({ this._loadCover(); } + if (this._containsVideo()) { + this._loadVideo(); + } + this._setupClasses(); this._renderScroll(); this._renderShadows(); @@ -123,6 +127,36 @@ var Infowindow = View.extend({ return this; }, +// video add + + _containsVideo: function () { + return !!this.$('.js-infowindow').attr('data-video'); + }, + + _loadVideo: function () { + this._renderCoverLoader(); + this._startCoverLoader(); + + var url = this._getCoverURL(); + + if (this._isLoadingFields()) { + return; + } + + if (!this._isValidURL(url)) { + this._stopCoverLoader(); + this._showInfowindowImageError(); + return; + } + + if (this._containsTemplateCover()) { + this._loadCoverFromTemplate(url); + } else { + this._loadCoverFromUrl(url); + } + }, +// end video + _initBinds: function () { _.bindAll(this, '_onKeyUp', '_onLoadImageSuccess', '_onLoadImageError');