mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-08-04 23:30:52 +00:00
Fixed video being cut off.
This commit is contained in:
parent
3adf761158
commit
12a9b99fff
1 changed files with 7 additions and 4 deletions
|
@ -19,6 +19,7 @@ import android.widget.TextView
|
||||||
import androidx.annotation.OptIn
|
import androidx.annotation.OptIn
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import androidx.core.view.setMargins
|
import androidx.core.view.setMargins
|
||||||
|
import androidx.media3.common.C
|
||||||
import androidx.media3.common.PlaybackParameters
|
import androidx.media3.common.PlaybackParameters
|
||||||
import androidx.media3.common.VideoSize
|
import androidx.media3.common.VideoSize
|
||||||
import androidx.media3.common.util.UnstableApi
|
import androidx.media3.common.util.UnstableApi
|
||||||
|
@ -123,7 +124,8 @@ class FutoVideoPlayer : FutoVideoPlayerBase {
|
||||||
private var _currentChapterLoopId: Int = 0;
|
private var _currentChapterLoopId: Int = 0;
|
||||||
private var _currentChapter: IChapter? = null;
|
private var _currentChapter: IChapter? = null;
|
||||||
private var _promptedForPermissions: Boolean = false;
|
private var _promptedForPermissions: Boolean = false;
|
||||||
|
@UnstableApi
|
||||||
|
private var _desiredResizeModePortrait: Int = AspectRatioFrameLayout.RESIZE_MODE_FIT
|
||||||
|
|
||||||
//Events
|
//Events
|
||||||
val onMinimize = Event1<FutoVideoPlayer>();
|
val onMinimize = Event1<FutoVideoPlayer>();
|
||||||
|
@ -593,7 +595,7 @@ class FutoVideoPlayer : FutoVideoPlayerBase {
|
||||||
|
|
||||||
gestureControl.hideControls();
|
gestureControl.hideControls();
|
||||||
//videoControlsBar.visibility = View.VISIBLE;
|
//videoControlsBar.visibility = View.VISIBLE;
|
||||||
_videoView.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_ZOOM;
|
_videoView.resizeMode = _desiredResizeModePortrait;
|
||||||
|
|
||||||
videoControls.show();
|
videoControls.show();
|
||||||
_videoControls_fullscreen.hideImmediately();
|
_videoControls_fullscreen.hideImmediately();
|
||||||
|
@ -730,9 +732,10 @@ class FutoVideoPlayer : FutoVideoPlayerBase {
|
||||||
Log.d(TAG, "WEIRD HEIGHT DETECTED: ${_lastSourceFit}, Width: ${w}, Height: ${h}, VWidth: ${viewWidth}");
|
Log.d(TAG, "WEIRD HEIGHT DETECTED: ${_lastSourceFit}, Width: ${w}, Height: ${h}, VWidth: ${viewWidth}");
|
||||||
}
|
}
|
||||||
if(_lastSourceFit != determinedHeight)
|
if(_lastSourceFit != determinedHeight)
|
||||||
_videoView.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FIT;
|
_desiredResizeModePortrait = AspectRatioFrameLayout.RESIZE_MODE_FIT;
|
||||||
else
|
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();
|
val marginBottom = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 7f, resources.displayMetrics).toInt();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue