Skip to content

Commit

Permalink
spotless Apply
Browse files Browse the repository at this point in the history
  • Loading branch information
chikoski committed May 17, 2024
1 parent dca953e commit 32a5086
Showing 1 changed file with 22 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -69,8 +69,8 @@ import com.google.jetstream.presentation.screens.videoPlayer.components.VideoPla
import com.google.jetstream.presentation.screens.videoPlayer.components.rememberVideoPlayerPulseState
import com.google.jetstream.presentation.screens.videoPlayer.components.rememberVideoPlayerState
import com.google.jetstream.presentation.utils.handleDPadKeyEvents
import kotlinx.coroutines.delay
import kotlin.time.Duration.Companion.milliseconds
import kotlinx.coroutines.delay

object VideoPlayerScreen {
const val MovieIdBundleKey = "movieId"
Expand Down Expand Up @@ -123,7 +123,8 @@ fun VideoPlayerScreenContent(movieDetails: MovieDetails, onBackPressed: () -> Un
emptyList()
} else {
listOf(
MediaItem.SubtitleConfiguration.Builder(Uri.parse(movieDetails.subtitleUri))
MediaItem.SubtitleConfiguration
.Builder(Uri.parse(movieDetails.subtitleUri))
.setMimeType("application/vtt")
.setLanguage("en")
.setSelectionFlags(C.SELECTION_FLAG_DEFAULT)
Expand Down Expand Up @@ -206,7 +207,6 @@ fun VideoPlayerControls(
}
}


VideoPlayerMainFrame(
mediaTitle = {
VideoPlayerMediaTitle(
Expand Down Expand Up @@ -264,7 +264,6 @@ fun VideoPlayerControls(
)
}


@androidx.annotation.OptIn(UnstableApi::class)
@Composable
private fun rememberExoPlayer(context: Context) = remember {
Expand All @@ -287,22 +286,22 @@ private fun Modifier.dPadEvents(
videoPlayerState: VideoPlayerState,
pulseState: VideoPlayerPulseState
): Modifier = this.handleDPadKeyEvents(
onLeft = {
if (!videoPlayerState.controlsVisible) {
exoPlayer.seekBack()
pulseState.setType(BACK)
}
},
onRight = {
if (!videoPlayerState.controlsVisible) {
exoPlayer.seekForward()
pulseState.setType(FORWARD)
}
},
onUp = { videoPlayerState.showControls() },
onDown = { videoPlayerState.showControls() },
onEnter = {
exoPlayer.pause()
videoPlayerState.showControls()
onLeft = {
if (!videoPlayerState.controlsVisible) {
exoPlayer.seekBack()
pulseState.setType(BACK)
}
)
},
onRight = {
if (!videoPlayerState.controlsVisible) {
exoPlayer.seekForward()
pulseState.setType(FORWARD)
}
},
onUp = { videoPlayerState.showControls() },
onDown = { videoPlayerState.showControls() },
onEnter = {
exoPlayer.pause()
videoPlayerState.showControls()
}
)

0 comments on commit 32a5086

Please sign in to comment.