setProperty method

Future<void> setProperty(
  1. String property,
  2. String value
)

Sets property for the internal libmpv instance of this Player. Please use this method only if you know what you are doing, existing methods in Player implementation are suited for the most use cases.

See:

Implementation

Future<void> setProperty(String property, String value) async {
  if (disposed) {
    throw AssertionError('[Player] has been disposed');
  }
  await waitForPlayerInitialization;
  await waitForVideoControllerInitializationIfAttached;

  final name = property.toNativeUtf8();
  final data = value.toNativeUtf8();
  mpv.mpv_set_property_string(
    ctx,
    name.cast(),
    data.cast(),
  );
  calloc.free(name);
  calloc.free(data);
}