mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
Player._playTrack not checking currentTrack.uri validity fix
This commit is contained in:
parent
799919d538
commit
25854c843f
@ -138,10 +138,11 @@ class _PlayerState extends State<Player> with WidgetsBindingObserver {
|
|||||||
Future _playTrack(Track currentTrack, Playback playback) async {
|
Future _playTrack(Track currentTrack, Playback playback) async {
|
||||||
try {
|
try {
|
||||||
if (currentTrack.id != _currentTrackId) {
|
if (currentTrack.id != _currentTrackId) {
|
||||||
if (currentTrack.uri != null) {
|
Uri? parsedUri = Uri.tryParse(currentTrack.uri!);
|
||||||
|
if (parsedUri != null && parsedUri.hasAbsolutePath) {
|
||||||
await player
|
await player
|
||||||
.setAudioSource(
|
.setAudioSource(
|
||||||
AudioSource.uri(Uri.parse(currentTrack.uri!)),
|
AudioSource.uri(parsedUri),
|
||||||
preload: true,
|
preload: true,
|
||||||
)
|
)
|
||||||
.then((value) async {
|
.then((value) async {
|
||||||
|
Loading…
Reference in New Issue
Block a user