From a3aa51c4e218bd1f8276cde33d8f4e19dfa0648a Mon Sep 17 00:00:00 2001 From: Ty Clifford Date: Thu, 25 Jun 2026 07:38:19 -0400 Subject: [PATCH] =?UTF-8?q?-=20Live=20homepage:=20Added=20default=20Live?= =?UTF-8?q?=20settings=20in=20[includes/db.php](/Users/tyemeclifford/Docum?= =?UTF-8?q?ents/GH/mediaplayer/includes/db.php)=20using=20https://stream.p?= =?UTF-8?q?lace/embed/tyclifford.com.=20Added=20Admin=20=E2=86=92=20Settin?= =?UTF-8?q?gs=20=E2=86=92=20Live=20Section=20controls=20in=20[admin/settin?= =?UTF-8?q?gs.php](/Users/tyemeclifford/Documents/GH/mediaplayer/admin/set?= =?UTF-8?q?tings.php):=20enable/disable,=20live=20title,=20and=20embed=20U?= =?UTF-8?q?RL/iframe=20input.=20Added=20a=20homepage=20Videos=20/=20Live?= =?UTF-8?q?=20toggle=20in=20[index.php](/Users/tyemeclifford/Documents/GH/?= =?UTF-8?q?mediaplayer/index.php).=20Videos=20remains=20the=20default=20vi?= =?UTF-8?q?ew,=20so=20the=20homepage=20behaves=20normally=20until=20Live?= =?UTF-8?q?=20is=20selected.=20Imgur:=20Added=20Imgur=20URL=20normalizatio?= =?UTF-8?q?n,=20embed=20support,=20oEmbed/thumbnail=20hooks,=20and=20exter?= =?UTF-8?q?nal=20view=20count=20scraping=20support=20in=20[includes/db.php?= =?UTF-8?q?](/Users/tyemeclifford/Documents/GH/mediaplayer/includes/db.php?= =?UTF-8?q?).=20Supports=20imgur.com,=20albums/galleries,=20and=20direct?= =?UTF-8?q?=20i.imgur.com=20photos/GIFs/videos=20by=20routing=20them=20thr?= =?UTF-8?q?ough=20Imgur=20embeds.=20Imgur=20external=20views=20now=20flow?= =?UTF-8?q?=20into=20external=5Fview=5Fcount,=20so=20per-item=20and=20over?= =?UTF-8?q?all=20site=20totals=20include=20readable=20Imgur=20provider=20c?= =?UTF-8?q?ounts.=20Updated=20the=20add-video=20hint=20and=20README=20docs?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 +++-- admin/add.php | 2 +- admin/settings.php | 30 ++++++++++++++++ includes/db.php | 90 ++++++++++++++++++++++++++++++++++++++++++++++ index.php | 61 ++++++++++++++++++++++++++++++- 5 files changed, 187 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 33960d0..721530c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ A self-hosted multimedia player website built with PHP + SQLite + Video.js. Styled to match the existing `gate.php` / `index.php` dark theme exactly. - --- @@ -78,12 +77,16 @@ Styled to match the existing `gate.php` / `index.php` dark theme exactly. 6. Set quality labels (1080p, 720p, 480p, etc.) 7. Save — Video.js will use the stored source location and auto-select the best format the browser supports -External URLs must use `http://` or `https://`. Uploaded files and remote URLs can be mixed on the same video. Recognized provider URLs such as YouTube, Vimeo, Dailymotion, Twitch, Facebook, TikTok, Instagram, X/Twitter, SoundCloud, Spotify, Google Drive, Wistia, Streamable, and Loom render through their embed players. +External URLs must use `http://` or `https://`. Uploaded files and remote URLs can be mixed on the same video. Recognized provider URLs such as YouTube, Vimeo, Dailymotion, Imgur, Twitch, Facebook, TikTok, Instagram, X/Twitter, SoundCloud, Spotify, Google Drive, Wistia, Streamable, and Loom render through their embed players. 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. 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. +### Live Homepage Option + +The homepage can show a **Videos / Live** switch above the main player. Configure it in **Admin → Settings → Live Section** with either a direct embeddable URL or an iframe snippet. The default live embed is `https://stream.place/embed/tyclifford.com`. Disable the setting to return the homepage to the normal video-only layout. + ### Importing YouTube Channels Use **Admin → YouTube Importer** to paste a YouTube channel URL, `@handle`, or `UC...` channel ID. The importer scrapes the channel's `/videos` page, extracts video data from `ytInitialData`, previews the results, and imports selected videos as remote YouTube embed sources. Duplicate YouTube watch URLs are skipped. @@ -100,7 +103,7 @@ The public display is configurable in **Admin → Settings → Public Display**: - show or hide the total public view count - show or hide public page statistics on the homepage and catalogue -The admin dashboard also includes **Upkeeping → Correct external view counts**. It checks existing remote-source videos in batches, scrapes readable provider counts when available, and adds those provider totals to the media-site totals without double-counting local plays. YouTube has dedicated parsing, and generic metadata patterns cover readable Vimeo, Dailymotion, and similar provider pages when they expose counts. Unsupported providers and local-only uploads can still be corrected manually on the edit screen. +The admin dashboard also includes **Upkeeping → Correct external view counts**. It checks existing remote-source videos in batches, scrapes readable provider counts when available, and adds those provider totals to the media-site totals without double-counting local plays. YouTube and Imgur have dedicated handling, and generic metadata patterns cover readable Vimeo, Dailymotion, and similar provider pages when they expose counts. Unsupported providers and local-only uploads can still be corrected manually on the edit screen. ### Public Search diff --git a/admin/add.php b/admin/add.php index 24aed78..d69de1c 100644 --- a/admin/add.php +++ b/admin/add.php @@ -308,7 +308,7 @@ render_head('Add Video — Admin', '

