Skip to content

yocto/yoclib-mpegurl-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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