fix iframe embed urls

This commit is contained in:
Bachir Soussi Chiadmi 2023-07-06 15:25:23 +02:00
parent 50f7375eed
commit 15c6e2e0d2

View File

@ -27,13 +27,15 @@ export default {
// console.log('videolinks', videolinks); // console.log('videolinks', videolinks);
for (let link of videolinks){ for (let link of videolinks){
console.log('videolink', link); console.log('videolink', link);
let iframe; let url, iframe;
switch (link[1]) { switch (link[1]) {
case 'vimeo.com': case 'vimeo.com':
iframe = `<iframe src="${link[0]}" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>` url = `https://player.vimeo.com/video/${link[3]}`;
iframe = `<iframe src="${url}" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>`
break; break;
case 'www.youtube.com': case 'www.youtube.com':
iframe = `<iframe src="${link[0]}" frameborder="0" allowfullscreen></iframe>` url = `https://www.youtube.com/embed/${link[3]}`;
iframe = `<iframe src="${url}" frameborder="0" allowfullscreen></iframe>`
break; break;
} }
console.log('iframe', iframe); console.log('iframe', iframe);