
Module for fetching and working with M3U8 manifest files. This is for individual manifests not multi-variant playlists (I may eventually create a module that builds on this)
$m = Video::M3U8->new($url_or_filename)
If the string contains 'http', new() will fetch the contains from the web, if it does not, new will read from the file and process the contents, the contents are read into a hash once. since its possible for playlists to be updated consistently, the only time it is fetched is on 'new()', all other functions work from cache, each new manifest or seeking updates should be called again.
Function will return the entire manifest/playlist
$m->get_playlist
If you would just like to use the tags;
$m->get_tags
If its an Ondemand playlist or the last in a Live stream (contains EXT-X-ENDLIST tag) this sub will return '1' (true)
$m->is_last_playlist
Function will return the target duration
$m->get_target_duration

Copyright (c) 2012 Cost: tell me about bugs or points to improve - have fun. Omar Salix, <osalix@gmail.com>