LycheeAudioPlayer constructor

LycheeAudioPlayer(
  1. String url
)

Implementation

LycheeAudioPlayer(this.url)
    : _port = ReceivePort('lychee_player_port: $url') {
  _initializeDartApi();
  _playerHandle = _bindings.lychee_player_create(
      url.toNativeUtf8().cast(), _port.sendPort.nativePort);
  _port.listen((message) {
    assert(message is Uint8List);
    final values = Int64List.view(message.buffer);
    assert(values.length == 3);
    _handleNativePlayerMessage(values[0], values[1], values[2]);
  });
}