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
6 changes: 5 additions & 1 deletion media_kit/lib/src/player/native/player/real.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2328,6 +2328,11 @@ class NativePlayer extends PlatformPlayer {
// Set --vid=no by default to prevent redundant video decoding.
// [VideoController] internally sets --vid=auto upon attachment to enable video rendering & decoding.
if (!test) 'vid': 'no',
// The OSC is a built-in Lua script and may be unavailable in libmpv
// builds compiled without Lua. Set it as an initialization option so
// supported builds disable it before scripts are loaded, while builds
// without the option can safely ignore it.
if (!configuration.osc) 'osc': 'no',
};

if (Platform.isAndroid &&
Expand Down Expand Up @@ -2423,7 +2428,6 @@ class NativePlayer extends PlatformPlayer {
properties.addAll(
{
if (!configuration.osc) ...{
'osc': 'no',
'osd-level': '0',
},
'title': configuration.title,
Expand Down
23 changes: 23 additions & 0 deletions media_kit/test/src/player/player_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,29 @@ void main() {
addTearDown(player.dispose);
},
);
test(
'player-configuration-osc-disabled-does-not-log-property-not-found',
() async {
final player = Player(
configuration: const PlayerConfiguration(osc: false),
);
var hasOscPropertyError = false;
final subscription = player.stream.log.listen((event) {
if (event.text.contains('_setProperty(osc')) {
hasOscPropertyError = true;
}
});

await player.platform?.waitForPlayerInitialization;
await Future<void>.delayed(Duration.zero);

expect(hasOscPropertyError, isFalse);

await subscription.cancel();
await player.dispose();
},
skip: UniversalPlatform.isWeb,
);
test(
'player-open-playable-media',
() async {
Expand Down
Loading