mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 16:30:31 +05:30
fix: check if streams is initialized
Fixes a crash when trying to rotate the player before it is initialized.
This commit is contained in:
parent
8242b7c045
commit
75d6e734e5
@ -141,11 +141,11 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
|||||||
private lateinit var streams: Streams
|
private lateinit var streams: Streams
|
||||||
val isShort
|
val isShort
|
||||||
get() = run {
|
get() = run {
|
||||||
val heightGreaterThanWidth = streams.videoStreams.firstOrNull()?.let {
|
val heightGreaterThanWidth = ::streams.isInitialized && streams.videoStreams.firstOrNull()?.let {
|
||||||
(it.height ?: 0) > (it.width ?: 0)
|
(it.height ?: 0) > (it.width ?: 0)
|
||||||
}
|
} == true
|
||||||
|
|
||||||
PlayingQueue.getCurrent()?.isShort == true || heightGreaterThanWidth == true
|
PlayingQueue.getCurrent()?.isShort == true || heightGreaterThanWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
// if null, it's been set to automatic
|
// if null, it's been set to automatic
|
||||||
|
Loading…
x
Reference in New Issue
Block a user