diff --git a/README.md b/README.md index 8b00f44..0f7d518 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,8 @@ External URLs must use `http://` or `https://`. Uploaded files and remote URLs c When adding an external URL, the admin form can fetch title, description, duration, thumbnail metadata, and readable provider view counts through oEmbed, page metadata, and JSON-LD. The save action repeats the metadata lookup as a fallback, so blank titles can be filled from supported external pages even if the browser autofill was not used. +Descriptions support Markdown, sanitized HTML, and rich pasted HTML from provider pages such as YouTube. Public pages render formatting while catalogue cards and social metadata use safe plain-text excerpts. + If no thumbnail image is uploaded, the add/edit forms can auto-grab one from the first supported source. YouTube and Dailymotion use direct thumbnail URLs; Vimeo, Wistia, TikTok, SoundCloud, and Spotify use oEmbed when available. Local uploaded videos can generate a first-frame thumbnail when `ffmpeg` is installed on the server. Uploaded M4A files also use `ffmpeg` to create a black-frame H.264 MP4 playback source while keeping the original M4A source. ### Live Homepage Option diff --git a/admin/add.php b/admin/add.php index 4a39b31..1d27402 100644 --- a/admin/add.php +++ b/admin/add.php @@ -9,7 +9,7 @@ $msg = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $title = trim($_POST['title'] ?? ''); - $description = trim($_POST['description'] ?? ''); + $description = media_prepare_description_for_storage($_POST['description'] ?? ''); $duration = (int)($_POST['duration'] ?? 0); $sort_order = (int)($_POST['sort_order'] ?? 0); $published = isset($_POST['published']) ? 1 : 0; @@ -40,7 +40,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $metadata = media_external_metadata($url); $source_metadata[$url] = $metadata; if ($title === '' && $metadata['title'] !== '') $title = $metadata['title']; - if ($description === '' && $metadata['description'] !== '') $description = $metadata['description']; + if ($description === '' && $metadata['description'] !== '') { + $description = media_prepare_description_for_storage($metadata['description']); + } if ($duration <= 0 && (int)$metadata['duration'] > 0) $duration = (int)$metadata['duration']; if ((int)$metadata['view_count'] > $initial_external_view_count) { $initial_external_view_count = (int)$metadata['view_count']; @@ -291,8 +293,8 @@ render_head('Add Video — Admin', ' Leave blank when pasting a supported external URL, then use Fetch Info.
- - + +
@@ -401,6 +403,7 @@ render_head('Add Video — Admin', ' + +'; diff --git a/index.php b/index.php index 2c6e175..a765c13 100644 --- a/index.php +++ b/index.php @@ -68,7 +68,7 @@ if ($home_live_first) { } else { $share_title = $video ? $video['title'] . ' — ' . $site_title : 'Media — ' . $site_title; $share_description = $video && trim($video['description'] ?? '') !== '' - ? trim($video['description']) + ? media_description_plain_text($video['description']) : setting('site_sub', 'tyclifford.com / media'); $share_url = $video ? public_absolute_url(public_video_url($video['slug'])) : public_absolute_url(public_home_url()); $share_image = ($video && !empty($video['thumbnail'])) ? public_absolute_url(public_media_url($video['thumbnail'])) : ''; @@ -212,6 +212,10 @@ render_head($share_title, ' .home-mode-panel[hidden] { display:none; } .live-footer { justify-content:space-between; } .live-footer .stream-meta { max-width:60ch; line-height:1.5; letter-spacing:.06em; } + .stream-description { + flex:1 1 100%; max-width:min(72ch, 100%); + font-size:.8rem; + } /* ── Lower grid ── */ .lower-grid { display:grid; grid-template-columns:1fr; gap:1rem; } @@ -370,7 +374,7 @@ render_head($share_title, '