Amiga-Z Wiki

“Modern tools for old-school communities.”

User Tools

Site Tools


projects:prevue:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
projects:prevue:start [2026/02/20 21:44] – removed - external edit (Unknown date) 127.0.0.1projects:prevue:start [2026/02/20 21:45] (current) – [Prevue Guide Channel] freedomotter
Line 1: Line 1:
 +====== Prevue Guide Channel ======
 +A “Prevue Guide Channel” style companion site for **AmigaZ Cablevision** — meant to run as a fun background TV feed.
  
 +It follows the same pattern as [[projects:community_bulletin_tv|Community Bulletin TV]]:
 +  * **Player page**: displays the guide + a video box that plays bumpers/trailers/ads
 +  * **Editor page**: uploads videos and edits the JSON config
 +  * **JSON driven**: channels + programming template + player behavior
 +
 +**Location / URL**
 +  * Folder: <code>/var/www/html/amigaz/prevue</code>
 +  * Player: <code>https://www.amigaz.org/prevue/player/</code>
 +  * Editor: <code>https://www.amigaz.org/prevue/editor/</code>
 +
 +**Related Pages**
 +   * [[projects:prevue:start:css|Prevue - CSS Notes]]
 +  * [[projects:prevue:start:editor|Prevue - Editor Roadmap]]
 +
 +----
 +
 +===== Features =====
 +
 +==== Player ====
 +  * Top-left: video playback slot
 +  * Between clips: optional **WeatherStar 4K+ cut-in** (iframe)
 +  * Top-right: “Now Playing” info + controls (mute/unmute/next)
 +  * Bottom: channel grid (currently placeholder blocks; will be made real from schedule template)
 +
 +==== Editor ====
 +  * Loads and saves <code>guide.json</code>
 +  * Uploads bumper/trailer/ad clips into the video folder
 +  * Lists available videos found on disk
 +
 +----
 +
 +===== Weather Integration (WS4K+) =====
 +Weather cut-ins use the WS4K+ permalink approach.
 +
 +Because the WS4K+ URL can be very long, we created a **short redirect** on the weather site:
 +
 +  * Short link: <code>https://weather.amigaz.org/p/prevue</code>
 +  * Redirects to the long WS4K+ permalink (includes <code>&kiosk=true</code>)
 +
 +**Nginx snippet (weather.amigaz.org)**
 +<code>
 +# Short link for Prevue (WS4K+ permalink redirect)
 +location = /p/prevue {
 +    return 302 "https://weather.amigaz.org/?(LONG_PERMALINK_HERE)&kiosk=true";
 +}
 +</code>
 +
 +Use <code>302</code> while tweaking, then optionally switch to <code>301</code> later.
 +
 +----
 +
 +===== Video Playback / Rotation =====
 +  * Videos can be uploaded via the editor OR dropped in manually.
 +  * Manual drop folder:
 +    <code>/var/www/html/amigaz/prevue/videos/bumpers/</code>
 +
 +The player pulls the video list from:
 +  * <code>/prevue/api/list_videos.php</code>
 +
 +Supported extensions currently include:
 +  * mp4, webm, ogg, mov, m4v
 +
 +(Recommendation: MP4 H.264 + AAC for maximum browser compatibility.)
 +
 +----
 +
 +===== JSON Config =====
 +Main config:
 +  * <code>/var/www/html/amigaz/prevue/data/guide.json</code>
 +
 +It contains:
 +  * Settings: timezone, grid window, grid step
 +  * Player behavior: fallback message, weather cut-in settings
 +  * Channels list
 +  * Template schedule blocks (recurring programming)
 +
 +Example settings:
 +<code>
 +"weatherCutIn": {
 +  "enabled": true,
 +  "url": "https://weather.amigaz.org/p/prevue",
 +  "durationSeconds": 15,
 +  "mode": "betweenVideos",
 +  "everyNClips": 5
 +}
 +</code>
 +
 +This allows **more space between weather** (example: show weather every 5 clips).
 +
 +----
 +
 +===== Nginx Notes (www.amigaz.org) =====
 +Key lesson learned: do NOT use <code>^~</code> on the <code>/prevue/</code> location if you want regex PHP blocks to work.
 +
 +Working pattern:
 +<code>
 +# PHP for /prevue/api/*.php
 +location ~ ^/prevue/api/.*\.php$ {
 +    client_max_body_size 250m;
 +
 +    include snippets/fastcgi-php.conf;
 +    fastcgi_pass unix:/run/php/php8.3-fpm.sock;
 +    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 +}
 +
 +# Prevue static
 +location /prevue/ {
 +    client_max_body_size 250m;
 +    index index.html;
 +    try_files $uri $uri/ =404;
 +}
 +</code>
 +
 +Upload sizing:
 +  * If you see <code>413 Request Entity Too Large</code>, increase:
 +    * nginx: <code>client_max_body_size</code>
 +    * PHP: <code>upload_max_filesize</code> and <code>post_max_size</code> in <code>/etc/php/8.3/fpm/php.ini</code>
 +
 +----
 +
 +===== TODO / Next Steps =====
 +  * Make the programming grid real (render actual blocks from <code>templateSchedule</code>)
 +  * Add editor UI for programming blocks (instead of editing raw JSON)
 +  * Add multi-folder rotation (trailers/ads/bumpers) and/or “recipe” based rotation
 +  * Optionally add XMLTV import later as an adapter
 +
 +----
 +
 +===== Files / Structure =====
 +<code>
 +/var/www/html/amigaz/prevue/
 +├─ player/
 +│  ├─ index.html
 +│  ├─ player.js
 +│  └─ player.css
 +├─ editor/
 +│  ├─ index.html
 +│  ├─ editor.js
 +│  └─ editor.css
 +├─ api/
 +│  ├─ guide_get.php
 +│  ├─ guide_save.php
 +│  ├─ list_videos.php
 +│  └─ upload_video.php
 +├─ data/
 +│  └─ guide.json
 +└─ videos/
 +   └─ bumpers/
 +</code>

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki