lundi 17 mai 2021

TypeError: Failed to set the 'currentTime' property on 'HTMLMediaElement': The provided double value is non-finite

Hi now i am having new problem plz help me to solve this problem.....

** handleChange C:/Users/Dell/Desktop/TECH ELECTRIC/tech-electric-website/src/Components/Music/Music-Components/player/TimelineController.js:86 **

85 | const handleChange = (event, newValue) => {

86 | player.currentTime = newValue;

87| setCurrentTime(newValue);

88 | };

const handleChange = (event, newValue) => {
    player.currentTime = newValue;
    setCurrentTime(newValue);
  };

  const showDuration = () => {
    if (player) {
      if (player.duration) {
        return formatTime(player.duration);
      } else {
        return '0:00';
      }
    } else {
      return 0;
    }
  };

  // condition rendering
  if (minimized) {
    return (
      <MiniSlider value={currentTime} max={player ? player.duration : 0} />
    );
  } else {
    return (
      <div style=>
        <Grid container direction="row" justify="space-between">
          <Typography variant="body1" color="primary">
            {formatTime(currentTime)}
          </Typography>
          <Typography variant="body1" color="primary">
            {showDuration()}
          </Typography>
        </Grid>

        <PrettoSlider
          value={currentTime}
          onChange={handleChange}
          max={player ? player.duration : 0}
        />
      </div>
    );
  } ```



Aucun commentaire:

Enregistrer un commentaire