mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
Fix cover surface & dvdsub direct play
This commit is contained in:
parent
b84166e2a5
commit
2eea5b967e
4 changed files with 9 additions and 4 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue