Configuring the Radioplayer web player

The Radioplayer web player is configured using a JSON object inside the HTML tag. In most cases these will be generated using the console generator. However some options can not be set using the generator, so if you need to set these, or if you need to use Radioplayer web player in a CMS, then you will need to manually set the configuration options.

Setting the configuration object

The options are passed in a special script tag inside the HTML tag:

<div data-widget-radioplayer>
    <script type="application/json">
        {
            "id": "1",
            "fallback": [
                {
                    "url": "http://example.com/STREAM;",
                    "format": "mp3"
                }
            ],
            "mapi": "https://mapi.radioplayer.co.uk/api/uk/",
            "cm": "https://cookie.radioplayer.co.uk/cm/",
            "np": "https://np.radioplayer.co.uk/qp/",
            "qp": "https://search.radioplayer.co.uk/qp/",
            "adProviders": [
                {
                    "domain": "demo",
                    "metadataUrl": "http://sdk.mobile.streaming.adswizz.com:8500/metadata",
                    "companionAdZoneId": "12009",
                    "fallbackAdZoneId": "12010",
                    "type": "adswizz"
                },
                {
                    "metadataUrl": "https://20213.live.streamtheworld.com/TRITONRADIOMUSIC_SBM",
                    "type": "triton"
                }
            ]
        }
    </script>
</div>

This script is not evaluated as JavaScript: it needs to be a well-formed JSON object. It is important to realise that the rules for JSON are stricter than for JavaScript objects, and if these are broken then the player will not display. Check that the keys are all quoted, and that the commas are all in the correct place.

A good starting point is to use the console generator to produce a standard console, and then adjust or add to the props as required.

Configuration options

See the API documentation for details of the configuration options.