jalle19 / xsphpf
A library for creating XSPF playlists
1.0.0
2017-10-28 12:19 UTC
Requires
- php: >=5.4
Requires (Dev)
- phpunit/phpunit: ^4.8
This package is auto-updated.
Last update: 2024-12-13 01:22:21 UTC
README
A minimal library for creating XSPF playlists.
Requirements
- PHP >= 5.4
Installation
composer require jalle19/xsphpf
Usage
<?php // Create a playlist $playlist = new Jalle19\xsphpf\Playlist(); // Create a track $track = new Jalle19\xsphpf\Track('http://example.com/song_1.mp3'); // Define some optional attributes for the track $track->setTitle('Some fancy title') ->setDuration(300) ->setImage('http://example.com/image.jpeg'); // Add the track to the playlist $playlist->addTrack($track); // Serialize the playlist to XML $xml = $playlist->__toString();
License
GPL-3