From 72663aac2d20b5dd77a384f28e4d68ab09ec7f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9F=E8=BF=9B?= Date: Sat, 13 Jun 2020 13:36:44 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20infowindow-view.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/geo/ui/infowindow-view.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) 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');