-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add usage notes to README and update names in API
- Loading branch information
Showing
4 changed files
with
26 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,27 @@ | ||
= M3uParser | ||
|
||
M3uParser provides Java API around an M3U playlist. | ||
M3uParser provides Java API around an (extended) M3U playlist. Based on ANTLR grammar. | ||
|
||
image:https://api.bintray.com/packages/krom/maven/m3uparser/images/download.svg["Download", link="https://bintray.com/krom/maven/m3uparser/_latestVersion"] | ||
image:https://travis-ci.org/kromkrom/m3uparser.svg?branch=master["Build Status", link="https://travis-ci.org/kromkrom/m3uparser"] | ||
image:https://api.codeclimate.com/v1/badges/7a0a58d5015b63a63dce/maintainability["Maintainability", link="https://codeclimate.com/github/kromkrom/m3uparser/maintainability"] | ||
image:https://api.codeclimate.com/v1/badges/7a0a58d5015b63a63dce/maintainability["Maintainability", link="https://codeclimate.com/github/kromkrom/m3uparser/maintainability"] | ||
|
||
== Usage | ||
Public API consists of: `DefaultM3uParser` which implements `M3uParserWrapper` and `PlaylistEntry`. | ||
|
||
`getPlaylistProperties()` returns a map of properties from `#EXTM3U` section. | ||
|
||
`getPlaylistEntries()` return a list of playlist entries, each represented by `PlaylistEntry` class. | ||
Its members are: | ||
|
||
* `title` -- an entry title, | ||
* `path` -- a path or a URL of a file, | ||
* `length` -- file length (commonly -1 or 0 for streams), | ||
* `group` -- group name from `#EXTGRP` (could be `null`), | ||
* `properties` -- a map of entry-specific properties from `#EXTINF` section. | ||
|
||
== Format specification | ||
There is no formal specification for M3U format (see https://en.wikipedia.org/wiki/M3U). | ||
|
||
M3uParser supports "extended M3U", in particular `\#EXTM3U`, `#EXTINF` and `#EXTGRP` directives. | ||
All other comments (starting with `#`) are ignored. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package ru.grushetsky.m3uparser | ||
|
||
interface M3uParserWrapper { | ||
fun getPlaylistParameters(): Map<String, String> | ||
fun getPlaylistProperties(): Map<String, String> | ||
fun getPlaylistEntries(): List<PlaylistEntry> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
package ru.grushetsky.m3uparser | ||
|
||
data class PlaylistEntry( | ||
val name: String, | ||
val title: String, | ||
val path: String, | ||
val length: Int, | ||
val group: String?, | ||
val parameters: Map<String, String> | ||
val properties: Map<String, String> | ||
) |