Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 925 Bytes

README.md

File metadata and controls

40 lines (28 loc) · 925 Bytes

yocLib - MPEGURL (PHP)

This yocLibrary enables your project to read and write MPEGURL files in PHP.

Status

Build Status

Installation

composer require yocto/yoclib-mpegurl

Use

Read:

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:

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);