Project

m3uzi

0.02
No release in over 3 years
Low commit activity in last 3 years
Read and write M3U files with (relative) ease.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

M3Uzi

Read and write M3U files with (relative) ease.

Usage

Read an M3U file:

M3Uzi.read("/path/to/file.m3u8")

Write an M3U file:

m3u.write("/path/to/file.m3u8")

Get a list of filenames:

m3u.filenames

Get all file reference objects:

m3u.files

Add a file to the M3U index:

m3u.add_file do |file|
  file.path = "/path/to/file.ts"
  file.duration = 10
  file.description = "no desc"
end

Get all tag reference objects:

m3u.tags

Get an individual tag value (TARGETDURATION MEDIA-SEQUENCE ALLOW-CACHE STREAM-INF ENDLIST VERSION):

m3u[:targetduration]
m3u[:media_sequence]

Set an individual tag value:

m3u[:targetduration] = 100

Add a tag to the M3U index (custom tags even):

m3u.add_tag do |tag|
  tag.name = "VERSION"
  tag.value = "1"
end

Add a comment:

m3u << "Comment"
m3u.add_comment("Comment")

NOTES

  • Target duration will be calculated and included if omitted

TODO

  • Tags KEY, PROGRAM-DATE-TIME, and DISCONTINUITY are not supported
  • Stream info is not working yet
  • Tests need to be written
  • Needs to be turned into a gem

(c) 2010 Brandon Arbini / Zencoder, Inc.