diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackPage.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackPage.kt index e9afb607..0eaacc2f 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackPage.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackPage.kt @@ -177,7 +177,7 @@ fun PlaybackPage( var playbackSpeed by remember { mutableFloatStateOf(1.0f) } LaunchedEffect(playbackSpeed) { player.setPlaybackSpeed(playbackSpeed) } - val presentationState = rememberPresentationState(player) + val presentationState = rememberPresentationState(player, false) val scaledModifier = Modifier.resizeWithContentScale(contentScale, presentationState.videoSizeDp) val focusRequester = remember { FocusRequester() } @@ -251,7 +251,7 @@ fun PlaybackPage( surfaceType = SURFACE_TYPE_SURFACE_VIEW, modifier = scaledModifier, ) - if (false && presentationState.coverSurface) { + if (presentationState.coverSurface) { Box( Modifier .matchParentSize() diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt index 8f03b3bc..ff413110 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt @@ -545,7 +545,7 @@ class PlaybackViewModel } val transcodeType = when { - playerBackend == PlayerBackend.MPV -> PlayMethod.DIRECT_PLAY +// playerBackend == PlayerBackend.MPV -> PlayMethod.DIRECT_PLAY source.supportsDirectPlay -> PlayMethod.DIRECT_PLAY source.supportsDirectStream -> PlayMethod.DIRECT_STREAM source.supportsTranscoding -> PlayMethod.TRANSCODE diff --git a/app/src/main/java/com/github/damontecres/wholphin/util/mpv/MpvDeviceProfile.kt b/app/src/main/java/com/github/damontecres/wholphin/util/mpv/MpvDeviceProfile.kt index 1bd04e93..01aa49b4 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/util/mpv/MpvDeviceProfile.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/util/mpv/MpvDeviceProfile.kt @@ -43,6 +43,7 @@ val mpvDeviceProfile = Codec.Container.MKV, Codec.Container.MOV, Codec.Container.MP4, + Codec.Container.MPG, Codec.Container.OGM, Codec.Container.OGV, Codec.Container.TS, @@ -62,7 +63,7 @@ val mpvDeviceProfile = Codec.Video.VP9, ) - audioCodec(*supportedAudioCodecs) + audioCodec(*supportedAudioCodecs, Codec.Audio.WAV, Codec.Audio.OGG) } subtitleProfile(Codec.Subtitle.VTT, embedded = true, hls = true, external = true) @@ -71,6 +72,7 @@ val mpvDeviceProfile = subtitleProfile(Codec.Subtitle.SUBRIP, embedded = true, external = true) subtitleProfile(Codec.Subtitle.TTML, embedded = true, external = true) subtitleProfile(Codec.Subtitle.DVBSUB, embedded = true, encode = true) + subtitleProfile(Codec.Subtitle.DVDSUB, embedded = true, encode = true) subtitleProfile(Codec.Subtitle.IDX, embedded = true, encode = true) subtitleProfile(Codec.Subtitle.PGS, embedded = true, encode = true) subtitleProfile(Codec.Subtitle.PGSSUB, embedded = true, encode = true) diff --git a/app/src/main/java/com/github/damontecres/wholphin/util/mpv/MpvPlayer.kt b/app/src/main/java/com/github/damontecres/wholphin/util/mpv/MpvPlayer.kt index 2969489b..c9fcf472 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/util/mpv/MpvPlayer.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/util/mpv/MpvPlayer.kt @@ -597,6 +597,8 @@ class MpvPlayer( override fun event(eventId: Int) { when (eventId) { +// MPV_EVENT_START_FILE -> { +// } MPV_EVENT_FILE_LOADED -> { Timber.d("event: MPV_EVENT_FILE_LOADED") mediaItem!!.localConfiguration?.subtitleConfigurations?.forEach { @@ -605,6 +607,7 @@ class MpvPlayer( Timber.v("Adding external subtitle track '$title'") MPVLib.command(arrayOf("sub-add", url, "auto", title)) } + notifyListeners(EVENT_RENDERED_FIRST_FRAME) { onRenderedFirstFrame() } notifyListeners(EVENT_IS_PLAYING_CHANGED) { onIsPlayingChanged(true) } getTracks().let { notifyListeners(EVENT_TRACKS_CHANGED) { onTracksChanged(it) }