insert method

void insert(
  1. int index,
  2. Media source
)

Inserts Media to the Playlist of the Player instance at specific index.

Implementation

void insert(int index, Media source) {
  final sourceMediaTypeCStr = source.mediaType.toString().toNativeUtf8();
  final sourceResourceCStr = source.resource.toString().toNativeUtf8();
  PlayerFFI.insert(
    id,
    index,
    sourceMediaTypeCStr,
    sourceResourceCStr,
  );
  calloc.free(sourceMediaTypeCStr);
  calloc.free(sourceResourceCStr);
}