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

bugfix - 228 - add setReleaseMode method for manage player state #269

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

himanshuGandhiSimform
Copy link
Collaborator

BugFix - 228 - Add setRelease Mode as per the requirement

@himanshuGandhiSimform himanshuGandhiSimform linked an issue Feb 20, 2024 that may be closed by this pull request
Copy link
Collaborator

@ujas-m-simformsolutions ujas-m-simformsolutions left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some files look unformatted in native android and ios. Please format those

/// This enum is meant to be used as a parameter of setReleaseMode method.
///
/// It represents the behavior of AudioPlayer when an audio is finished or stopped.
enum ReleaseMode{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not change the name of the enum because then it will be a bigger breaking change

fun setReleaseMode(result: MethodChannel.Result, releaseModeType : Int?){
try{
releaseModeType?.let {
when (releaseModeType) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks much better than previous

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

///Release all resources, just like calling release method.
///
/// In Android, the media player is quite resource-intensive, and this will
/// let it go. Data will be buffered again when needed (if it's a remote file,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't support remote files so remove it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or even better can replace this whole docs with ours

///Set the release Mode.
///
/// Check[FinishMode]'s doc to understand the difference between the modes.
Future<void> setReleaseMode(FinishMode finishMode)async{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make named parameter with default value and format

hemantbeast added a commit to hemantbeast/audio_waveforms that referenced this pull request May 28, 2024
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.

Add setReleaseMode
2 participants