Git Product home page Git Product logo

m3uzi's Introduction

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.

m3uzi's People

Watchers

Brian avatar Ben avatar  avatar James Cloos avatar Stephen Pasich avatar Matt Smith avatar  avatar Russell Brooks avatar  avatar  avatar

Forkers

os6sense

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.