Documentation
¶
Overview ¶
Copyright © 2024 Alexandre Pires
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
Constants ¶
const (
// M3U8Version3 represents version 3 of the M3U8 format.
M3U8Version3 = 3
)
Variables ¶
var (
M3U8Directives = []string{
"EXTM3U",
"EXTINF",
"PLAYLIST",
"EXTGRP",
"EXTALB",
"EXTART",
"EXTGENRE",
"EXTM3A",
"EXTBYT",
"EXTBIN",
"EXTENC",
"EXTIMG",
"EXT-X-START",
"EXT-X-INDEPENDENT-SEGMENTS",
"EXT-X-PLAYLIST-TYPE",
"EXT-X-TARGETDURATION",
"EXT-X-VERSION",
"EXT-X-MEDIA-SEQUENCE",
"EXT-X-MEDIA",
"EXT-X-STREAM-INF",
"EXT-X-BYTERANGE",
"EXT-X-DISCONTINUITY",
"EXT-X-DISCONTINUITY-SEQUENCE",
"EXT-X-GAP",
"EXT-X-KEY",
"EXT-X-MAP",
"EXT-X-PROGRAM-DATE-TIME",
"EXT-X-DATERANGE",
"EXT-X-I-FRAMES-ONLY",
"EXT-X-SESSION-DATA",
"EXT-X-SESSION-KEY",
"EXT-X-ENDLIST",
"EXTVLCOPT",
"KODIPROP",
}
)
Functions ¶
This section is empty.
Types ¶
type M3UEntry ¶
type M3UEntry struct {
URI string `json:"uri"` // The URI of the media.
Duration int `json:"duration"` // The duration of the media in seconds (if available).
Title string `json:"title"` // The title of the media (if available).
Tags []M3UTag `json:"tags"` // Additional tags associated with the entry.
}
M3UEntry represents a single entry in the M3U file.
func (*M3UEntry) GetDuration ¶
type M3UPlaylist ¶
type M3UPlaylist struct {
Version int // The version of the M3U (EXTM3U).
Entries []M3UEntry // The list of media entries in the playlist.
Tags []M3UTag // Additional tags associated with the entry.
}
M3UPlaylist represents the parsed M3U playlist.
func ParseM3UFile ¶
func ParseM3UFile(filePath string) (*M3UPlaylist, error)
ParseM3UFile reads an M3U file and returns a parsed M3UPlaylist.
func (*M3UPlaylist) GetEntries ¶
func (playlist *M3UPlaylist) GetEntries() []M3UEntry
func (*M3UPlaylist) GetVersion ¶
func (playlist *M3UPlaylist) GetVersion() int
func (*M3UPlaylist) String ¶
func (playlist *M3UPlaylist) String() string