Skip to main content

Player API Embedding Examples

Embed music players directly on your pages using the Wildfire API.


Example 1: Embed an Album

To embed an album player, use the embedAlbum method with either a UID or URL:

By UID:
<?php
$api = new apiClass();
$api->callApi([
    'engine' => 'player',
    'method' => 'embedAlbum',
    'id' => 'ALBUM_UID_HERE'
], false, true);
?>
By URL:
<?php
$api = new apiClass();
$api->callApi([
    'engine' => 'player',
    'method' => 'embedAlbum',
    'url' => 'album-url-slug'
], false, true);
?>

Album

Rooftops + Little Phoenix Baby

Rooftops
Enola Fall
0:000:000 plays

Example 2: Embed a Playlist

To embed a playlist player, use the embedPlaylist method:

By UID:
<?php
$api = new apiClass();
$api->callApi([
    'engine' => 'player',
    'method' => 'embedPlaylist',
    'id' => 'PLAYLIST_UID_HERE'
], false, true);
?>
By URL:
<?php
$api = new apiClass();
$api->callApi([
    'engine' => 'player',
    'method' => 'embedPlaylist',
    'url' => 'playlist-url-slug'
], false, true);
?>

Playlist

Enola Fall Sampler

Little Phoenix Baby
Enola Fall
0:000:000 plays

Example 3: Embed a Single Track

To embed a single track player (without queue), use the embedTrack method:

By UID:
<?php
$api = new apiClass();
$api->callApi([
    'engine' => 'player',
    'method' => 'embedTrack',
    'id' => 'TRACK_UID_HERE'
], false, true);
?>
By URL:
<?php
$api = new apiClass();
$api->callApi([
    'engine' => 'player',
    'method' => 'embedTrack',
    'url' => 'track-url-slug'
], false, true);
?>

Track

Little Phoenix Baby

Enola Fall

Little Phoenix Baby
Enola Fall
0:000:000 plays

API Parameters

Parameter Required Description
engine Yes Must be 'player'
method Yes One of: 'embedAlbum', 'embedPlaylist', 'embedTrack'
id One required The UID of the album, playlist, or track
url One required The URL slug of the album, playlist, or track (alternative to id)

callApi() Function Parameters

Parameter Type Default Description
$data array required API parameters (engine, method, id/url)
$json bool false If true, returns decoded JSON array. For player embeds, use false
$echo bool false If true, echoes output directly. For player embeds, use true
Note:

The player embed includes all necessary CSS and JavaScript automatically. No additional setup required!

The player will work on any page where you embed it using the API.