Skip to content

Commit

Permalink
Merge branch 'master' of gitlab.futo.org:videostreaming/grayjay
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelvin-FUTO committed Aug 30, 2024
2 parents 82a07e2 + 12a9b99 commit af6d219
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import android.widget.TextView
import androidx.annotation.OptIn
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.setMargins
import androidx.media3.common.C
import androidx.media3.common.PlaybackParameters
import androidx.media3.common.VideoSize
import androidx.media3.common.util.UnstableApi
Expand Down Expand Up @@ -123,7 +124,8 @@ class FutoVideoPlayer : FutoVideoPlayerBase {
private var _currentChapterLoopId: Int = 0;
private var _currentChapter: IChapter? = null;
private var _promptedForPermissions: Boolean = false;

@UnstableApi
private var _desiredResizeModePortrait: Int = AspectRatioFrameLayout.RESIZE_MODE_FIT

//Events
val onMinimize = Event1<FutoVideoPlayer>();
Expand Down Expand Up @@ -593,7 +595,7 @@ class FutoVideoPlayer : FutoVideoPlayerBase {

gestureControl.hideControls();
//videoControlsBar.visibility = View.VISIBLE;
_videoView.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_ZOOM;
_videoView.resizeMode = _desiredResizeModePortrait;

videoControls.show();
_videoControls_fullscreen.hideImmediately();
Expand Down Expand Up @@ -730,9 +732,10 @@ class FutoVideoPlayer : FutoVideoPlayerBase {
Log.d(TAG, "WEIRD HEIGHT DETECTED: ${_lastSourceFit}, Width: ${w}, Height: ${h}, VWidth: ${viewWidth}");
}
if(_lastSourceFit != determinedHeight)
_videoView.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FIT;
_desiredResizeModePortrait = AspectRatioFrameLayout.RESIZE_MODE_FIT;
else
_videoView.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_ZOOM;
_desiredResizeModePortrait = AspectRatioFrameLayout.RESIZE_MODE_ZOOM;
_videoView.resizeMode = _desiredResizeModePortrait
}

val marginBottom = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 7f, resources.displayMetrics).toInt();
Expand Down

0 comments on commit af6d219

Please sign in to comment.