Skip to content
Read/write M3U8 files with (relative) ease.
Ruby
Find file
Latest commit 61054c2 Apr 12, 2012 @jgreer jgreer Version bump to 0.5.1
Failed to load latest commit information.
lib Version bump to 0.5.1 Apr 12, 2012
test A bunch of work toward supporting tag placement and rotating encrypti… Oct 18, 2011
.gitignore Ignore zenflow files in git. Jan 11, 2012
LICENSE
README.md Fixing bug with tags that have multiple dashes. Aug 27, 2010
Rakefile Initial commit. Aug 27, 2010
m3uzi.gemspec Updated authors. Dec 30, 2010

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.

Something went wrong with that request. Please try again.