fix: a few playback and home recommendation issues

Fixed the home recommendation display to use proper images.
Fixed an issue for the subtitles background rendering
Fixed playback resume from position

Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com>
This commit is contained in:
Lance Chant
2026-05-21 18:04:45 +02:00
parent d1794798e7
commit cc89b5df89
7 changed files with 105 additions and 33 deletions

View File

@@ -462,7 +462,19 @@ class MPVLayerRenderer(private val context: Context) : MPVLib.EventObserver {
fun setSubtitleFontSize(size: Int) {
MPVLib.setPropertyInt("sub-font-size", size)
}
fun setSubtitleBorderStyle(style: String) {
MPVLib.setPropertyString("sub-border-style", style)
}
fun setSubtitleBackgroundColor(color: String) {
MPVLib.setPropertyString("sub-back-color", color)
}
fun setSubtitleAssOverride(mode: String) {
MPVLib.setPropertyString("sub-ass-override", mode)
}
// MARK: - Audio Track Controls
fun getAudioTracks(): List<Map<String, Any>> {

View File

@@ -151,6 +151,18 @@ class MpvPlayerModule : Module() {
view.setSubtitleFontSize(size)
}
AsyncFunction("setSubtitleBorderStyle") { view: MpvPlayerView, style: String ->
view.setSubtitleBorderStyle(style)
}
AsyncFunction("setSubtitleBackgroundColor") { view: MpvPlayerView, color: String ->
view.setSubtitleBackgroundColor(color)
}
AsyncFunction("setSubtitleAssOverride") { view: MpvPlayerView, mode: String ->
view.setSubtitleAssOverride(mode)
}
// Audio track functions
AsyncFunction("getAudioTracks") { view: MpvPlayerView ->
view.getAudioTracks()

View File

@@ -271,7 +271,19 @@ class MpvPlayerView(context: Context, appContext: AppContext) : ExpoView(context
fun setSubtitleFontSize(size: Int) {
renderer?.setSubtitleFontSize(size)
}
fun setSubtitleBorderStyle(style: String) {
renderer?.setSubtitleBorderStyle(style)
}
fun setSubtitleBackgroundColor(color: String) {
renderer?.setSubtitleBackgroundColor(color)
}
fun setSubtitleAssOverride(mode: String) {
renderer?.setSubtitleAssOverride(mode)
}
// MARK: - Audio Track Controls
fun getAudioTracks(): List<Map<String, Any>> {

View File

@@ -243,6 +243,7 @@ internal object TvRecommendationsPublisher {
.setContentId(providerId)
.setIntentUri(buildIntentUri(context, item.optString("playRoute").ifBlank { item.optString("route") }))
.setWeight(weight)
.setPosterArtAspectRatio(TvContractCompat.PreviewPrograms.ASPECT_RATIO_16_9)
item.optString("subtitle").takeIf { it.isNotBlank() }?.let {
builder.setDescription(it)
@@ -250,7 +251,6 @@ internal object TvRecommendationsPublisher {
imageUrl.takeIf { it.isNotBlank() }?.let {
val imageUri = Uri.parse(it)
builder.setPosterArtUri(imageUri)
builder.setThumbnailUri(imageUri)
}