-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow duration of song to be specified #90
Comments
Hey @lijinke666 no pressure, but do you have any idea when you'll be able to take a look at this? Thanks very much for your hard work! |
hi ~ @deluan the work is busy recently, sorry I didn't reply to you in time |
Sorry for taking so long to reply. My idea was to simply add a new optional property to AudioListProp with the duration (float, in seconds) of the audio file: interface ReactJkMusicPlayerAudioListProps {
name: string | React.ReactNode,
singer?: string | React.ReactNode,
cover: string,
musicSrc: string | () => Promise<string>,
lyric?: string,
duration?: number, // <--- new field
[key: string]: any
}> Then when adding a song to the audioList, I could specify the duration of the song, like I hope I was able to explain it clearly to you. Let me know what do you think. |
@deluan Oh. i understand you mean, so your need a static field |
Yes something like that, but this Would love to contribute this in a PR, but not sure if I will have time to work on that before you |
Awesome, thanks! Will try this weekend! |
Description
I'm using your player in my Music Server (https://github.com/deluan/navidrome), and it is working perfectly, thanks!
One thing that could be improved is: My server does transcoding on-the-fly (convert files from one format/bitrate to another), and when this happens, the player cannot get the proper duration, as the response from the server does not contain any Content-Length header.
Currently the player shows
00:0NaN
and the progress bar does not work in these cases.It would be awesome to be able to set the duration time in these cases (instead of getting it from the audio instance), so we would still see the proper duration and the progress bar would work properly.
The text was updated successfully, but these errors were encountered: