Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sunilguptasg
Copy link

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.

@sarbagyastha
Copy link
Owner

sarbagyastha commented Sep 15, 2022

@sunilguptasg There is already mute and isMuted. I am not sure why was the change required.

@sunilguptasg sunilguptasg changed the title Mute Functionality Added OnMute Functionality Added Sep 16, 2022
@sunilguptasg
Copy link
Author

Sorry, the title was incorrect. This is the "OnMuted" functionality. which is needed for my use case.

Comment on lines +153 to +160
function handleMute() {
setInterval(() => {
if (muted != player.isMuted()) {
sendMessage('MuteButtonPressed', player.isMuted());
muted = player.isMuted();
}
}, 500);
}
Copy link
Owner

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.

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.

Copy link
Owner

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 ?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants