Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
🐛 Fix crash on launch
Browse files Browse the repository at this point in the history
  • Loading branch information
markhaehnel committed Dec 14, 2020
1 parent 63d1535 commit 7de4eed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Expand Up @@ -91,7 +91,7 @@ dependencies {
def preference_version = "1.1.1"
implementation "androidx.preference:preference-ktx:$preference_version"

def m3u8parser_version = "0.17"
def m3u8parser_version = "0.6"
implementation "io.lindstrom:m3u8-parser:$m3u8parser_version"

def recycler_version = "1.1.0"
Expand Down
Expand Up @@ -86,13 +86,12 @@ class StreamRepository @Inject constructor(
youTubeService.getPlaylist(playlistUrl).enqueue(object : Callback<ResponseBody> {
override fun onResponse(call: Call<ResponseBody>, response: Response<ResponseBody>) {
try {
val responseString = response.body()?.string()

// Hotfix for playlist parser not understanding video-range attribute
//responseString.replace() ,VIDEO-RANGE=SDR
var responseBody = response.body()?.string()

if (responseString != null) {
val playlist = MasterPlaylistParser().readPlaylist(responseString)
if (!responseBody.isNullOrBlank()) {
// Hotfix for playlist parser not understanding video-range attribute
responseBody = responseBody.replace(",VIDEO-RANGE=SDR", "")
val playlist = MasterPlaylistParser().readPlaylist(responseBody)
data.value = Resource.success(playlist)
} else {
data.value = Resource.error("Error: Playlist is empty")
Expand Down

0 comments on commit 7de4eed

Please sign in to comment.