mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
fix: STRM files not playing correctly (#210)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
b470c26875
commit
54babaec89
1 changed files with 10 additions and 1 deletions
|
|
@ -204,6 +204,8 @@ class PlaybackModelHelper {
|
|||
final trickPlay = (await api.getTrickPlay(item: fullItem.body, ref: ref))?.body;
|
||||
final chapters = fullItem.body?.overview.chapters ?? [];
|
||||
|
||||
final mediaPath = isValidVideoUrl(mediaSource?.path ?? "");
|
||||
|
||||
if (mediaSource == null) return null;
|
||||
|
||||
if ((mediaSource.supportsDirectStream ?? false) || (mediaSource.supportsDirectPlay ?? false)) {
|
||||
|
|
@ -230,7 +232,9 @@ class PlaybackModelHelper {
|
|||
chapters: chapters,
|
||||
playbackInfo: playbackInfo,
|
||||
trickPlay: trickPlay,
|
||||
media: Media(url: '${ref.read(userProvider)?.server ?? ""}/Videos/${mediaSource.id}/stream?$params'),
|
||||
media: Media(
|
||||
url: mediaPath ?? '${ref.read(userProvider)?.server ?? ""}/Videos/${mediaSource.id}/stream?$params',
|
||||
),
|
||||
mediaStreams: mediaStreamsWithUrls,
|
||||
);
|
||||
} else if ((mediaSource.supportsTranscoding ?? false) && mediaSource.transcodingUrl != null) {
|
||||
|
|
@ -252,6 +256,11 @@ class PlaybackModelHelper {
|
|||
}
|
||||
}
|
||||
|
||||
String? isValidVideoUrl(String path) {
|
||||
Uri? uri = Uri.tryParse(path);
|
||||
return (uri != null && uri.hasScheme && uri.hasAuthority) ? path : null;
|
||||
}
|
||||
|
||||
Future<List<ItemBaseModel>> collectQueue(ItemBaseModel model) async {
|
||||
switch (model) {
|
||||
case EpisodeModel _:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue