From 5f301e85b24f3a219c3020a8e24113c31a2a1058 Mon Sep 17 00:00:00 2001 From: jade (winter) Date: Sun, 19 Jul 2026 17:51:11 +0100 Subject: fix so much stuff + add hls player --- lib/bbcnext.php | 183 ++++++++++++++++++++++++++------------------------ lib/mediaselector.php | 27 ++++++++ lib/rms.php | 2 +- 3 files changed, 123 insertions(+), 89 deletions(-) create mode 100644 lib/mediaselector.php (limited to 'lib') diff --git a/lib/bbcnext.php b/lib/bbcnext.php index 988d248..ed58a4f 100644 --- a/lib/bbcnext.php +++ b/lib/bbcnext.php @@ -1,109 +1,116 @@ data); + next_renderExperience(rms_fetch($path)->data); } function next_renderExperience(array $modules) { - foreach ($modules as $m) { - next_renderModule($m); - } + foreach ($modules as $m) { + next_renderModule($m); + } } function next_renderModule(stdClass $module) { - $type = strtr($module->type, '_', '-'); - $titleTag = $type == 'inline-header-module' ? 'h1' : 'h2'; - echo "<$type id=\"$module->id\" module-style=\"$module->style\">"; - echo "<$titleTag>" - . htmlspecialchars($module->title ?? '[no title]') - . ""; - if (isset($module->description)) { - echo '' - . htmlspecialchars($module->description) - . ''; - } - echo ''; - if (!is_array($module->data)) { - next_renderItem($module->data); - } else { - foreach ($module->data as $item) { - next_renderItem($item); - } - } - echo ""; + $type = strtr($module->type, '_', '-'); + $titleTag = $type == 'inline-header-module' ? 'h1' : 'h2'; + echo "<$type id=\"$module->id\" module-style=\"$module->style\">"; + echo "<$titleTag>" + . htmlspecialchars($module->title ?? '[no title]') + . ""; + if (isset($module->description)) { + echo '' + . htmlspecialchars($module->description) + . ''; + } + echo ''; + if (!is_array($module->data)) { + next_renderItem($module->data); + } else { + foreach ($module->data as $item) { + next_renderItem($item); + } + } + echo ""; + if ($module->id == 'aod_play_area') { + $url = mediaselector_findHls($module->data[0]->id); + echo '