Fix audio and video issues

This commit is contained in:
Daniele Pancottini 2023-07-07 17:23:23 +02:00
parent 7a6c877b64
commit 7db0871c8d
2 changed files with 31 additions and 36 deletions

View File

@ -1,35 +1,29 @@
import { Box, Stack, Image, Text } from "@chakra-ui/react";
import { Box, Stack, Image, Text } from '@chakra-ui/react'
export default function VideoCardContent(props: {
style: any
resourcePath: string
resourceCaption: string
}) {
style: any
resourcePath: string
resourceCaption: string
}) {
return (
<>
<Box className={props.style.imageContainer} w={'full'} height={'220px'}>
<video
style={{ width: 'inherit', height: 'inherit' }}
controls
playsInline
>
<source src={props.resourcePath} type="video/mp4" />
</video>
</Box>
return (
<>
<Box
className={props.style.imageContainer}
w={'full'}
height={'220px'}
>
<video controls >
<source src={props.resourcePath} type="video/mp4"/>
</video>
</Box>
<Box
p={5}
className={props.style.captionContainer}>
<Stack mt={6} align={'center'}>
<Text padding={0} color={'gray.500'} fontSize={'sm'} align={'center'}>
{props.resourceCaption}
</Text>
</Stack>
</Box>
</>
)
};
<Box p={5} className={props.style.captionContainer}>
<Stack mt={6} align={'center'}>
<Text padding={0} color={'gray.500'} fontSize={'sm'} align={'center'}>
{props.resourceCaption}
</Text>
</Stack>
</Box>
</>
)
}

View File

@ -239,9 +239,10 @@ export default function RoomPage({
startNodeId: startNode,
markerStyle: {
style: {
color: decadesManifest[decade as keyof typeof decadesManifest].color
}
}
color:
decadesManifest[decade as keyof typeof decadesManifest].color,
},
},
},
],
],
@ -319,7 +320,7 @@ export default function RoomPage({
setTimeout(() => {
audioPlayer?.pause()
setIsAudioInBackground(false)
}, audioPlayer!.duration - audioPlayer!.currentTime)
}, (audioPlayer!.duration - audioPlayer!.currentTime) * 1000)
}
}, [isAudioInBackground])