Read/write M3U8 files with (relative) ease.
Ruby
Latest commit 61054c2 Apr 12, 2012 @jgreer jgreer Version bump to 0.5.1
Permalink
Failed to load latest commit information.
lib
test
.gitignore
LICENSE
README.md
Rakefile
m3uzi.gemspec

README.md

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.