diff --git a/src/geo/ui/infowindow-view.js b/src/geo/ui/infowindow-view.js index e05c558..d381e66 100644 --- a/src/geo/ui/infowindow-view.js +++ b/src/geo/ui/infowindow-view.js @@ -114,6 +114,12 @@ var Infowindow = View.extend({ this._loadCover(); } + if (this._containsVideo()) { + this._loadVideo(); + } + + + this._setupClasses(); this._renderScroll(); this._renderShadows(); @@ -165,6 +171,8 @@ var Infowindow = View.extend({ var hasContent = this._getContent().length; var hasTitle = this.$('.CDB-infowindow-title').length; var numberOfFields = this.model.get('content') && this.model.get('content').fields.length; + var hasH5url = this.$('.js-h5url').length; + if (hasCover) { $infowindow @@ -295,6 +303,12 @@ var Infowindow = View.extend({ _containsCover: function () { return !!this.$('.js-infowindow').attr('data-cover'); }, + + //检测视频 + _containsVideo: function () { + return !!this.$('.js-infowindow').attr('data-video'); + }, + _containsTemplateCover: function () { return this.$('.js-cover img').length > 0; @@ -365,6 +379,21 @@ var Infowindow = View.extend({ this.$('.js-cover img').remove(); this._loadCoverFromUrl(url); }, + + + _loadVideoFromUrl: function (url) { + var $cover = this.$('.js-cover'); + + this._startCoverLoader(); + + var $img = $("