Procházet zdrojové kódy

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

undefined
J před 5 roky
rodič
revize
a53c63743e

+ 6
- 2
vue-theme/src/components/content-block/block.vue Zobrazit soubor

@@ -30,8 +30,12 @@ export default {
30 30
     },
31 31
     methods: {
32 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 39
             return `https://www.youtube.com/embed/${videoUid}`
36 40
         }
37 41
     },

Načítá se…
Zrušit
Uložit