Skip to content
Snippets Groups Projects
Commit a3ee421e authored by Anthony's avatar Anthony
Browse files

Merge branch 'récupération_temps_video' into mui5-tetras-main-stable

parents 002544c3 d0afc0e7
No related branches found
No related tags found
2 merge requests!18Récupération du temps de la vidéo,!10Draft: MigratingAnnotationCreation to MUI5.
Pipeline #1784 failed
...@@ -496,8 +496,8 @@ function AnnotationCreation(props) { ...@@ -496,8 +496,8 @@ function AnnotationCreation(props) {
valueTime[0] = tstart; valueTime[0] = tstart;
valueTime[1] = tend; valueTime[1] = tend;
} }
const isVideoDataLoaded = mediaVideo && mediaVideo.video && !isNaN(mediaVideo.video.duration) && mediaVideo.video.duration > 0; const myVideo = VideosReferences.get(windowId)
const videoDuration = myVideo.props.canvas.__jsonld.duration
return ( return (
<CompanionWindow <CompanionWindow
title={title ? title.value : 'New Annotation'} title={title ? title.value : 'New Annotation'}
...@@ -551,17 +551,16 @@ function AnnotationCreation(props) { ...@@ -551,17 +551,16 @@ function AnnotationCreation(props) {
<Typography id="range-slider" variant="overline"> <Typography id="range-slider" variant="overline">
Display period Display period
</Typography> </Typography>
{isVideoDataLoaded ? (
<div> <div>
<Typography> <Typography>
{state.mediaVideo.video.duration} {videoDuration}
</Typography> </Typography>
<Slider <Slider
value={valueTime} value={valueTime}
onChange={handleChangeTime} onChange={handleChangeTime}
valueLabelDisplay="auto" valueLabelDisplay="auto"
aria-labelledby="range-slider" aria-labelledby="range-slider"
max={Math.round(state.mediaVideo.video.duration)} max={Math.round(videoDuration)}
color="secondary" color="secondary"
windowid={windowId} windowid={windowId}
sx={{ sx={{
...@@ -569,10 +568,6 @@ function AnnotationCreation(props) { ...@@ -569,10 +568,6 @@ function AnnotationCreation(props) {
}} }}
/> />
</div> </div>
) : (
<Typography>Loading video data...</Typography>
)}
</Grid> </Grid>
<div style={{ <div style={{
alignContent: 'center', alignContent: 'center',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment