Skip to content
Snippets Groups Projects
Commit 2493d80b authored by Antoine Roy's avatar Antoine Roy
Browse files

Récupération du temps de la vidéo

parent 97aa926c
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 #1773 failed
......@@ -496,8 +496,8 @@ function AnnotationCreation(props) {
valueTime[0] = tstart;
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 (
<CompanionWindow
title={title ? title.value : 'New Annotation'}
......@@ -552,17 +552,16 @@ function AnnotationCreation(props) {
<Typography id="range-slider" variant="overline">
Display period
</Typography>
{isVideoDataLoaded ? (
<div>
<Typography>
{state.mediaVideo.video.duration}
{videoDuration}
</Typography>
<Slider
value={valueTime}
onChange={handleChangeTime}
valueLabelDisplay="auto"
aria-labelledby="range-slider"
max={Math.round(state.mediaVideo.video.duration)}
max={Math.round(videoDuration)}
color="secondary"
windowid={windowId}
sx={{
......@@ -570,10 +569,6 @@ function AnnotationCreation(props) {
}}
/>
</div>
) : (
<Typography>Loading video data...</Typography>
)}
</Grid>
<div style={{
alignContent: 'center',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment