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
OnMute Functionality Added #700
base: master
Are you sure you want to change the base?
Conversation
@sunilguptasg There is already mute and isMuted. I am not sure why was the change required. |
Sorry, the title was incorrect. This is the "OnMuted" functionality. which is needed for my use case. |
function handleMute() { | ||
setInterval(() => { | ||
if (muted != player.isMuted()) { | ||
sendMessage('MuteButtonPressed', player.isMuted()); | ||
muted = player.isMuted(); | ||
} | ||
}, 500); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the controller already provides access to isMuted
, you can do the same thing already on Flutter side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, the isMuted is also buggy, since you need to check if isMuted is string true or false, you are checking with '1'. Also rather than timer in flutter, we have added same logic in javascript.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then i guess it'll be better to fix isMuted
. Any specific reason to have the timer in js side ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If is isMuted is fixed, we can do the same in flutter, but it would be better to have the functionality in js, such that any change, calls from js to dart once, rather than dart calling to js every time. Also it would be better functionality.
Added the functionality to programmatically mute audio. Needed for a project where the player on a student's device is controlled by the teacher. The audio mute was missing.
All "deletions" are only line reformatting - nothing has been deleted.