jalle19/xsphpf

A library for creating XSPF playlists

1.0.0 2017-10-28 12:19 UTC

This package is auto-updated.

Last update: 2024-09-13 00:35:48 UTC


README

A minimal library for creating XSPF playlists.

Build Status Coverage Status Scrutinizer Code Quality

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