Skip to content

Commit 236a991

Browse files
author
PtiBouchon
committed
Fix a bug with volume
1 parent 867ff0e commit 236a991

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jukebox_axum/src/music_player.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub fn music_player(mut rx: UnboundedReceiver<MusicPlayerMessage>, app_state: Ar
4141
if let Some(msg) = msg1_opt {
4242
match msg {
4343
MusicPlayerMessage::SetVolume(volume) => {
44-
pipeline.set_property("volume", volume);
44+
pipeline.set_property("volume", (volume / 100.0).clamp(0.0, 1.0));
4545
}
4646
MusicPlayerMessage::AddMusic(video) => {
4747
if let Ok(video_data) = my_youtube_extractor::get_best_audio(&video.id).await {

0 commit comments

Comments
 (0)