From c025913fc8ed2c7840f2871e8ffa0f86c5df8b2f Mon Sep 17 00:00:00 2001 From: Koen Date: Wed, 10 Jan 2024 13:13:25 +0100 Subject: [PATCH] Fixed tutorial video aspect ratio. --- .../fragment/mainactivity/main/TutorialFragment.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/TutorialFragment.kt b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/TutorialFragment.kt index 1b86fb0a..20cdcaa2 100644 --- a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/TutorialFragment.kt +++ b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/TutorialFragment.kt @@ -108,9 +108,9 @@ class TutorialFragment : MainFragment() { } } - class TutorialVideoSourceDescriptor(url: String, duration: Long) : VideoUnMuxedSourceDescriptor() { + class TutorialVideoSourceDescriptor(url: String, duration: Long, width: Int, height: Int) : VideoUnMuxedSourceDescriptor() { override val videoSources: Array = arrayOf( - VideoUrlSource("1080p", url, 1920, 1080, duration, "video/mp4") + VideoUrlSource("Original", url, width, height, duration, "video/mp4") ) override val audioSources: Array = arrayOf() } @@ -121,7 +121,9 @@ class TutorialFragment : MainFragment() { override val description: String, thumbnailUrl: String, videoUrl: String, - override val duration: Long + override val duration: Long, + width: Int = 1920, + height: Int = 1080 ) : IPlatformVideoDetails { override val id: PlatformID = PlatformID("tutorial", uuid) override val contentType: ContentType = ContentType.MEDIA @@ -138,7 +140,7 @@ class TutorialFragment : MainFragment() { override val isLive: Boolean = false override val rating: IRating = RatingLikes(-1) override val viewCount: Long = -1 - override val video: IVideoSourceDescriptor = TutorialVideoSourceDescriptor(videoUrl, duration) + override val video: IVideoSourceDescriptor = TutorialVideoSourceDescriptor(videoUrl, duration, width, height) override fun getComments(client: IPlatformClient): IPager { return EmptyPager() } @@ -210,7 +212,9 @@ class TutorialFragment : MainFragment() { description = "How can I monetize as a creator?", thumbnailUrl = "https://releases.grayjay.app/tutorials/monetization.jpg", videoUrl = "https://releases.grayjay.app/tutorials/monetization.mp4", - duration = 47 + duration = 47, + 1080, + 1920 ) ) }