M3u generator class to generate m3u playlist string from playlist object

Hierarchy

  • M3uGenerator

Constructors

Methods

  • Generate is static method to generate m3u playlist string from playlist object

    Returns

    final m3u playlist string

    Example

    const playlist = new M3uPlaylist();
    playlist.title = 'Test playlist';
    M3uGenerator.generate(playlist);

    Parameters

    • playlist: M3uPlaylist

      playlist object to generate m3u playlist string

    Returns string

  • Private

    Get generated attributes media part string from m3u attributes object

    Returns

    attributes generated string (attributeName="attributeValue" ...)

    Parameters

    Returns string

  • Private

    Get generated string of custom directives for both, playlist and media

    Parameters

    • customData: M3uCustomData[]

      custom data object, that represents unknown directives

    Returns string

  • Private

    Get generated media part string from m3u playlist media object

    Returns

    media part string with info, group and location each on separated line

    Parameters

    Returns string

  • Private

    Method to determine if we need to add info directive or not based on media object and attributes string. At least media duration, media name or some attributes must be present to return true

    Returns

    boolean if we should add info directive into final media

    Parameters

    • media: M3uMedia

      m3u media object

    • attributesString: string

      m3u attributes string

    Returns boolean

Generated using TypeDoc