Class MediaTracksUtils


  • public class MediaTracksUtils
    extends java.lang.Object
    Utility class for Media track management.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void checkVttTrackIntegrity​(Track track)
      Checks if a VTT track has the valid format (containing milliseconds or not).
      static void transformSrtTracktoVttTrack​(Track track)
      Converts a track from SRT to VTT format.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MediaTracksUtils

        public MediaTracksUtils()
    • Method Detail

      • transformSrtTracktoVttTrack

        public static void transformSrtTracktoVttTrack​(Track track)
                                                throws java.io.IOException
        Converts a track from SRT to VTT format. Implementation details : only SRT files are supported, using a very naive parsing for now.
        Parameters:
        track - the track to be converted
        Throws:
        java.io.IOException
      • checkVttTrackIntegrity

        public static void checkVttTrackIntegrity​(Track track)
                                           throws java.io.IOException
        Checks if a VTT track has the valid format (containing milliseconds or not). If not, the method performs a correction (adds milliseconds to timestamps).
        Parameters:
        track - the track to be checked and corrected if needed
        Throws:
        java.io.IOException