changeSubtitle method

Future<void> changeSubtitle(
  1. PlayerKidSubtitlesSource itemSubtitleSelected
)

Implementation

Future<void> changeSubtitle(
    PlayerKidSubtitlesSource itemSubtitleSelected) async {
  try {
    final itemSubtitleSelectedHashMap = HashMap();
    itemSubtitleSelectedHashMap[Constant.KEY_SUBTITLE_LABEL] =
        itemSubtitleSelected.name;
    itemSubtitleSelectedHashMap[Constant.KEY_SUBTITLE_INDEX] =
        itemSubtitleSelected.type?.index;
    await methodChannel.invokeMethod(
        Constant.METHOD_CHANGE_SUBTITLE, itemSubtitleSelectedHashMap);
    _subtitleSelectedListener?.call(itemSubtitleSelected);
  } on PlatformException catch (_) {}
}