File tree 2 files changed +26
-6
lines changed 2 files changed +26
-6
lines changed Original file line number Diff line number Diff line change
1
+ <script setup>
2
+ const props = defineProps ({
3
+ author: { type: String , required: true },
4
+ hostingWebsiteName: { type: String , required: true },
5
+ license: { type: String , required: true },
6
+ sourceUrl: { type: String , required: true },
7
+ title: { type: String , required: true }
8
+ })
9
+ </script >
10
+
11
+ <template >
12
+ <p class =" text-lg" >
13
+ "<a :href =" props.sourceUrl" target =" _blank" rel =" noreferrer"
14
+ >{{ props.title }}
15
+ <img src =" @/assets/externalLink.svg" alt =" External link" class =" inline" /></a
16
+ >" by {{ props.author }}, {{ props.license }}, via {{ props.hostingWebsiteName }}
17
+ </p >
18
+ </template >
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { ref } from 'vue'
3
3
import { useRoute } from ' vue-router'
4
4
import { getVideoById } from ' @/services/videos'
5
5
import VideoPlayer from ' @/components/VideoPlayer.vue'
6
+ import VideoAttribution from ' @/components/VideoAttribution.vue'
6
7
7
8
const route = useRoute ()
8
9
@@ -23,12 +24,13 @@ const video = await getVideoById(route.params.id)
23
24
@status-change =" onVideoPlayerStatusChange"
24
25
/>
25
26
<h1 class =" text-2xl font-bold" >{{ video.title }}</h1 >
26
- <p class =" text-lg" >
27
- "<a :href =" video.sourceUrl" target =" _blank" rel =" noreferrer"
28
- >{{ video.title }}
29
- <img src =" @/assets/externalLink.svg" alt =" External link" class =" inline" /></a
30
- >" by {{ video.author }}, {{ video.license }}, via {{ video.hostingWebsiteName }}
31
- </p >
27
+ <video-attribution
28
+ :author =" video.author"
29
+ :hosting-website-name =" video.hostingWebsiteName"
30
+ :license =" video.license"
31
+ :source-url =" video.sourceUrl"
32
+ :title =" video.title"
33
+ />
32
34
<span class =" text-base" >{{ videoPlayerStatus }}</span >
33
35
</div >
34
36
<div v-else class =" w-full" ><p >Video unavailable</p ></div >
You can’t perform that action at this time.
0 commit comments