Merge branch 'video_elements_in_queets' into 'master'
in-notice video elements with local thumbs as posters This is the best I could do with my knowledge of javascript and how everything is designed. What I'm curious about is however that I thought we already had HTML generation for video elements in Qvitter? That's where I copied the inArray if-statement from anyway... See merge request !18
This commit is contained in:
commit
2dbcda40b1
|
@ -2354,7 +2354,8 @@ function buildAttachmentHTML(attachments){
|
|||
// if there's a local thumb_url we assume this is a image or video
|
||||
else if(typeof this.thumb_url != 'undefined'
|
||||
&& this.thumb_url !== null
|
||||
&& isLocalURL(this.thumb_url)) {
|
||||
&& isLocalURL(this.thumb_url)
|
||||
&& !($.inArray(this.mimetype, ['video/mp4', 'video/ogg', 'video/quicktime', 'video/webm']) >=0)) {
|
||||
var bigThumbW = 1000;
|
||||
var bigThumbH = 3000;
|
||||
if(bigThumbW > window.siteMaxThumbnailSize) {
|
||||
|
@ -2422,6 +2423,15 @@ function buildAttachmentHTML(attachments){
|
|||
urlsToHide.push(urlToHide); // hide this attachment url from the queet text
|
||||
attachmentNum++;
|
||||
}
|
||||
else if ($.inArray(this.mimetype, ['video/mp4', 'video/ogg', 'video/quicktime', 'video/webm']) >=0) {
|
||||
var posterAttribute = '';
|
||||
if(typeof this.thumb_url != 'undefined'
|
||||
&& this.thumb_url !== null
|
||||
&& isLocalURL(this.thumb_url)) {
|
||||
posterAttribute = 'poster="' + this.thumb_url + '"';
|
||||
}
|
||||
attachmentHTML += '<div class="media"><video class="attachment-video" controls data-width="' + this.width + '" data-height="' + this.height + '" ' + posterAttribute + '><source src="' + this.url + '" type="' + this.mimetype + '" /></video></div>';
|
||||
}
|
||||
});
|
||||
}
|
||||
return { html: '<div class="oembed-data oembed-num-' + oembedNum + '">' + oembedHTML + '</div><div class="queet-thumbs thumb-num-' + attachmentNum + '">' + attachmentHTML + '</div>',
|
||||
|
|
Loading…
Reference in New Issue
Block a user