Переглянути джерело

:recycle: accouting for youtube.com/watch? links

undefined
J 5 роки тому
джерело
коміт
a53c63743e
1 змінених файлів з 6 додано та 2 видалено
  1. 6
    2
      vue-theme/src/components/content-block/block.vue

+ 6
- 2
vue-theme/src/components/content-block/block.vue Переглянути файл

30
     },
30
     },
31
     methods: {
31
     methods: {
32
         fixYoutubeUrl(url) {
32
         fixYoutubeUrl(url) {
33
-            const videoUid = url.split('https://youtu.be/').filter(pieces => pieces.length > 0)[0]
34
-
33
+            let videoUid = url.split('https://youtu.be/').filter(pieces => pieces.length > 0)[0]
34
+            
35
+            if(!videoUid) {
36
+                videoUid = url.split('https://www.youtube.com/watch?v=').filter(pieces => pieces.length > 0)[0]
37
+            }
38
+            
35
             return `https://www.youtube.com/embed/${videoUid}`
39
             return `https://www.youtube.com/embed/${videoUid}`
36
         }
40
         }
37
     },
41
     },

Завантаження…
Відмінити
Зберегти