diff options
| author | jade (winter) | 2026-07-20 13:35:01 +0100 |
|---|---|---|
| committer | jade (winter) | 2026-07-20 13:35:01 +0100 |
| commit | d5ea0f332bf8e5f0745e2c0e592ee895423a70ad (patch) | |
| tree | 1649ba6a70b64623b5b1692359b4a70cb89970f1 /lib/bbcnext.php | |
| parent | 5f301e85b24f3a219c3020a8e24113c31a2a1058 (diff) | |
add live playback support
Diffstat (limited to 'lib/bbcnext.php')
| -rw-r--r-- | lib/bbcnext.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/bbcnext.php b/lib/bbcnext.php index ed58a4f..f4ad4ec 100644 --- a/lib/bbcnext.php +++ b/lib/bbcnext.php @@ -3,8 +3,22 @@ require_once __DIR__ . '/rms.php'; require_once __DIR__ . '/mediaselector.php'; +const INCLUDE_RMS_DATA = false; + function next_renderFromRms(string $path) { - next_renderExperience(rms_fetch($path)->data); + $resp = rms_fetch($path); + try { + next_renderExperience($resp->data); + } catch (Exception|TypeError $e) { + echo '<exception>' + . htmlspecialchars($e->getMessage()) + . '</exception>'; + } + if (INCLUDE_RMS_DATA) { + echo '<details><summary>Raw data from RMS</summary><pre>'; + echo json_encode($resp, JSON_PRETTY_PRINT); + echo '</pre></details>'; + } } function next_renderExperience(array $modules) { @@ -38,6 +52,10 @@ function next_renderModule(stdClass $module) { $url = mediaselector_findHls($module->data[0]->id); echo '<audio controls hidden id="hls-player" data-hls="' . $url . '" />'; echo '<script src="static/hls-player.js" defer></script>'; + } elseif ($module->id == 'live_play_area') { + $url = mediaselector_findLiveHls($module->data[0]->service_id); + echo '<audio controls hidden id="hls-player" data-hls="' . $url . '" />'; + echo '<script src="static/hls-player.js" defer></script>'; } echo "</$type>"; } |
