removed video-embed dependency

This commit is contained in:
2023-07-06 15:18:59 +02:00
parent 52c0700d29
commit 50f7375eed
3 changed files with 9 additions and 15 deletions

View File

@@ -3,8 +3,6 @@
import { mapActions, mapState } from 'pinia'
import { StaticsStore } from '@/stores/statics'
const videoEmbed = require("video-embed");
export default {
props: ['id'],
// data(){
@@ -29,7 +27,15 @@ export default {
// console.log('videolinks', videolinks);
for (let link of videolinks){
console.log('videolink', link);
let iframe = videoEmbed(link[0])
let iframe;
switch (link[1]) {
case 'vimeo.com':
iframe = `<iframe src="${link[0]}" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>`
break;
case 'www.youtube.com':
iframe = `<iframe src="${link[0]}" frameborder="0" allowfullscreen></iframe>`
break;
}
console.log('iframe', iframe);
text = text.replace(link[0], iframe);
};