📻 SDK shim & emulation layer for the PlayStation Portable’s Radio player API
A from-scratch implementation of the PSP Internet Radio player API, allowing the players to be used in a modern web browser.
The PSP, in firmware update 3.80, added support for Internet Radio players.
Sony provided a handful of players of their on, some of them mundane, and some of them quite novel. They generally tune to internet radio streams from Shoutcast or Icecast's registries.
The players actually run within the PSP's NetFront internet browser, but in a special mode where they're allowed to embed an application/x-psp-extplugin
object, which then provides DOM methods for interacting with a non-JavaScript radio player implementation.
This project constitutes a reimplementation of the application/x-psp-extplugin
's API in JavaScript, along with a wrapper for running and interacting with the radio players themselves. the ultimate shape of the wrapper is still to be determined, but whilst it is possible to run within a web browser, it imposes several limitations the original did not have.
The radio players, at this stage, must be patched to embed the project's shim code. This is less of a problem now that Sony's original catalogue is down (Internet Archive link for your convenience)!
From there, we attach ourselves to the document in a few ways;
application/x-psp-extplugin
plugin availableid
, but no name
, and copying the id
value to the name
so they become named properties of the document
objectpsp
variable, which tricks some of the PSP's players into not actually embedding their application/x-psp-extplugin
plugins, but just using that referenceThen, within the psp
object, we keep a bunch of state and audio objects, so that we can respond to the players' requests to open streams and fetch data over HTTP. We also proxt HTTP requests via a cors proxy, as the Shoutcast and Icecast lookup APIs would otherwise be inaccesible to the web browser.
Finally, because web browsers' audio players do not expose any script-side access to the icy
or other metadata from a Shoutcast stream, there is a method for polling a poorly-documented, and unfortunately poorly-supported metadata endpoint supported by some Shoutcast and Icecast servers.
fetch