=== MihanWP WooCommerce Product Video ===
Contributors: mihanwp
Tags: woocommerce, product video, product gallery, video gallery, lightbox
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add videos to the WooCommerce product gallery, opened in the gallery lightbox and played by the browser's native video player.

== Description ==

* Select one or more videos from the media library on the product edit screen ("Product gallery videos" box).
* Videos become slides of the product gallery, with their own thumbnails marked by a play icon.
* Clicking a video (or the zoom icon while it is the active slide) opens it in the WooCommerce gallery lightbox (PhotoSwipe), next to the product images, with native browser controls.
* The playing video is paused when the visitor moves to another slide or closes the lightbox.
* Poster image per video: choose one, reuse the video's featured image, or capture a frame of the video in the browser (done automatically when a video is added).
* Show videos right after the main image or at the end of the gallery, and reorder them by drag and drop.
* When the theme disables the WooCommerce lightbox, a built-in lightbox is used instead.
* Translation ready; Persian (fa_IR) included.

Works with the classic WooCommerce product gallery (FlexSlider + PhotoSwipe), which classic themes and the "Product Image Gallery" block use. Themes that replace the gallery with their own slider are not supported.

= Developer hooks =

* `mwpv_gallery_video_html` (filter) – HTML of a video slide. Arguments: `$html`, `$video` (`id`, `poster`).
* `mwpv_lightbox_autoplay` (filter) – start playback when a video is opened in the lightbox. Default `true`.

Product meta: `_mwpv_videos` (array of `id`/`poster` attachment IDs) and `_mwpv_position` (`after_main` or `end`).

== Installation ==

1. Upload the `mihanwp-woocommerce-product-video` folder to `/wp-content/plugins/`.
2. Activate the plugin. WooCommerce must be active.
3. Edit a product and use the "Product gallery videos" box below "Product gallery".

== Frequently Asked Questions ==

= Which video formats are supported? =

Whatever the visitor's browser can play natively. MP4 (H.264/AAC) plays everywhere; WebM is a good second choice.

= "Capture frame" says it could not capture a frame. =

The browser could not decode the video, or the file is served from another domain without CORS headers. Choose a poster image instead.

== Privacy ==

Once a day, and when the plugin is activated, updated or deactivated, it sends technical data to mihanwp.com: the site address, WordPress and PHP versions, site language, the folder names of active plugins and this plugin's version. On deactivation it asks for an optional reason. No personal data is sent. To turn this off, add to your theme or a small plugin:

`add_filter( 'mihanwp_radar_enabled', '__return_false' );`

== Changelog ==

= 1.0.2 =
* Reports technical data to mihanwp.com once a day (see Privacy) and asks for an optional reason on deactivation.

= 1.0.1 =
* Updates from mihanwp.com in the WordPress updates screen.

= 1.0.0 =
* First release.
