mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20:30 +05:30
Merge branch 'libre-tube:master' into master
This commit is contained in:
commit
0599581a89
@ -720,12 +720,18 @@ class PlayerFragment : Fragment() {
|
|||||||
setMediaSource(subtitle, videoUri, audioUrl)
|
setMediaSource(subtitle, videoUri, audioUrl)
|
||||||
qualityText.text = videosNameArray[index]
|
qualityText.text = videosNameArray[index]
|
||||||
return@lit
|
return@lit
|
||||||
} else if (index + 1 == response.videoStreams.size) {
|
} else if (response.hls != null) {
|
||||||
val mediaItem: MediaItem = MediaItem.Builder()
|
val mediaItem: MediaItem = MediaItem.Builder()
|
||||||
.setUri(response.hls)
|
.setUri(response.hls)
|
||||||
.setSubtitleConfigurations(subtitle)
|
.setSubtitleConfigurations(subtitle)
|
||||||
.build()
|
.build()
|
||||||
exoPlayer.setMediaItem(mediaItem)
|
exoPlayer.setMediaItem(mediaItem)
|
||||||
|
} else {
|
||||||
|
Toast.makeText(
|
||||||
|
context,
|
||||||
|
getString(R.string.unknown_error),
|
||||||
|
Toast.LENGTH_LONG
|
||||||
|
).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -967,7 +973,6 @@ class PlayerFragment : Fragment() {
|
|||||||
return@launchWhenCreated
|
return@launchWhenCreated
|
||||||
} catch (e: HttpException) {
|
} catch (e: HttpException) {
|
||||||
Log.e(TAG, "HttpException, unexpected response")
|
Log.e(TAG, "HttpException, unexpected response")
|
||||||
Toast.makeText(context, R.string.server_error, Toast.LENGTH_SHORT).show()
|
|
||||||
return@launchWhenCreated
|
return@launchWhenCreated
|
||||||
}
|
}
|
||||||
commentsAdapter = CommentsAdapter(videoId!!, commentsResponse.comments)
|
commentsAdapter = CommentsAdapter(videoId!!, commentsResponse.comments)
|
||||||
|
Loading…
Reference in New Issue
Block a user