Video Sources

- Upload a video file, link a direct media file, or paste a provider page URL such as YouTube or Vimeo. The player will use a provider embed when the URL supports it. + Upload a video file, link a direct media file, or paste a provider page URL such as YouTube, Vimeo, or Imgur. The player will use a provider embed when the URL supports it. Uploaded files: MP4, WebM, OGV, MOV, MKV, AVI. Remote URLs must use http:// or https://.

diff --git a/admin/settings.php b/admin/settings.php index d35e903..87fdeb9 100644 --- a/admin/settings.php +++ b/admin/settings.php @@ -17,6 +17,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $show_video_views = isset($_POST['public_show_video_views']) ? '1' : '0'; $show_total_views = isset($_POST['public_show_total_views']) ? '1' : '0'; $show_page_stats = isset($_POST['public_show_page_stats']) ? '1' : '0'; + $live_enabled = isset($_POST['live_enabled']) ? '1' : '0'; + $live_title = trim($_POST['live_title'] ?? 'Ty Clifford live stream'); + $live_embed = trim($_POST['live_embed'] ?? ''); set_setting('catalogue_per_page', (string)$per_page); set_setting('site_title', $site_title); @@ -25,6 +28,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { set_setting('public_show_video_views', $show_video_views); set_setting('public_show_total_views', $show_total_views); set_setting('public_show_page_stats', $show_page_stats); + set_setting('live_enabled', $live_enabled); + set_setting('live_title', $live_title); + set_setting('live_embed', $live_embed); $msg = 'Settings saved.'; } @@ -53,6 +59,9 @@ $url_rewrite_mode = url_rewrite_mode(); $public_show_video_views = setting_bool('public_show_video_views', true); $public_show_total_views = setting_bool('public_show_total_views', true); $public_show_page_stats = setting_bool('public_show_page_stats', true); +$live_setting_enabled = setting_bool('live_enabled', true); +$live_title = setting('live_title', 'Ty Clifford live stream'); +$live_embed = setting('live_embed', 'https://stream.place/embed/tyclifford.com'); // DB stats $db = get_db(); @@ -220,6 +229,27 @@ render_head('Settings — Admin', '
+

Live Section

+
+ +
+
+
+ + +
+
+ + + Paste an iframe embed code or a direct embeddable URL. Default: https://stream.place/embed/tyclifford.com +
+
+ + + + + + -
+