https://github.com/yocto/yoclib-mpegurl-php
PHP yocLib for MPEGURL
https://github.com/yocto/yoclib-mpegurl-php
hls mpeg mpegurl php yoclib
Last synced: about 1 year ago
JSON representation
PHP yocLib for MPEGURL
- Host: GitHub
- URL: https://github.com/yocto/yoclib-mpegurl-php
- Owner: yocto
- License: gpl-3.0
- Created: 2021-03-10T11:06:26.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-17T12:56:21.000Z (about 5 years ago)
- Last Synced: 2025-02-09T17:45:42.761Z (over 1 year ago)
- Topics: hls, mpeg, mpegurl, php, yoclib
- Language: PHP
- Homepage: https://github.com/yocto/yoclib-mpegurl-php
- Size: 24.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# yocLib - MPEGURL (PHP)
This yocLibrary enables your project to read and write MPEGURL files in PHP.
## Status
[](https://travis-ci.com/yocto/yoclib-mpegurl-php)
## Installation
`composer require yocto/yoclib-mpegurl`
## Use
Read:
```php
use YOCLIB\MPEGURL\MPEGURL;
$fileContent = '';
$fileContent .= '#EXTM3U'."\r\n";
$fileContent .= '#EXTINF:123,The example file'."\r\n";
$fileContent .= '/home/user/test.mp3'."\r\n";
$mpegurl = MPEGURL::read($fileContent);
```
Write:
```php
use YOCLIB\MPEGURL\MPEGURL;
use YOCLIB\MPEGURL\Lines\Location;
use YOCLIB\MPEGURL\Lines\Tags\EXTINF;
use YOCLIB\MPEGURL\Lines\Tags\EXTMxU;
$mpegurl = new MPEGURL();
$mpegurl->addLine(new EXTMxU());
$mpegurl->addLine(new EXTINF('123,The example file'));
$mpegurl->addLine(new Location('/home/user/test.mp3'));
$fileContent = MPEGURL::write($mpegurl);
```