public static boolean isSubtitleStreamAvailable(int streamNum, MediaElement element) {
    // Check this is a video element
    if (element.getType() != MediaElementType.VIDEO) {
      return false;
    }

    // Get list of subtitle streams for video file
    List<SubtitleStream> subtitles = element.getSubtitleStreams();

    if (subtitles == null) {
      return false;
    }

    return subtitles.size() >= streamNum;
  }
  public Integer getForcedSubtitleIndex(MediaElement element) {
    // Check this is a video element
    if (element.getType() != MediaElementType.VIDEO) {
      return null;
    }

    // Get list of subtitle streams for video file
    List<SubtitleStream> subtitles = element.getSubtitleStreams();

    if (subtitles == null) {
      return null;
    }

    // Scan subtitles for forced streams
    for (SubtitleStream subtitle : subtitles) {
      if (subtitle.isForced()) {
        return subtitle.getStream();
      }
    }

    return null;
  }