Fix/BOOK-240 video fixes

* fix(BOOK-240): Added support for multiple sources and fixed issue with play/pause on mobile

* fix(BOOK-240): Pausing hero video when scrolling out of view


Approved-by: Christel Westerberg
This commit is contained in:
Erik Tiekstra
2025-12-16 09:09:17 +00:00
parent 713ca6562e
commit bf7a2ac2fe
10 changed files with 121 additions and 118 deletions

View File

@@ -4,7 +4,7 @@ import { VideoWithCard } from '.'
import { config } from './variants'
const meta: Meta<typeof VideoWithCard> = {
title: 'Core Components/🚧 Video 🚧/VideoWithCard',
title: 'Core Components/Video/VideoWithCard',
component: VideoWithCard,
parameters: {
docs: {
@@ -80,7 +80,7 @@ const meta: Meta<typeof VideoWithCard> = {
table: {
type: {
summary:
'{ src: string; captions?: Caption[]; focalPoint?: FocalPoint}',
'{ sources: { src: string; type: string }[]; captions?: Caption[]; focalPoint?: FocalPoint}',
},
},
description:
@@ -94,7 +94,16 @@ export default meta
type Story = StoryObj<typeof VideoWithCard>
const videoProps = {
src: 'https://eu-assets.contentstack.com/v3/assets/bltfd73aa2de3a5c4e3/bltad0fe3c2ce340947/68eced6c14e5a8150ebba18c/Scandic_EB_Master.mp4',
sources: [
{
src: 'https://eu-assets.contentstack.com/v3/assets/bltfd73aa2de3a5c4e3/bltc3aa53ac9bf6798c/693ad4b65b0889d6348893f3/Test_video.mp4',
type: 'video/mp4',
},
{
src: 'https://eu-assets.contentstack.com/v3/assets/bltfd73aa2de3a5c4e3/blt029be07ddd444eea/693c251c09e17b33c93c1dd6/hero-banner-1920-vp9.webm',
type: 'video/webm',
},
],
}
const quoteCardProps = {