{"id":20330738,"url":"https://github.com/chrisyue/mala","last_synced_at":"2025-04-11T21:07:25.027Z","repository":{"id":56952679,"uuid":"52843972","full_name":"chrisyue/mala","owner":"chrisyue","description":"Translate your http video resources (m3u8) into an http live streaming channel","archived":false,"fork":false,"pushed_at":"2016-03-20T10:39:20.000Z","size":16,"stargazers_count":6,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-04-11T21:06:37.132Z","etag":null,"topics":["epg","hls","m3u","m3u8","m3u8-videos","php","playlist"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrisyue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-01T03:08:53.000Z","updated_at":"2022-12-15T04:37:38.000Z","dependencies_parsed_at":"2022-08-21T08:20:29.423Z","dependency_job_id":null,"html_url":"https://github.com/chrisyue/mala","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyue%2Fmala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyue%2Fmala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyue%2Fmala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyue%2Fmala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisyue","download_url":"https://codeload.github.com/chrisyue/mala/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480435,"owners_count":21110937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["epg","hls","m3u","m3u8","m3u8-videos","php","playlist"],"created_at":"2024-11-14T20:17:30.451Z","updated_at":"2025-04-11T21:07:25.000Z","avatar_url":"https://github.com/chrisyue.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Mala\n====\n\nv1.0.2\n\nTransform your m3u8 videos into a http live streaming channel\n\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/f2d48dbd-2a9c-42eb-94ee-a097fb79e1f6/big.png)](https://insight.sensiolabs.com/projects/f2d48dbd-2a9c-42eb-94ee-a097fb79e1f6)\n\n[![Latest Stable Version](https://poser.pugx.org/chrisyue/mala/v/stable)](https://packagist.org/packages/chrisyue/mala)\n[![License](https://poser.pugx.org/chrisyue/mala/license)](https://packagist.org/packages/chrisyue/mala)\n[![Build Status](https://travis-ci.org/chrisyue/mala.svg?branch=develop)](https://travis-ci.org/chrisyue/mala)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/chrisyue/mala/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/chrisyue/mala/?branch=develop)\n[![Code Coverage](https://scrutinizer-ci.com/g/chrisyue/mala/badges/coverage.png?b=develop)](https://scrutinizer-ci.com/g/chrisyue/mala/?branch=develop)\n[![StyleCI](https://styleci.io/repos/52257600/shield)](https://styleci.io/repos/52257600)\n\nInstallation\n------------\n\n```\n$ composer require 'chrisyue/mala'\n```\n\nUsage\n-----\n\nI suggest you check the [mala-demo](https://github.com/chrisyue/mala-demo) to see more details.\n\nSuppose you've already implemented all interfaces under `Model` and `Manager` namespaces, then you can\n\n### Generate EPG with m3u8 videos and generate hls playlist (scheduled media segments)\n\n```php\n// $epgManager = Chrisyue\\Mala\\Manager\\EpgManagerInterface;\n// $videoManager = Chrisyue\\Mala\\Manager\\VideoManagerInterface;\n$epgScheduler = new \\Chrisyue\\Mala\\EpgScheduler($epgManager, $videoManager);\n\n// $channel = Chrisyue\\Mala\\Model\\ChannelInterface;\n\n// generate tomorrow's epg\n$epgScheduler-\u003eschedule($channel, new \\DateTime('tomorror midnight'), new \\DateTime('tomorrow 23:59:59'));\n\n// generate playlist\n// $mediaSegmentManager = ...;\n$parser = new \\Chrisyue\\PhpM3u8\\Parser();\n$playlistScheduler = new \\Chrisyue\\Mala\\PlaylistScheduler($parser, $epgManager, $mediaSegmentManager);\n$playlistScheduler-\u003eschedule($channel, new \\DateTime('tomorror midnight'), new \\DateTime('tomorrow 23:59:59'));\n```\n\n### Generate current hls m3u8 from scheduled epg and playlist\n\n```php\n// $mediaSegmentManager = ...;\n$options = ['target_duration' =\u003e 10, 'version' =\u003e 3];\n$m3u8Generator = new M3u8Generator($mediaSegmentManager, $options);\n\n// $channel = ...;\n$m3u8 = $m3u8Generator-\u003egenerate($channel[, $playsAt]); // or can you specify the play time as the 2nd parameter\n\n// $dumper = ...;\n$dumper-\u003edump($m3u8);\n```\n\nYou can check the [mala-demo](https://github.com/chrisyue/mala-demo) to get more details and examples about implementing the model/manager interfaces\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisyue%2Fmala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisyue%2Fmala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisyue%2Fmala/lists"}