|
@@ -3,8 +3,6 @@
|
|
import { mapActions, mapState } from 'pinia'
|
|
import { mapActions, mapState } from 'pinia'
|
|
import { StaticsStore } from '@/stores/statics'
|
|
import { StaticsStore } from '@/stores/statics'
|
|
|
|
|
|
-const videoEmbed = require("video-embed");
|
|
|
|
-
|
|
|
|
export default {
|
|
export default {
|
|
props: ['id'],
|
|
props: ['id'],
|
|
// data(){
|
|
// data(){
|
|
@@ -29,7 +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 = 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);
|
|
console.log('iframe', iframe);
|
|
text = text.replace(link[0], iframe);
|
|
text = text.replace(link[0], iframe);
|
|
};
|
|
};
|