File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,8 @@ class PlaybackModelHelper {
204204 final trickPlay = (await api.getTrickPlay (item: fullItem.body, ref: ref))? .body;
205205 final chapters = fullItem.body? .overview.chapters ?? [];
206206
207+ final mediaPath = isValidVideoUrl (mediaSource? .path ?? "" );
208+
207209 if (mediaSource == null ) return null ;
208210
209211 if ((mediaSource.supportsDirectStream ?? false ) || (mediaSource.supportsDirectPlay ?? false )) {
@@ -230,7 +232,9 @@ class PlaybackModelHelper {
230232 chapters: chapters,
231233 playbackInfo: playbackInfo,
232234 trickPlay: trickPlay,
233- media: Media (url: '${ref .read (userProvider )?.server ?? "" }/Videos/${mediaSource .id }/stream?$params ' ),
235+ media: Media (
236+ url: mediaPath ?? '${ref .read (userProvider )?.server ?? "" }/Videos/${mediaSource .id }/stream?$params ' ,
237+ ),
234238 mediaStreams: mediaStreamsWithUrls,
235239 );
236240 } else if ((mediaSource.supportsTranscoding ?? false ) && mediaSource.transcodingUrl != null ) {
@@ -252,6 +256,11 @@ class PlaybackModelHelper {
252256 }
253257 }
254258
259+ String ? isValidVideoUrl (String path) {
260+ Uri ? uri = Uri .tryParse (path);
261+ return (uri != null && uri.hasScheme && uri.hasAuthority) ? path : null ;
262+ }
263+
255264 Future <List <ItemBaseModel >> collectQueue (ItemBaseModel model) async {
256265 switch (model) {
257266 case EpisodeModel _:
You can’t perform that action at this time.
0 commit comments