Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {

initializeTransitionLayout()
initializeOnClickActions()
initializePlayerView()

if (PlayerHelper.autoFullscreenEnabled && resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) {
setFullscreen()
Expand Down Expand Up @@ -468,6 +469,21 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
}
}

private fun initializePlayerView() {
// initialize the player view actions
binding.player.initialize(
doubleTapOverlayBinding,
playerGestureControlsViewBinding,
chaptersViewModel
)
binding.player.initPlayerOptions(
viewModel,
commonPlayerViewModel,
viewLifecycleOwner,
this
)
}

@SuppressLint("ClickableViewAccessibility")
private fun initializeTransitionLayout() {
mainActivity.binding.container.isVisible = true
Expand Down Expand Up @@ -937,7 +953,8 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
return
}

if (!playerController.isInSegment(viewModel.segments.value.orEmpty())) binding.sbSkipBtn.isGone = true
if (!playerController.isInSegment(viewModel.segments.value.orEmpty())) binding.sbSkipBtn.isGone =
true
}

private fun playVideo() {
Expand Down Expand Up @@ -975,7 +992,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
player = playerController
}

initializePlayerView()
updatePlayerView()

if (binding.playerMotionLayout.progress != 1.0f) {
// show controllers when not in picture in picture mode
Expand Down Expand Up @@ -1008,20 +1025,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
}

@SuppressLint("SetTextI18n")
private fun initializePlayerView() {
// initialize the player view actions
binding.player.initialize(
doubleTapOverlayBinding,
playerGestureControlsViewBinding,
chaptersViewModel
)
binding.player.initPlayerOptions(
viewModel,
commonPlayerViewModel,
viewLifecycleOwner,
this
)

private fun updatePlayerView() {
binding.descriptionLayout.setStreams(streams)

binding.apply {
Expand Down Expand Up @@ -1114,7 +1118,8 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
}

private fun updatePlayPauseButton() {
binding.playImageView.setImageResource(PlayerHelper.getPlayPauseActionIcon(playerController))
val playPauseAction = PlayerHelper.getPlayPauseActionIcon(playerController)
binding.playImageView.setImageResource(playPauseAction)
}

private suspend fun initializeHighlight(highlight: Segment) {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/exo_styled_player_control_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
style="@style/ExoStyledControls.Button.Center.PlayPause"
android:layout_marginHorizontal="10dp"
android:background="?android:selectableItemBackgroundBorderless"
android:src="@drawable/ic_play"
app:tint="@android:color/white" />

<FrameLayout
Expand Down
Loading