From 5d9a08ee360657a7a25521369472b1d58a4814cb Mon Sep 17 00:00:00 2001
From: Tristan Roux
Date: Sat, 16 Feb 2019 12:19:13 +0100
Subject: [PATCH] Solving a bug that preveted lives from beeing played.
---
MusicApp/Resources/Portable Class/MusicPlayer.cs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/MusicApp/Resources/Portable Class/MusicPlayer.cs b/MusicApp/Resources/Portable Class/MusicPlayer.cs
index d9538ea..7ced203 100644
--- a/MusicApp/Resources/Portable Class/MusicPlayer.cs
+++ b/MusicApp/Resources/Portable Class/MusicPlayer.cs
@@ -383,9 +383,11 @@ namespace MusicApp.Resources.Portable_Class
DefaultDataSourceFactory dataSourceFactory = new DefaultDataSourceFactory(Application.Context, "MusicApp");
IExtractorsFactory extractorFactory = new DefaultExtractorsFactory();
Handler handler = new Handler();
- IMediaSource mediaSource;
- if (!song.IsYt)
+ IMediaSource mediaSource = null;
+ if (song.IsLiveStream)
+ mediaSource = new HlsMediaSource(Uri.Parse(song.Path), dataSourceFactory, handler, null);
+ else if (!song.IsYt)
mediaSource = new ExtractorMediaSource(Uri.FromFile(new Java.IO.File(song.Path)), dataSourceFactory, extractorFactory, handler, null);
else
mediaSource = new ExtractorMediaSource(Uri.Parse(song.Path), dataSourceFactory, extractorFactory, handler, null);