Melo v2.10 - YouTube Proxy, Download-Screen, Logger, iOS
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:just_audio/just_audio.dart';
|
||||
import '../models/song.dart';
|
||||
@@ -43,7 +44,16 @@ class PlayerService {
|
||||
_aktuellerIndex = _warteschlange.length - 1;
|
||||
}
|
||||
try {
|
||||
await _p.setFilePath(song.dateiPfad);
|
||||
if (song.streamUrl != null && song.streamUrl!.isNotEmpty) {
|
||||
// Streaming vom Server
|
||||
await _p.setUrl(song.streamUrl!);
|
||||
} else if (song.dateiPfad.isNotEmpty && await File(song.dateiPfad).exists()) {
|
||||
// Lokale Datei
|
||||
await _p.setFilePath(song.dateiPfad);
|
||||
} else {
|
||||
debugPrint('Keine gültige Quelle für: ${song.titel}');
|
||||
return;
|
||||
}
|
||||
if (position > 0) await _p.seek(Duration(seconds: position));
|
||||
await _p.play();
|
||||
_songWechsel.add(song);
|
||||
|
||||
Reference in New Issue
Block a user