at video embed
This commit is contained in:
parent
306b0042b3
commit
5a17a47514
3 changed files with 42 additions and 0 deletions
1
src/components.d.ts
vendored
1
src/components.d.ts
vendored
|
|
@ -25,6 +25,7 @@ declare module 'vue' {
|
||||||
StrapiContent: typeof import('./components/strapi/Content.vue')['default']
|
StrapiContent: typeof import('./components/strapi/Content.vue')['default']
|
||||||
StrapiCopy: typeof import('./components/strapi/Copy.vue')['default']
|
StrapiCopy: typeof import('./components/strapi/Copy.vue')['default']
|
||||||
StrapiDiptych: typeof import('./components/strapi/Diptych.vue')['default']
|
StrapiDiptych: typeof import('./components/strapi/Diptych.vue')['default']
|
||||||
|
StrapiEmbeddedVideo: typeof import('./components/strapi/EmbeddedVideo.vue')['default']
|
||||||
StrapiLink: typeof import('./components/strapi/Link.vue')['default']
|
StrapiLink: typeof import('./components/strapi/Link.vue')['default']
|
||||||
StrapiMap: typeof import('./components/strapi/Map.vue')['default']
|
StrapiMap: typeof import('./components/strapi/Map.vue')['default']
|
||||||
StrapiMedia: typeof import('./components/strapi/Media.vue')['default']
|
StrapiMedia: typeof import('./components/strapi/Media.vue')['default']
|
||||||
|
|
|
||||||
37
src/components/strapi/EmbeddedVideo.vue
Normal file
37
src/components/strapi/EmbeddedVideo.vue
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
<template>
|
||||||
|
<section v-if="video" class="strapi-embedded-video">
|
||||||
|
<div class="wrapper" v-html="video.oembed.html" />
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
video: Object,
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.strapi-embedded-video {
|
||||||
|
.wrapper {
|
||||||
|
width: 100%;
|
||||||
|
aspect-ratio: 16 / 9;
|
||||||
|
position: relative;
|
||||||
|
border-radius: desktop-vw(4px);
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
iframe {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@include mobile() {
|
||||||
|
.wrapper {
|
||||||
|
border-radius: mobile-vw(8px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -13,12 +13,14 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import Copy from './Copy.vue'
|
import Copy from './Copy.vue'
|
||||||
import Diptych from './Diptych.vue'
|
import Diptych from './Diptych.vue'
|
||||||
|
import EmbeddedVideo from './EmbeddedVideo.vue'
|
||||||
import Media from './Media.vue'
|
import Media from './Media.vue'
|
||||||
|
|
||||||
const MAP = {
|
const MAP = {
|
||||||
'global.copy': Copy,
|
'global.copy': Copy,
|
||||||
'global.media': Media,
|
'global.media': Media,
|
||||||
'global.dipytch': Diptych,
|
'global.dipytch': Diptych,
|
||||||
|
'global.embedded-video': EmbeddedVideo,
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -26,6 +28,8 @@ const props = defineProps({
|
||||||
mediaDS: String,
|
mediaDS: String,
|
||||||
mediaMS: String,
|
mediaMS: String,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log(props.items)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue