Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
fix: storyboards making the app crash on short videos
Browse files Browse the repository at this point in the history
  • Loading branch information
kuylar committed Jul 5, 2023
1 parent 7e32289 commit 9032d9b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions app/src/main/java/dev/kuylar/lighttube/ui/VideoPlayerManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,18 @@ class VideoPlayerManager(private val activity: MainActivity) : Player.Listener,
player.currentMediaItem?.mediaMetadata?.artist
if (player.currentMediaItem?.mediaId != null)
setSponsors(player.currentMediaItem?.mediaId!!)
if (player.currentMediaItem?.mediaMetadata?.extras != null)
setStoryboards(
player.currentMediaItem?.mediaMetadata?.extras?.getString("storyboard"),
player.currentMediaItem?.mediaMetadata?.extras?.getString("recommendedLevel"),
player.currentMediaItem?.mediaMetadata?.extras?.getLong("length")
)
else
try {
if (player.currentMediaItem?.mediaMetadata?.extras != null)
setStoryboards(
player.currentMediaItem?.mediaMetadata?.extras?.getString("storyboard"),
player.currentMediaItem?.mediaMetadata?.extras?.getString("recommendedLevel"),
player.currentMediaItem?.mediaMetadata?.extras?.getLong("length")
)
else
storyboard = null
} catch (e: Exception) {
storyboard = null
}
videoTracks = null
}

Expand Down

0 comments on commit 9032d9b

Please sign in to comment.