Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/1672 Video Block autoplay option #707

Merged
merged 3 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading