[useAudio] state.duration is always 0 when preload audio in nextjs
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- next.js, react, typescript
- Área
- frontend
Línea de trabajo
Start with the linked CodeSandbox and trace the useAudio entry point used with preload: 'metadata' in Next.js. Reproduce the zero-duration state, then inspect when the audio duration event is registered relative to loading. Done means state.duration is populated in this scenario; no source file or test is named in the issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What is the current behavior?
Steps to reproduce it and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have extra dependencies other than react-use. Paste the link to your JSFiddle or CodeSandbox example below:
In nextjs, i used this hook useAudio with props preload: 'metadata', the strange thing is that the state.duration is always 0.
You can see details in the following sandbox.
https://codesandbox.io/p/devbox/react-use-audio-j7fwpm
What is the expected behavior?
make state.duration normal, it seems that the onDurationChange event is not trigger because the audio is loaded at early moment which the onDurationChange event is not added.
A little about versions:
- OS:
- Browser (vendor and version):
- React:
react-use:- Did this worked in the previous package version?
- Lenguaje dominante
- TypeScript
- Estrellas
- 44k
- Forks
- 3.3k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de streamich/react-use
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Add Generic Fn for useDebouncePosiblemente ocupada @itsmejay80 la tomó hace 192 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
-
useVideo.story.tsx - sampleVideo can not be loadedQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
-
useSlider: event callbacks are not updatedPosiblemente ocupada @erykpiast la tomó hace 1839 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Todos los issues de streamich/react-use
Issues similares
-
area: repo priority: P2 type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
appandflow/stim#4107 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 1-3 horas Aptitud para principiantes 60/100
lingdojo/kana-dojo#32859 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
code-quality refactoring
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
github/gh-aw-firewall#10364 ·
Los mantenedores suelen responder en 1 día
-
Merge the duplicate kaffir_corn record into sorghumPosiblemente ocupada @Crypto-Shroom la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Crypto-Shroom/Bird-Feed-Calculator#322 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
drizzle-team/drizzle-orm#6552 ·
Los mantenedores suelen responder en 2 días