setDevice method

void setDevice(
  1. Device device
)
inherited

Sets playback Device for the instance of Player.

Use Devices.all getter to get List of all Device.

A playback Device for a Player instance cannot be changed in the middle of playback. Device will be switched once a new Media is played.

Implementation

void setDevice(Device device) {
  final deviceIdCStr = device.id.toNativeUtf8();
  final deviceNameCStr = device.name.toNativeUtf8();
  PlayerFFI.setDevice(
    id,
    deviceIdCStr,
    deviceNameCStr,
  );
}