Upgrade and provisioning
The Soundtrack Player Library is provisioned by our build systems. This allows for controlled and staggered rollouts, ensuring stability and targeted updates.
During the integration process, our team will provide you with a unique API endpoint for your platform. We refer to this endpoint as a release channel. This channel provides the versioning information and a download link for the Player Library built for your toolchain.
Automatic update requirements
To comply with our 6-month support lifecycle, your application must implement an automatic updater that performs the following:
-
Poll for updates periodically: Your application must poll the release channel every 15 minutes to check for new versions.
-
Verify and apply updates: The updater must download the new Player Library, verify its checksum and have a strategy to replace the old library.
Release channel response
A successful request will return a JSON object with the following structure:
{
"id": "...",
"version": "48.17-308",
"link": "https://download.link.com/...",
"checksum": "9e12bb0ded21711ea1c666dc776b2751febcc01f",
"platform": "splayer-x86_64"
}-
The
versionfield indicates the latest available version string. -
The
linkfield provides a URL to download the Player Library. -
The
checksumis a SHA-1 hash of the file from the link. You must verify that the checksum of your downloaded file matches this value to ensure its integrity.
The remaining fields can be ignored by the implemented updater.
Implementation steps
The reference app in the SDK package includes an updater we wrote in C, src/updater.c, which you are free to use and modify. The reference app page also lists what you need to add to it before it meets every requirement on this page. In general, your updater should work as follows:
-
Query the release channel: Send an HTTP
GETrequest to your release channel with the required headers. -
Compare versions: Parse the
versionfrom the JSON response and compare it with the version of the currently running library. If they are the same, no action is needed. -
Download: If the versions differ, download the Player Library from the link provided.
-
Verify checksum: After downloading, calculate the SHA-1 hash of the file and confirm it matches the checksum from the JSON response. This step is mandatory. If the checksums do not match, discard the file.
-
Apply update: If the checksum is valid, the new library file should replace the old one. To avoid disrupting active playback, this process must be handled gracefully. The application should signal the SDK to quit at the end of the current track by calling
request_exitwith the valueSPLAYER_EXIT_UPGRADEfrom thesplayer_exit_tenum. Once the application has exited, apply the update by replacing the library file, and restart. After restarting, playback should resume as normal. -
Restore state and fall back: Certification also requires that the restarted player restores the playback state it had before the update (playing or paused), and that the updater falls back to the previous library version if installation fails. See tests 3.3 and 3.4 in SDK certification. To start a player paused, use
set_initially_pausedfrom the options API (see the changelog).
Required HTTP headers
Your request must include the following headers:
X-Device-Key-0: always with valueeth0.X-Device-Id-0: Device ID. Every device is assigned one once it has been connected to a sound zone. In the example below the Device ID is28cfe91fcc6d. If the device is not connected, you can omit this header.
X-Device-Key-0:eth0
X-Device-Id-0:28cfe91fcc6dExample of adding HTTP headers with cURL
char buf[1024];
snprintf(buf, sizeof(buf), "X-Device-Id-0:%s", device_id);
struct curl_slist *chunk = NULL;
chunk = curl_slist_append(chunk, "Accept:");
chunk = curl_slist_append(chunk, "X-Device-Key-0:eth0");
chunk = curl_slist_append(chunk, buf);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);