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/oembedVideoWidget.js

38 lines
922 B

import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { getUserPreference } from '../../utils';
const getTitle = function(self) {
if (self.meta == null) {
return;
}
return self.meta.ogTitle || self.meta.twitterTitle || self.meta.title || self.meta.pageTitle;
};
Template.oembedVideoWidget.helpers({
url() {
if (this.meta && this.meta.twitterPlayerStream) {
return this.meta.twitterPlayerStream;
} if (this.url) {
return this.url;
}
},
contentType() {
if (this.meta && this.meta.twitterPlayerStreamContentType) {
return this.meta.twitterPlayerStreamContentType;
} if (this.headers && this.headers.contentType) {
return this.headers.contentType;
}
},
title() {
return getTitle(this);
},
collapsed() {
if (this.collapsed) {
return this.collapsed;
}
return getUserPreference(Meteor.userId(), 'collapseMediaByDefault') === true;
},
});