Installation contract
Host the player page, the supplied loader and its companion assets, and your own moap.json. Register the page’s hostname in My Players. An external installation must point to the MEDIARAZZI player service. The engine, its templates, and the PHP delivery endpoints stay on MEDIARAZZI infrastructure.
<div id="moap-root"
data-config="./moap.json"
data-engine-host="https://mediarazzi.com/player/"
aria-label="Video player"></div>
<script src="./assets/moap-loader.js" defer></script>
Use one moap-root on the page with the current loader. The loader expects its companion assets/site.css relative to the page. A configuration file or generated JSON response can serve as data-config. Serve valid JSON, and keep the configuration on the page’s origin unless you’ve configured its host for cross-origin requests.
Configuration and playlist schema
{
"license": "MOAP-YOUR-KEY-HERE",
"updateChannel": "stable",
"advertising": true,
"analytics": true,
"startIndex": 0,
"autoplayNext": true,
"loopPlaylist": false,
"playlist": [
{
"videoId": "mediarazzi-demo",
"category": "trailers",
"title": "MEDIARAZZI Demo Video",
"src": "./media/demo.m3u8",
"poster": "./media/demo.jpg"
}
]
}
| Field | Behavior |
|---|---|
license | Required. Use the key for the installation, not a VAST tag or an account API key. |
playlist | Required nonempty array. Each item needs a playable MP4 or HLS src. title and poster are optional. Relative media URLs resolve against the player page. |
videoId, category | Optional item-level strings used for ad targeting. videoId also groups playback statistics. See the VAST and analytics reference. |
startIndex | Zero-based integer for the starting item. The first item is index 0. |
autoplayNext, loopPlaylist | Set autoplayNext: false to require Play on the next queued item. loopPlaylist: true returns to the first item after the last. Set autoplayNext: true explicitly if the loop should start playback, subject to browser autoplay behavior. |
updateChannel | Defaults to stable. Explicit beta uses beta if available, otherwise stable. Use stable on production pages. |
advertising, analytics | Set either field to false to disable that feature independently. Turning off analytics does not disable ads. |
Navigate a queue from your site
Once the engine has loaded, use window.MOAP. getQueue() returns items with index, title, and poster. currentIndex() returns the current index. playIndex(index), next(), and previous() select an item. Despite its name, playIndex() selects the item and shows its start screen. It does not start playback on its own.
Activation and updates
The loader requests a release, then loads the template, styles, and engine for that same version. Stable updates apply when the page loads again. Keep the distributed loader and assets up to date separately. The configuration key is used by the browser and is not a server-side secret. Do not place account credentials, private API keys, or privileged tokens in moap.json.
If an activation request returns 403, check that the registration is active, the full key is correct, and the actual player page hostname matches the registration. Avoid suppressing the browser’s origin or referrer on requests the player needs for activation. For HLS served from another origin, check that both manifests and segments are accessible to the player’s origin.
For the dashboard walkthrough, see Install and register MOAP.