更新 infowindow-view.js

This commit is contained in:
钟进 2020-07-06 05:13:43 +00:00
parent 9d6a6fab1a
commit b6ea2ff298

View File

@ -154,29 +154,29 @@ var Infowindow = View.extend({
//this._startCoverLoader(); //this._startCoverLoader();
var url = this._getCoverURL(); var url = this._getCoverURL();
var $urlsrc = this.$('#target');
$urlsrc.attr('src', url);
/* // var $urlsrc = this.$('#target');
if (this._isLoadingFields()) { // $urlsrc.attr('src', url);
return;
}
if (!this._isValidVideoURL(url)) { if(Hls.isSupported()) {
this._stopCoverLoader(); var video = document.getElementById('hls-video');
this._showInfowindowVideoError(); var hls = new Hls({
return; debug: true
});
hls.loadSource(url);
hls.attachMedia(video);
hls.on(Hls.Events.MEDIA_ATTACHED, function() {
video.muted = true;
video.play();
});
}
else if (video.canPlayType('application/vnd.apple.mpegurl')) {
video.src = url;
video.addEventListener('canplay',function() {
video.play();
});
} }
if (this._containsTemplateCover()) {
this._loadCoverFromTemplate(url);
} else {
this._loadVideoFromUrl(url);
}
*/
var $urlsrc = this.$('#target');
$urlsrc.attr('src', url);
}, },
_isValidVideoURL: function (url) { _isValidVideoURL: function (url) {