Skip to content

Commit

Permalink
recreating work in monorepo (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephiescastle authored Dec 3, 2024
1 parent 039afc4 commit 232c7b4
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/spotty-rockets-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@explorer-1/vue": patch
---

Adding option to autoplay/loop video.
2 changes: 1 addition & 1 deletion packages/vue/src/components/BaseVideo/BaseVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
:muted="autoplay"
:playsinline="autoplay"
:autoplay="autoplay"
:controls="!autoplay"
controls
>
<template v-if="data.fileWebm">
<source
Expand Down
3 changes: 2 additions & 1 deletion packages/vue/src/components/BlockVideo/BlockVideo.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export const BlockVideoData = {
blockType: 'VideoBlock',
video: BaseVideoData,
caption: 'Lorem ipsum dolor sit amet consectatur',
credit: 'Credit'
credit: 'Credit',
autoplay: false
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/components/BlockVideo/BlockVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
>
<BaseVideo
:data="data.video"
:autoplay="autoplay"
:autoplay="data.autoplay"
/>

<div
Expand Down
8 changes: 4 additions & 4 deletions packages/vue/src/components/HeroMedia/HeroMedia.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ export default defineComponent({
// image object includes the image caption and credit
image: {
type: Object,
required: false
default: undefined
},
video: {
type: Object,
required: false
default: undefined
},
// if a caption should even be visible
displayCaption: {
Expand All @@ -92,11 +92,11 @@ export default defineComponent({
// for video heroes that pass separate caption and credit data
caption: {
type: String,
required: false
default: undefined
},
credit: {
type: String,
required: false
default: undefined
}
},
data() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import MixinVideoBg from './MixinVideoBg.vue'
export default {
title: 'Mixins/MixinVideoBg',
component: MixinVideoBg,
excludeStories: /.*Data$/
excludeStories: /.*Data$/,
parameters: {
docs: {
description: {
component: 'This mix-in will always autoplay and loop a video.'
}
}
}
}

export const BaseStory = {
Expand Down
7 changes: 6 additions & 1 deletion packages/vue/src/components/MixinVideoBg/MixinVideoBg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
muted
playsinline
autoplay
controls
preload="auto"
class="object-cover w-full h-full"
>
Expand Down Expand Up @@ -32,7 +33,11 @@ export default defineComponent({
props: {
video: {
type: Object,
required: false
default: undefined
},
autoplay: {
type: Boolean,
default: false
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
class="md:mb-12 lg:mb-18 mb-10"
:image="data.hero[0].image"
:video="data.hero[0].video"
:autoplay="data.hero[0].autoplay"
:display-caption="data.hero[0].displayCaption"
:caption="data.hero[0].caption"
:credit="data.hero[0].credit"
Expand Down

0 comments on commit 232c7b4

Please sign in to comment.