Pārlūkot izejas kodu

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

undefined
J 5 gadus atpakaļ
vecāks
revīzija
a53c63743e
1 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 6
    2
      vue-theme/src/components/content-block/block.vue

+ 6
- 2
vue-theme/src/components/content-block/block.vue Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt