1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-06-24 21:25:23 +00:00

Receivers: Fixed protocol v3 volume field in play message

This commit is contained in:
Michael Hollister 2025-06-11 18:46:15 -05:00
parent 1bc8e15406
commit 920bde9179
2 changed files with 2 additions and 2 deletions

View file

@ -71,7 +71,7 @@ function onPlayerLoad(value: PlayMessage) {
player.setPlaybackRate(value.speed); player.setPlaybackRate(value.speed);
playerCtrlStateUpdate(PlayerControlEvent.SetPlaybackRate); playerCtrlStateUpdate(PlayerControlEvent.SetPlaybackRate);
} }
if (value.volume) { if (value.volume !== null && value.volume >= 0) {
volumeChangeHandler(value.volume); volumeChangeHandler(value.volume);
} }
else { else {

View file

@ -165,7 +165,7 @@ export class Main {
// Protocol v2 FCast PlayMessage does not contain volume field and could result in the receiver // Protocol v2 FCast PlayMessage does not contain volume field and could result in the receiver
// getting out-of-sync with the sender when player windows are closed and re-opened. Volume // getting out-of-sync with the sender when player windows are closed and re-opened. Volume
// is cached in the play message when volume is not set in v3 PlayMessage. // is cached in the play message when volume is not set in v3 PlayMessage.
message.volume = message.volume || message.volume === undefined ? Main.cache.playerVolume : message.volume; message.volume = message.volume === undefined ? Main.cache.playerVolume : message.volume;
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
let rendererMessage: any = await NetworkService.proxyPlayIfRequired(message); let rendererMessage: any = await NetworkService.proxyPlayIfRequired(message);