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

[Feature Request] Ability to change OS shade's play/pause/stopped state at any time #14

Closed
japhiaolson opened this issue Jun 29, 2020 · 6 comments
Labels
awaiting info Further information is requested from the customer. enhancement New feature or request

Comments

@japhiaolson
Copy link

Is your feature request related to a problem? Please describe.
My use case as an example is playing a playlist, with each "track" consisting of several files with blank space between each file and the user can pause the "playlist" at any point (when the files are actively playing or when the files have naturally stopped and they are in the blank/delay between sound files playing).
The shade can't accurately show that the user paused the playlist unless the user happened to hit pause in the midst of an actual sound playing. Everything seems to work really well as far as functionality of the player/events propagating from the shade/etc. it's just the visual state of the shade needs to be able to be updated to accurately show what the user would expect in a scenario like this.

Describe the solution you'd like
Ability to change state of play/pause/stopped OS shade's UI separately from the actual state of sound files.

Describe alternatives you've considered
The only alternative I've found is triggering a small/blank sound to play if no sound is playing when they hit pause, so it triggers "play" and then immediately triggers "pause" which makes the shade show the correct state.

@japhiaolson japhiaolson added the enhancement New feature or request label Jun 29, 2020
@bsutton
Copy link
Owner

bsutton commented Jun 30, 2020

I'm not quite certain I understand the problem.

As I understand it:
You have a single Track
The Track's audio file has audio that contains some sections which are silent.
If the user hits pause whilst the player is playing from a 'silent' section then the shade doesn't show that the audio is paused.

So this fact that the shade doesn't show the pause state does make sense to me as I would expect the shade to even notice that its playing silence (whilst it could detect it I wouldn't expect it to).

Can you send a small sample app so I can try and reproduce it.

I'm slightly hesitant to suggest this as its largely untested, but the Album is designed to allow you to schedule multiple Tracks on a shade. It might be worth giving it a try.

Perhaps an explanation on what you are trying to achieve might help.

@bsutton bsutton added the awaiting info Further information is requested from the customer. label Jun 30, 2020
@japhiaolson
Copy link
Author

japhiaolson commented Jul 1, 2020

Yeah, sorry, I know this is a bit tough to explain - hopefully the below clarifies, and I've attached a screen recording of this feature as well (although it's a little confusing since sometimes I pause right at the tail end of the audio before the audio has actually ended but is silent for 500ms or so before the audio is actually stopped and the blank space hits).
example_feature.zip

The use case goes like so:

  1. There is a playlist of sounds

  2. There is a play/pause button

  3. User hits "play" and the playlist starts

  4. Each playlist item consists of 1 speech sound file then a variable delay of blank space (no sound playing) and then plays the 2nd speech file, another variable delay happens (no sound playing).

  5. once these 2 files are finished playing, the player progresses to the 2nd set of files, and this continues through the playlist (1 file, blank space, 2nd file, blank space -> next playlist item).

  6. If the user hits forward/back the player jumps from an entire playlist item (e.g., each "playlist item" contains 2 files so skipping always starts at sound file 1 and then plays through the 2 files).

  7. If the user hits "pause" in the dart UI then no matter if the are directly on a live playing sound or between the sounds in the "blank space" I have the UI state change to show that the playlist is paused. The only time the OS shade shows that the playlist is paused is if they happen to pause in the midst of one of the sound files playing.

This feature is specifically for language training (so file 1 would be a foreign language "Mi nombre es John", blank space for a user to come up with the translation, and then the translation comes up in English "My name is John").

I know it may not even be possible with the native media players and it might just be something that needs a weird "hacky" solution for (such as the playing of a blank file and pausing it). But figured it's worth bringing up in case there's an elegant solution.

@Larpoux
Copy link
Contributor

Larpoux commented Jul 1, 2020

Hi @japhiaolson

I am currently working on an App to learn Korean. I had exactly the same need than you.
For me it was important that the progress bar was accurate between two sentences, and that the Backward and Forward button was enabled on the lock screen. And also the pause button !!!

After many failed tries, I decided to play a blank file between two sentences so that Apple is happy (and when Apple is happy, I am happy too ;-) ).

In my own App, I wanted that the Track information of the previous sentences was displayed during the pause, but
I did not want any screen refresh so to avoid any flick on a possible Apple Watch.

In flutter_sound I added some API verbs for managing the lock screen between two playbacks, and it works fine.
Actually only on iOS, but of course I will have to implement that on Android later.

@bsutton
Copy link
Owner

bsutton commented Jul 2, 2020

So this is definitely an enhancement.
Happy to put this on the todo list but at this point I don't plan on doing any enhancements until the 1.0.0 release is out.
My priorities at the moment are:

  1. 1.0.0 released and stable
  2. get a release of sounds_codec out the door with support for a reasonable no. of codecs.

@japhiaolson
Copy link
Author

@Larpoux hey, yeah sounds like we've been having the same issues. I'll probably end up doing something similar for now with Sounds (I'm launching the app on Android first, iOS is not a priority atm).

@bsutton yeah that makes sense, thanks for looking into it, definitely understand if it's not a high priority for now.

@bsutton
Copy link
Owner

bsutton commented Aug 11, 2020

Closing as I don't see this being implemented as it's a niche use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting info Further information is requested from the customer. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants