Closed bafplus closed 3 years ago
One approach might be for the plugin to hide the skip buttons if sequence
contains only one item. Would that work for you, or would you prefer an explicit option?
Im using the supplied example as boilerplate. Instead of having a playlist, i'm serving streamingurls instead of audiofiles. Playlist in the example is more a media-library in that regard. So basically "just" playing one item only, without a playlist. But i dont know how you're suggestion handles that "playlist" in regards to sequence.
Op di 27 jul. 2021 om 14:21 schreef ryanheise @.***>:
One approach might be for the plugin to hide the skip buttons if sequence contains only one item. Would that work for you, or would you prefer an explicit option?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ryanheise/just_audio/issues/459#issuecomment-887465818, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRCRWRA4XT5OWQDI7BWLTLTZ2QE7ANCNFSM5BCDTMRA .
I'm talking about the sequence
getter:
https://pub.dev/documentation/just_audio/latest/just_audio/AudioPlayer/sequence.html
The proposed logic would be to show the skip buttons if sequence.length > 1
. I take it in your app sequence.length == 1
, correct?
I think yes...but im a noob so i may be wrong. All i did was change the path to audiofile to a streamingurl, so basicly a endless audiofile. Yet i dont know how or if that affects the sequence since i still use the "playlist" as media library (without changing anything other then the source audiofile). Hope you understand my above answer :-)
You may pm me somehow if you want to take this out of the discussion here...
sequence
is the playlist of the player. The skip buttons move forwards and backwards through that sequence.
Try print(player.sequence.length);
to confirm if you are unsure whether it is 1
in your app. Assuming it is 1
in your app, is this solution acceptable?
In that case, no since i use the current sequence as library. Yet i do think it can work if i rework my code to set the library outside of the sequence scope.
But you're proposal should work IF sequence = 1 (just not in my usercase)
Op di 27 jul. 2021 om 15:08 schreef ryanheise @.***>:
sequence is the playlist of the player. The skip buttons move forwards and backwards through that sequence. Try print(player.sequence.length); to confirm if you are unsure whether it is 1 in your app. Assuming it is 1 in your app, is this solution acceptable?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ryanheise/just_audio/issues/459#issuecomment-887497524, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRCRWSJU4ADBNJVO5IYGOLTZ2VVLANCNFSM5BCDTMRA .
If you do indeed use a sequence as a library but you don't want a playlist, how do you prevent sequence from acting as a playlist? Because after one item plays out it automatically advances to the next item in the sequence.
Simple, i only use livestreams from online radiostations, so simply put, they won't end :-)
Op di 27 jul. 2021 om 15:41 schreef ryanheise @.***>:
If you do indeed use a sequence as a library but you don't want a playlist, how do you prevent sequence from acting as a playlist? Because after one item plays out it automatically advances to the next item in the sequence.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ryanheise/just_audio/issues/459#issuecomment-887523429, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRCRWVKBMI6GT7CKPV6FNDTZ2ZSHANCNFSM5BCDTMRA .
I see.
If you fix that in your app, I assume you would be satisfied with the proposed solution?
That that should work, so yes
IF i can fix that (noob in flutter ;-) )
Op di 27 jul. 2021 om 15:56 schreef ryanheise @.***>:
I see.
If you fix that in your app, I assume you would be satisfied with the proposed solution?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ryanheise/just_audio/issues/459#issuecomment-887534538, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRCRWR23465XGCUW2HDQKDTZ23HBANCNFSM5BCDTMRA .
Can you try the the fix/queue
branch and let me know if it works now for you?
Sure...havent done that before...can you switch branch in pubspec.yaml? And how? :-)
@bafplus try this:
just_audio:
git:
url: https://github.com/ryanheise/just_audio.git
ref: fix/queue
path: just_audio
Although since you want to test the just_audio_background
package, you may use this:
just_audio_background:
git:
url: https://github.com/ryanheise/just_audio.git
ref: fix/queue
path: just_audio_background
This is now published on pub, so you can do it the normal way. Let me know if you still encounter issues, otherwise I'll close if it is now working.
I just tested it ( i think ) If i only have 1 item in sequence the skip buttons are gone, and thats indeed exactly what i need. That is what you changed right?
Yes, and the change also affects multi-item sequences too by disabling the next button when you're on the last item and disabling the previous button when you're on the first item. If the sequence length is 1, then there is no next or previous so both buttons are disabled.
Thanks for the feature request and testing.
Happy to test! Thanks for helping.
One question tho, in my case sequence should always be 1. Whats the best way to "override" your code so it wil always be 1?
My next "project" will be chromecast support. But its very hard stuff since there are no (good) plugins (yet). Does anyone have a working implementation? Just selecting target device and "sling" the audiourl is enaugh in my usecase.
If you need help understanding how to have a sequence of length 1, please either ask for help on StackOverflow or consult the documentation.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with just_audio.
Is your feature request related to a problem? Please describe. I dont use the skip buttons in my project. However, they still show in the background service (pulled from top). Is there a way to hide those skip buttons?
Describe the solution you'd like A tag or setting to hide/show such buttons
Describe alternatives you've considered A way to change the code without editing the source directly.
Additional context