remove layout changed listener

Changelog: changed
This commit is contained in:
Kai 2025-06-17 15:26:27 -05:00
commit 98b6213886
No known key found for this signature in database
2 changed files with 9 additions and 10 deletions

View file

@ -432,10 +432,6 @@ class VideoDetailView : ConstraintLayout {
showChaptersUI();
};
_layoutPlayerContainer.addOnLayoutChangeListener { v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom ->
onShouldEnterPictureInPictureChanged.emit()
}
_title.setOnLongClickListener {
val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager;
val clip = ClipData.newPlainText("Video Title", (it as TextView).text);
@ -1967,6 +1963,10 @@ class VideoDetailView : ConstraintLayout {
videoTrackFormats.distinctBy { it.height }.sortedBy { it.height },
audioTrackFormats.distinctBy { it.bitrate }.sortedBy { it.bitrate });
}
_layoutPlayerContainer.post {
onShouldEnterPictureInPictureChanged.emit()
}
}
private var _didTriggerDatasourceErrorCount = 0;
@ -2427,7 +2427,6 @@ class VideoDetailView : ConstraintLayout {
}
isPlaying = playing;
onShouldEnterPictureInPictureChanged.emit()
updateTracker(lastPositionMilliseconds, playing, true);
}
@ -2559,6 +2558,9 @@ class VideoDetailView : ConstraintLayout {
setProgressBarOverlayed(false);
}
onFullscreenChanged.emit(fullscreen);
_layoutPlayerContainer.post {
onShouldEnterPictureInPictureChanged.emit()
}
}
private fun setCastEnabled(isCasting: Boolean) {
@ -2832,10 +2834,6 @@ class VideoDetailView : ConstraintLayout {
} else {
_layoutPlayerContainer.setPadding(0, 0, 0, 0);
}
_layoutPlayerContainer.post {
onShouldEnterPictureInPictureChanged.emit()
}
}
fun getPictureInPictureParams() : PictureInPictureParams {
var videoSourceWidth = _player.exoPlayer?.player?.videoSize?.width ?: 0;

View file

@ -484,7 +484,8 @@ class FutoVideoPlayer : FutoVideoPlayerBase {
fun getVideoRect(): Rect {
val r = Rect()
_videoView.getGlobalVisibleRect(r)
// this is the only way i could reliably get a reference to a view that matches perfectly with the video playback
_videoView.subtitleView?.getGlobalVisibleRect(r)
return r
}