setMedia method

void setMedia(
  1. String uri,
  2. MediaType type
)

Set media of type. Can be used to load external audio track and subtitle file. https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#void-setmediaconst-char-url-mediatype-type

Implementation

void setMedia(String uri, MediaType type) {
  final cs = uri.toNativeUtf8();
  _player.ref.setMediaForType.asFunction<
          void Function(Pointer<mdkPlayer>, Pointer<Char>, int)>()(
      _player.ref.object, cs.cast(), type.rawValue);
  malloc.free(cs);
}