addAudioTrack method

Future<void> addAudioTrack(
  1. String file,
  2. AddMediaFlag? flag,
  3. String? title,
  4. String? lang,
)

Implementation

Future<void> addAudioTrack(
    String file, AddMediaFlag? flag, String? title, String? lang) {
  List<String> args = [
    path.joinAll([path.current, file])
  ];
  // add the flag if specified
  if (flag != null) {
    args = [...args, flag.name];
  }

  // add the title if specified
  if (title != null) {
    args = [...args, title];
  }

  // add the language if specified
  if (lang != null) {
    args = [...args, lang];
  }

  // finally add the argument
  return command<void>('audio-add', args);
}