Skip to content

Commit

Permalink
Merge branch 'padms/1834' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
padms committed Nov 20, 2023
2 parents 1036e36 + f8c7f32 commit 8ae2d50
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions sanityv3/schemas/objects/videoFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export default {
name: 'thumbnail',
type: 'imageWithAlt',
title: 'Thumbnail',
description:
'Enter alt text for purely visual video content here. This description assists screen reader users when the video is consistently muted.',
initialValue: {
isDecorative: true,
},
Expand Down
9 changes: 8 additions & 1 deletion web/components/src/HLSPlayer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import useVideoAnalytics from '../../../lib/hooks/useVideoAnalytics'
type HLSProps = Omit<HTMLProps<HTMLVideoElement>, 'src'> & {
src: string
playButton?: boolean
videoDescription?: string
}

const Wrapper = styled.div<{ $showSpinner: boolean }>`
Expand Down Expand Up @@ -70,6 +71,8 @@ export const HLSPlayer: React.FC<HLSProps> = ({
controls = false,
playButton = false,
autoPlay = false,
muted = false,
videoDescription,
...props
}) => {
const videoRef = useRef<HTMLVideoElement>(null)
Expand Down Expand Up @@ -134,7 +137,11 @@ export const HLSPlayer: React.FC<HLSProps> = ({
}, [playButton])

return (
<Wrapper $showSpinner={showSpinner}>
<Wrapper
$showSpinner={showSpinner}
role={muted ? 'img' : undefined}
aria-label={muted ? videoDescription : undefined}
>
<video
playsInline
ref={videoRef}
Expand Down
10 changes: 9 additions & 1 deletion web/pageComponents/shared/Hero/LoopingVideo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ export const LoopingVideo = ({ video }: { video: LoopingVideoData }) => {
return (
<Container $aspectRatio={ratio}>
<StyledFigure>
<StyledHLSPlayer loop muted autoPlay title={title} poster={thumbnailURL.src} src={url} />
<StyledHLSPlayer
loop
muted
autoPlay
title={title}
poster={thumbnailURL.src}
src={url}
videoDescription={thumbnail.alt}
/>
</StyledFigure>
</Container>
)
Expand Down

0 comments on commit 8ae2d50

Please sign in to comment.