chrisyue/mala
Composer 安装命令:
composer require chrisyue/mala
包简介
Transform your m3u8 videos into a http live streaming channel
README 文档
README
v1.0.2
Transform your m3u8 videos into a http live streaming channel
Installation
$ composer require 'chrisyue/mala'
Usage
I suggest you check the mala-demo to see more details.
Suppose you've already implemented all interfaces under Model and Manager namespaces, then you can
Generate EPG with m3u8 videos and generate hls playlist (scheduled media segments)
// $epgManager = Chrisyue\Mala\Manager\EpgManagerInterface; // $videoManager = Chrisyue\Mala\Manager\VideoManagerInterface; $epgScheduler = new \Chrisyue\Mala\EpgScheduler($epgManager, $videoManager); // $channel = Chrisyue\Mala\Model\ChannelInterface; // generate tomorrow's epg $epgScheduler->schedule($channel, new \DateTime('tomorror midnight'), new \DateTime('tomorrow 23:59:59')); // generate playlist // $mediaSegmentManager = ...; $parser = new \Chrisyue\PhpM3u8\Parser(); $playlistScheduler = new \Chrisyue\Mala\PlaylistScheduler($parser, $epgManager, $mediaSegmentManager); $playlistScheduler->schedule($channel, new \DateTime('tomorror midnight'), new \DateTime('tomorrow 23:59:59'));
Generate current hls m3u8 from scheduled epg and playlist
// $mediaSegmentManager = ...; $options = ['target_duration' => 10, 'version' => 3]; $m3u8Generator = new M3u8Generator($mediaSegmentManager, $options); // $channel = ...; $m3u8 = $m3u8Generator->generate($channel[, $playsAt]); // or can you specify the play time as the 2nd parameter // $dumper = ...; $dumper->dump($m3u8);
You can check the mala-demo to get more details and examples about implementing the model/manager interfaces
统计信息
- 总下载量: 221
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-03-01