addSubtitles method

Future addSubtitles(
  1. String file, {
  2. AddMediaFlag? flag,
  3. String? title,
  4. String? lang,
})

add subtitle file
@param file - path to the subtitle file
@param flag - select / auto /cached
@param title - subtitle title in the UI
@param lang - subitlte language

Implementation

Future addSubtitles(String file,
    {AddMediaFlag? flag, String? title, String? lang}) {
  List<String> args = [
    path.joinAll([
      path.current,
    ])
  ];
  // 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('sub-add', args);
}