mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
embed youtube videos on feed
This commit is contained in:
parent
48dd1a28f8
commit
f2db0309ac
@ -48,6 +48,14 @@ var sanitize = function(content, base) {
|
|||||||
return sanitizer.sanitize(content, {FORBID_TAGS: ['style'], FORBID_ATTR: ['style', 'class']})
|
return sanitizer.sanitize(content, {FORBID_TAGS: ['style'], FORBID_ATTR: ['style', 'class']})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function extensions(details, content) {
|
||||||
|
const ytId = details.link.match(/youtube\.com\/watch\?v=(.*)$/)[1];
|
||||||
|
if(ytId) {
|
||||||
|
content+=`<iframe width="560" height="315" src="https://www.youtube.com/embed/${ytId}" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope" allowfullscreen></iframe>`;
|
||||||
|
}
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
Vue.use(VueLazyload)
|
Vue.use(VueLazyload)
|
||||||
|
|
||||||
Vue.directive('scroll', {
|
Vue.directive('scroll', {
|
||||||
@ -214,7 +222,7 @@ var vm = new Vue({
|
|||||||
else if (this.itemSelectedDetails.description)
|
else if (this.itemSelectedDetails.description)
|
||||||
content = this.itemSelectedDetails.description
|
content = this.itemSelectedDetails.description
|
||||||
|
|
||||||
return sanitize(content, this.itemSelectedDetails.link)
|
return extensions(this.itemSelectedDetails,sanitize(content, this.itemSelectedDetails.link))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user