addSubtitleSource method

Future<void> addSubtitleSource(
  1. String url,
  2. String name, {
  3. String? mimeType,
})

This interface is only supported by the premium version of the player (Player_Premium), and you need to purchase the premium version of the player mobile license. Add external subtitles @param url subtitle address @param name The name of the subtitle. If you add multiple subtitles, please set the subtitle name to a different name to distinguish it from other added subtitles, otherwise it may lead to incorrect subtitle selection. @param mimeType subtitle type, only supports VVT and SRT formats VOD_PLAY_MIMETYPE_TEXT_SRT VOD_PLAY_MIMETYPE_TEXT_VTT Later, you can get the corresponding name through the name in the result returned by getSubtitleTrackInfo.

Implementation

Future<void> addSubtitleSource(String url, String name, {String? mimeType}) async {
  if (_isNeedDisposed) return;
  await _initPlayer.future;
  await _mc!.invoke<void>('addSubtitleSource', {
    'url': url,
    'name': name,
    'mimeType': mimeType,
  });
}