The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/oembed/client/baseWidget.js

27 lines
812 B

import { Template } from 'meteor/templating';
Template.oembedBaseWidget.helpers({
template() {
let contentType;
if (this.headers) {
contentType = this.headers.contentType;
}
if (this._overrideTemplate) {
return this._overrideTemplate;
}
if (this.headers && contentType && contentType.match(/image\/.*/)) {
return 'oembedImageWidget';
}
if (this.headers && contentType && contentType.match(/audio\/.*/)) {
return 'oembedAudioWidget';
}
if ((this.headers && contentType && contentType.match(/video\/.*/)) || (this.meta && this.meta.twitterPlayerStreamContentType && this.meta.twitterPlayerStreamContentType.match(/video\/.*/))) {
return 'oembedVideoWidget';
}
if (this.meta && this.meta.oembedHtml) {
return 'oembedFrameWidget';
}
return 'oembedUrlWidget';
},
});