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
7 changes: 5 additions & 2 deletions composeApp/src/desktopMain/native/macos/player_bridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2101,13 +2101,16 @@ - (void)applySubtitleStyleWithTextColor:(NSString *)textColor
value:[resolvedBackgroundColor hasPrefix:@"#00"] ? @"outline-and-shadow" : @"opaque-box"];
}
if (modeChanged || outlineColorChanged) {
[self setStringProperty:"sub-outline-color" value:resolvedOutlineColor];
// The bundled mpv exposes the outline only as --sub-border-color;
// --sub-outline-color fails silently here.
[self setStringProperty:"sub-border-color" value:resolvedOutlineColor];
}
if (modeChanged || boldChanged) {
[self setStringProperty:"sub-bold" value:bold ? @"yes" : @"no"];
}
if (modeChanged || outlineSizeChanged) {
mpv_set_property(_mpv, "sub-outline-size", MPV_FORMAT_DOUBLE, &outline);
// Outline size uses the same --sub-border-* naming as the color.
mpv_set_property(_mpv, "sub-border-size", MPV_FORMAT_DOUBLE, &outline);
}
}
if (stripSdhChanged) {
Expand Down
6 changes: 4 additions & 2 deletions composeApp/src/desktopMain/native/windows/player_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1220,15 +1220,17 @@ class WindowsMpvWebPlayer : public std::enable_shared_from_this<WindowsMpvWebPla
);
}
if (modeChanged || outlineColorChanged) {
setStringProperty("sub-outline-color", resolvedOutlineColor);
// --sub-border-color works on every mpv revision, unlike the
// --sub-outline-color name used by newer builds.
setStringProperty("sub-border-color", resolvedOutlineColor);
}
if (modeChanged || boldChanged) {
setStringProperty("sub-bold", bold ? "yes" : "no");
}
if (modeChanged || outlineSizeChanged) {
std::lock_guard<std::mutex> lock(mpvMutex);
if (!mpv) return;
mpvApi().setProperty(mpv, "sub-outline-size", MPV_FORMAT_DOUBLE, &outline);
mpvApi().setProperty(mpv, "sub-border-size", MPV_FORMAT_DOUBLE, &outline);
}
}
if (stripSdhChanged) {
Expand Down
6 changes: 4 additions & 2 deletions iosApp/iosApp/Player/MPVPlayerBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -830,12 +830,14 @@ final class MPVPlayerViewController: UIViewController {
checkError(mpv_set_property_string(mpv, "sub-ass-override", "no"))
checkError(mpv_set_property_string(mpv, "sub-color", textColor))
checkError(mpv_set_property_string(mpv, "sub-back-color", backgroundColor))
checkError(mpv_set_property_string(mpv, "sub-outline-color", outlineColor))
// --sub-border-color/--sub-border-size work on every mpv revision, unlike
// the --sub-outline-* names used by newer builds.
checkError(mpv_set_property_string(mpv, "sub-border-color", outlineColor))
checkError(mpv_set_property_string(mpv, "sub-border-style", backgroundColor.hasPrefix("#00") ? "outline-and-shadow" : "opaque-box"))
setStringProperty("sub-bold", bold ? "yes" : "no")

var outline = Double(outlineSize)
checkError(mpv_set_property(mpv, "sub-outline-size", MPV_FORMAT_DOUBLE, &outline))
checkError(mpv_set_property(mpv, "sub-border-size", MPV_FORMAT_DOUBLE, &outline))

var size = Double(fontSize)
checkError(mpv_set_property(mpv, "sub-font-size", MPV_FORMAT_DOUBLE, &size))
Expand Down
Loading