Generate and parse m3u8 playlists for HTTP Live Streaming (HLS).
Add this to your application's shard.yml
:
dependencies:
m3u8:
github: akiicat/m3u8
require "m3u8"
module App
include M3U8
end
playlist = Playlist.new
playlist.items << SegmentItem.new(duration: 10.991, segment: "test_01.ts")
playlist.to_s
#EXTM3U
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-TARGETDURATION:10
#EXTINF:10.991,
test_01.ts
#EXT-X-ENDLIST
file = File.read "spec/playlists/master.m3u8"
playlist = Playlist.parse(file)
playlist.master? # => true
- EXTM3U
- EXT-X-VERSION
- EXTINF
- EXT-X-BYTERANGE
- EXT-X-DISCONTINUITY
- EXT-X-KEY
- EXT-X-MAP
- EXT-X-PROGRAM-DATE-TIME
- EXT-X-DATERANGE
- EXT-X-TARGETDURATION
- EXT-X-MEDIA-SEQUENCE
- EXT-X-DISCONTINUITY-SEQUENCE
- EXT-X-ENDLIST
- EXT-X-PLAYLIST-TYPE
- EXT-X-I-FRAMES-ONLY
- EXT-X-ALLOW-CACHE (was removed in protocol version 7)
- EXT-X-MEDIA
- EXT-X-STREAM-INF
- EXT-X-I-FRAME-STREAM-INF
- EXT-X-SESSION-DATA
- EXT-X-SESSION-KEY
- EXT-X-INDEPENDENT-SEGMENTS
- EXT-X-START
- EXT-X-CUE-OUT
- EXT-X-CUE-OUT-CONT
- EXT-X-CUE-IN
- EXT-X-CUE-SPAN
- EXT-OATCLS-SCTE35
- Fork it ( https://github.com/akiicat/m3u8/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- Akiicat Akiicat - creator, maintainer