Quellcode durchsuchen

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

undefined
J vor 5 Jahren
Ursprung
Commit
a53c63743e
1 geänderte Dateien mit 6 neuen und 2 gelöschten Zeilen
  1. 6
    2
      vue-theme/src/components/content-block/block.vue

+ 6
- 2
vue-theme/src/components/content-block/block.vue Datei anzeigen

@@ -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
     },

Laden…
Abbrechen
Speichern