=== VidCellar Lite ===
Contributors: ssiddiqi4
Donate link: https://paypal.me/SSiddiqi275
Tags: video player, video streaming, subtitles, hls, chapters
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A free WordPress video library with secure local playback, categories, ratings, thumbnails, and resumable large-file uploads.

== Description ==

VidCellar Lite is a standalone GPLv2-or-later WordPress plugin for managing and playing videos on your own WordPress site. It does not require an external account or a license key. It is suitable for hosting online streaming libraries, film and music festival videos, webinars, training, and enterprise videos.

Start with VidCellar Lite, a free core video platform for managing and streaming videos from your WordPress website. An [optional Pro](https://canvasly.pro/vidcellar) add-on is available separately for advanced monetization, cloud storage, paid-content access, analytics, advertisement insertion, and other premium features.

Unlock full potential of video streaming with [VidCellar Pro](https://canvasly.pro/vidcellar)

Features include:

* White-label HTML5 player (no third-party branding): custom colours, your own logo/watermark, and a choice of which controls appear.
* Chapters with timeline markers and hover titles (WebVTT file, timestamp list, or timestamps in the description).
* Multi-language WebVTT subtitles and alternate audio languages.
* Searchable, synchronised transcript (below or beside the video).
* Playback speeds 0.25× to 2×, HLS quality selector (Auto/1080p/720p/…), Picture-in-Picture, theater mode and fullscreen.
* Sticky mini-player that docks to a screen corner on scroll, with mobile options.
* Video library and Watch pages.
* Administrator-managed video categories.
* Secure local video storage and playback.
* Resumable/chunked uploads for large video files, subject to server resources and hosting limits.
* Video file type and MIME validation.
* Video thumbnails and optional trailers.
* Ratings and view counts.
* Background video optimization when FFmpeg is available on the server.
* Adaptive bitrate streaming (HLS): each upload is encoded into 1080p/720p/480p/360p renditions in the background, and the player switches quality automatically to match the viewer's connection. Native HLS on Safari/iOS, bundled hls.js elsewhere, MP4 fallback everywhere.
* Fast, lightweight player: a poster-and-play-button "facade" loads no video element and no player library until the visitor presses play, which keeps pages fast and Core Web Vitals healthy.
* "VidCellar Video" block and `[vidcellar_player id="…"]` shortcode to embed a single video anywhere.
* Responsive HTML5 video playback.
* WordPress-native administration, permissions, nonces, and REST APIs.
* Optional deletion of plugin data during uninstall; data is retained by default.

VidCellar Lite is fully usable on its own. Paid monetization, payment gateways, coupons, advertising controls, commercial storage integrations, and advanced revenue features are provided separately by an optional [Pro add-on](https://canvasly.pro/vidcellar).

== Installation ==

1. In WordPress, go to **Plugins > Add New Plugin > Upload Plugin**.
2. Upload the VidCellar Lite ZIP and activate the plugin.
3. Open **VidCellar > Videos** to add videos.
4. Use the automatically created Videos and Watch pages, or place `[vidcellar_browse]` and `[vidcellar_video]` shortcode on your own pages. To embed one video in any post, use the **VidCellar Video** block or `[vidcellar_player id="12"]`.
5. Configure your video categories under **VidCellar > Categories**.

== Frequently Asked Questions ==

= Is VidCellar Lite free? =

Yes. VidCellar Lite is a standalone GPLv2-or-later plugin and does not require a license key or an external account.

= Can I upload large videos? =

Yes. The built-in resumable uploader supports files up to 30 GiB, subject to available disk space, PHP/web-server configuration, request limits, and hosting resources.

= Does Lite process payments? =

No. Payment and monetization features are not included in Lite. They are available separately in an optional [Pro add-on](https://canvasly.pro/vidcellar).

= Where are videos stored? =

Lite stores uploaded videos in protected local storage under the WordPress uploads directory. The plugin creates protection rules for supported web-server configurations. Site administrators using Nginx or another web server should also configure server-level protection as appropriate for their hosting environment.

= Does VidCellar Lite send my video data to an external service? =

No. Lite does not require an external video service and does not send video files to a remote video server. Video data and plugin records remain on the WordPress installation unless the site administrator separately configures another service.

= What does adaptive streaming need on my server? =

Local HLS encoding needs FFmpeg and ffprobe installed on the server, PHP's `proc_open()` enabled, and a Linux/macOS host. VidCellar shows a checklist under **VidCellar > Settings**. Without these, videos still play as MP4. Encoding runs in the background, one rendition at a time; on low-traffic sites, a real server cron job (instead of WP-Cron) makes jobs progress faster. Action Scheduler is used automatically when another plugin (for example WooCommerce) provides it.

= Are HLS segments protected? =

Yes. Playlists and segments are stored in the same protected folder as the videos and are served through WordPress with short-lived signed URLs.

= How do I change the Watch-page heading? =

Edit the WordPress Page that contains `[vidcellar_video]` shortcode. The Page title is used as the Watch-page heading.

= What happens if I deactivate the plugin? =

Deactivation does not delete the plugin database tables or video files. Data is retained so the plugin can be reactivated safely.

= What happens if I uninstall the plugin? =

By default, VidCellar Lite retains its database tables and uploaded video files. An administrator can explicitly enable the plugin's delete-data-on-uninstall setting before uninstalling if permanent removal is desired.

== Privacy ==

VidCellar Lite does not require registration with an external video service and does not send video files to a remote video server. The plugin stores its video metadata and locally uploaded video files on the WordPress site. Site administrators are responsible for configuring their site's privacy policy and for describing any other services, analytics, storage providers, or media services they independently configure.

== Upgrade to Pro ==

An [optional Pro](https://canvasly.pro/vidcellar) add-on is a separate premium product that is not included in this WordPress.org plugin. The Lite plugin remains fully usable without Pro. Optional Pro information and purchase links are shown only inside the WordPress administration area.

== Screenshots ==

1. Video library.
2. Video management screen.
3. Video categories.
4. Video upload interface.
5. Watch page and JS unbranded player video player.
6. CidCellar Captions & Chapters
6. Player appearance

== Third-party libraries ==

VidCellar Lite bundles [hls.js](https://github.com/video-dev/hls.js) 1.7.3 (`assets/vendor/hls/hls.light.min.js`), licensed under the Apache License 2.0 (`assets/vendor/hls/LICENSE.txt`). The human-readable source is available at https://github.com/video-dev/hls.js/tree/v1.7.3. It is loaded only when a visitor presses play on a browser without native HLS support.

== Upgrade Notice ==

= 2.0.0 =
New white-label player with chapters, multi-language subtitles and audio, searchable transcripts, quality/speed menus, theater mode and a sticky mini-player. Configure it under VidCellar → Player and VidCellar → Captions & Chapters. Update VidCellar Pro to 2.0 at the same time.

= 1.2.1 =
Adds hooks needed by VidCellar Pro 1.2 cloud storage offload. Safe to update.

= 1.2.0 =
Adds adaptive bitrate (HLS) streaming and a lightweight click-to-load player. Existing videos keep playing as MP4; use "Build adaptive (HLS)" on the Videos screen to convert them.

= 1.1.9 =
Fixes video uploads (every chunk was rejected), a fatal error on the Videos page, and category names turning into slugs.

= 1.1.8 =
Enqueues the dashboard pricing stylesheet with wp_enqueue_style() instead of printing a style tag.

= 1.1.7 =
When Pro is active, Lite no longer adds a second Settings menu item.

= 1.1.6 =
Moves the Pro plans and Lite vs Pro comparison to the Dashboard.

= 1.1.5 =
Restores the Lite vs Pro comparison table on Videos and Need Help.

= 1.1.4 =
Shows the optional Pro licensing pricing table on the Videos screen.

= 1.1.3 =
Removes the duplicate VidCellar admin submenu so Videos is the first item.

= 1.1.2 =
WordPress.org review fixes: distinctive plugin name/slug, enqueued admin JavaScript, and reviews table schema compatibility.

== Changelog ==

= 2.0.0 =
* New: white-label HTML5 player built in dependency-free JavaScript (assets/js/player/src, bundled to assets/js/vidcellar-player.js). Native browser controls, remote-playback and download chrome are suppressed.
* New: VidCellar → Player settings page — primary/accent/control-bar/menu colours, bar opacity, corner radius, logo watermark (position, size, opacity, link), visible-control toggles, speed presets and default speed, keyboard shortcuts, caption size, transcript layout, and mini-player options. Live preview.
* New: VidCellar → Captions & Chapters — per-video WebVTT subtitles in several languages (default track, subtitles or SDH captions), alternate audio files with an "original soundtrack" name, and chapters from a WebVTT file, a timestamp list or the video description.
* New: chapter markers on the timeline (click to jump), chapter title in the hover tooltip and next to the time, chapter menu.
* New: settings menu with Chapters, Subtitles/CC, Audio, Playback speed (0.25×–2×) and Quality (Auto + each HLS rendition via hls.js; Safari keeps OS-managed Auto).
* New: audio language switching — HLS alternate audio (hls.js and native audioTracks) or synced audio files.
* New: protected audio languages. Saving an audio language moves the file out of the Media Library into private storage (vidcellar-private/videos/audio/) and removes the attachment, so there is no public link. Viewers get expiring, HMAC-signed links (?vc_audio=…) that are access-checked on every request (filter vidcellar_audio_access; VidCellar Pro limits them to buyers). The player refreshes a link that expires mid-session. Removing or replacing a language deletes its file; deleting a video deletes its audio folder.
* Note for nginx hosts: like your videos, the private folder relies on .htaccess on Apache. On nginx add a rule denying /wp-content/uploads/vidcellar-private/ (file names are also randomised).
* New: searchable transcript built from the subtitles: highlights the current line, follows playback inside the panel, click a line to jump (also before the player is started), accent-insensitive search with match navigation, follows the selected subtitle language.
* New: sticky mini-player using IntersectionObserver (same video element, no re-buffering), corner/size/offset settings, play/pause, back-to-video and close buttons, full-width bar or off on small screens.
* New: Picture-in-Picture and theater (full-width) mode; one player plays at a time.
* New: shortcode attributes sticky="yes|no" and transcript="yes|no|open"; matching block options.
* New: filters vidcellar_player_config and vidcellar_player_tracks; JS API window.VidCellarPlayer and vidcellar:ready / vidcellar:theater / vidcellar:dock events.
* Changed: trailers use the same custom player (MP4 only, no docking).
* Changed: frontend.js now only handles ratings and pre-2.0 server-rendered players; the facade/HLS code moved into the player bundle (same lazy-loading behaviour: one poster image until the first click).
* Database: adds a player_tracks column to the videos table (added automatically on update).

= 1.2.1 =
* Developer hooks for storage add-ons (used by VidCellar Pro 1.2 cloud offload): `vidcellar_hls_segment_url`, `vidcellar_ensure_local_source`, `vidcellar_abr_purged`, `vidcellar_video_deleted`, `vidcellar_admin_video_status`. No behaviour change on their own.

= 1.2.0 =
* New: Adaptive bitrate streaming (HLS). Uploads are encoded into a 1080p/720p/480p/360p ladder (never upscaled; portrait videos handled) with aligned keyframes and fMP4 segments. Renditions are encoded one at a time as detached FFmpeg jobs, so PHP time and memory limits do not apply; stalled or killed jobs are detected and retried, and the master playlist is published only when encoding finishes.
* New: Signed, expiring segment URLs for HLS playback from protected storage, with range support.
* New: Facade player. The Watch page, trailer, block and shortcode render a poster and play button only; the video element and hls.js are created on click. Posters below the fold load via IntersectionObserver, and the first player's poster is prioritised for LCP.
* New: "VidCellar Video" block and `[vidcellar_player]` shortcode.
* New: Adaptive streaming settings (renditions, auto-build, cloud transcoding webhook) and HLS status/progress on the Videos screen.
* New: Developer hooks: `vidcellar_abr_dispatch`, `vidcellar_hls_access`, `vidcellar_remote_manifest_url`, `vidcellar_hls_token_ttl`, `vidcellar_abr_ladder_definitions`, `vidcellar_abr_max_concurrent_jobs`, `vidcellar_abr_ready`.
* Improved: Front-end script loads deferred; catalog thumbnails lazy-load with reserved dimensions.
* Deleting a video now also removes its generated HLS renditions (the original upload is still kept).

= 1.1.9 =
* Fixed resumable uploads rejecting every raw chunk with "No valid upload chunk was received." (an operator-precedence bug in the upload error check).
* Fixed a JavaScript error when resuming an upload whose chunks had all already reached the server.
* Fixed a fatal error on the Videos page: the [vidcellar_browse] shortcode callback rejected the attributes WordPress passes.
* Category names such as "Short Films" are no longer replaced by their slug once a video uses them, the active category tab is highlighted again, and video edit forms preselect the right category.
* The Watch page shows the average rating once instead of twice, and updates it after a visitor rates.

= 1.1.8 =
* Enqueued the dashboard pricing stylesheet with wp_enqueue_style() instead of printing a style tag.

= 1.1.7 =
* Stops registering a Lite Settings submenu when VidCellar Pro is active, so Settings is not duplicated.

= 1.1.6 =
* Moved the Pro plans and Lite vs Pro comparison table from Videos to Dashboard.

= 1.1.5 =
* Restored the VidCellar Lite vs Pro comparison table on Videos (above Add a video) and Need Help.

= 1.1.4 =
* Added the optional Pro licensing pricing table to the Videos screen, above Add a video.

= 1.1.3 =
* Removed the duplicate first admin submenu titled VidCellar. The first submenu is now Videos.

= 1.1.2 =
* Updated the public plugin name, slug, author, and text domain to VidCellar Lite.
* Enqueued admin video-management JavaScript instead of printing an inline script tag.
* Added the missing reviewer_key column to the reviews table on activation and upgrade.
* Loaded public CSS/JS only on pages that use the plugin shortcodes.

= 1.1.1 =
* Resolved Plugin Check short PHP echo-tag errors by using full PHP echo syntax throughout the plugin.
* Hardened public query-string handling with unslashing, sanitization, validation, and context-appropriate nonce exceptions for public browsing/streaming URLs.
* Hardened admin POST and upload handling, including centralized request/file access helpers and MIME validation.
* Escaped generated HTML attributes and content, including rating controls and shortcode-generated markup.
* Updated custom-table SQL to use prepared statements and WordPress identifier placeholders where supported.
* Replaced avoidable direct file deletion/move operations with WordPress filesystem APIs and documented narrowly-scoped native stream/process operations that are required for chunked uploads, video range streaming, and optional FFmpeg transcoding.
* Improved CSV export implementation without direct fopen/fclose calls.
* Raised the minimum supported WordPress version to 6.2 for `%i` database identifier placeholders.

= 1.1.0 =
* Prepared the Lite release for WordPress.org distribution.
* Updated the plugin and stable tag to 1.1.0.
* Improved the Watch-page heading resolution so the WordPress Page title is used reliably.
* Retained existing database compatibility and migration safeguards.
* Refined installation, privacy, data-retention, and Pro separation documentation.

= 1.0.9 =
* Improved Watch-page heading resolution across normal WordPress queries, request URLs, page-builder contexts, and the configured Watch page.
* No database changes required.

= 1.0.8 =
* Improved Watch-page title handling and page-title resolution.

= 1.0.7 =
* Improved Watch-page title handling.

= 1.0.6 =
* Added editable Watch-page heading support based on the WordPress Page title.

= 1.0.5 =
* Improved Lite administration and compatibility handling.

= 1.0.2 =
* Fixed Lite video helper loading for Pro shortcodes.
* Added defensive compatibility fallback for category normalization.
* Improved activation compatibility with existing databases.

= 1.0.1 =
* Fixed Lite/Pro activation schema compatibility and legacy helper loading.
* Added safeguards against duplicate function declarations.
* Improved migration safety for existing installations.

= 1.0.0 =
* First Lite release.
* Free video library and secure local playback.
* Categories, ratings, thumbnails, trailers, and view counts.
* Resumable large-file uploads with validation.
* WordPress-native security controls and GPLv2-or-later licensing.

== License ==

VidCellar Lite is licensed under the GNU General Public License, version 2 or later.

https://www.gnu.org/licenses/gpl-2.0.html
