=== VMPlayer ===
Contributors: ganddser
Plugin URI: https://gandenterprisesinc.com/vmplayer
Donate link: https://paypal.me/gandinc
Tags: streaming, radio, shoutcast, icecast, hls, audio player, internet radio
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.5
Author URI: https://gandenterprisesinc.com
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

A modern streaming radio player for WordPress with Shoutcast, Icecast, HLS, and direct stream support.

== Description ==

VMPlayer is a feature-rich streaming radio player for WordPress. Configure up to 5 station presets, display live now-playing metadata with automatic artwork lookup across three global music databases, and let your visitors pop the player out into a separate window while they browse your site.

Key Features:

* Multi-protocol support for Shoutcast (v1 and v2), Icecast, HLS, and direct streams
* Up to 5 station presets in the free version
* Two player variants: full landscape (default) and compact two-row for tighter placements
* LIVE broadcast detection when a DJ goes on air through a console or encoder without metadata
* Live listener count display when your stream server reports it (per-station toggle)
* Auto-resume playback across page refreshes in the same tab session
* Optional per-station clock and date display in the player header
* Live track metadata with artwork lookup across iTunes, Deezer, and MusicBrainz
* iTunes storefront selector covers 50+ countries for regional artist matching
* Animated EQ visualizer
* Pop-out player window with compact bar mode and dock-back-to-main support
* Kebab menu with sharing, quality switching, player settings, and about
* Social media integration: Facebook, Bsky, Instagram, YouTube, WhatsApp, and X
* Station counter pill shows "N of M" when multiple stations are configured
* Adaptive layout using CSS container queries responds to available width, not just viewport
* Mobile responsive with automatic portrait layout on narrow containers
* Theme color customization
* Translation ready
* Built-in Help tab with setup guide, FAQ, and troubleshooting reference

Built with WordPress best practices: proper enqueuing, secure nonces, capability checks, and no inline assets.

== Important Notice ==

VMPlayer and its multi-station feature are intended for use by station operators broadcasting stations under their own ownership or licensed authority. This plugin is not intended for site owners to curate stations they have no connection to beyond being a fan or listener. Users are responsible for ensuring they have the legal right to stream any stations they add to the player. G & D Enterprises Inc. accepts no responsibility for any copyright, licensing, or broadcasting violations resulting from misuse of the plugin.

== Installation ==

1. Upload the vmplayer folder to /wp-content/plugins/ or install via the WordPress plugin uploader.
2. Activate the plugin through the Plugins menu in WordPress.
3. Navigate to Settings > VMPlayer to configure your first station.
4. Add the player to any page or post using the [vmplayer] shortcode.

== Frequently Asked Questions ==

= What streaming protocols are supported? =

VMPlayer supports Shoutcast v1 and v2, Icecast (all versions), HLS (HTTP Live Streaming), and direct audio streams in MP3, AAC, OGG, and Opus formats. Hosts that run on SonicPanel, Vouscast, Zeno, Live365, or Radio.co all sit on top of Shoutcast or Icecast underneath, so pick the underlying protocol when configuring the station.

= How many stations can I add? =

The free version supports up to 5 station presets. A premium version with unlimited presets and additional features is planned for a future release.

= Does the player work on mobile? =

Yes. The player uses CSS container queries so it responds to its container width, not just the viewport. On narrow containers it switches to a portrait layout that fits comfortably on phone screens.

= How does VMPlayer find song artwork? =

It checks four sources in priority order. The stream itself first (in case your automation software pushes artwork URLs through custom metadata fields), then iTunes Search API (strong indie coverage through aggregators), then Deezer (particularly strong reggae, Caribbean, Latin, and international catalog), then MusicBrainz for classical and older releases. If none has a match, the station logo shows instead.

= Can I use my local country's iTunes catalog? =

Yes. The General tab has an iTunes Storefront dropdown covering 50+ countries. Pick the region your listeners live in so local artists get matched faster during artwork lookups.

= What if my stream does not send CORS headers? =

That is fine for playback. VMPlayer plays the audio directly and runs the EQ visualizer in a CSS animation mode that does not require CORS. Real-time audio-reactive analysis is available as an opt-in for CORS-enabled streams.

== Screenshots ==

1. The main player displaying live now-playing metadata, EQ visualizer, station artwork, and format badges.
2. The pop-out player window in portrait layout with window chrome controls (dock, minimize, close).
3. Admin Settings > General tab showing theme colors, feature toggles, and artwork source configuration.
4. Admin Settings > Stations tab with drag-to-reorder station cards.
5. The kebab menu open showing Share, Switch Quality, Player Settings, and About sections.
6. Compact bar mode showing marquee title, play/pause, volume, and restore controls.

== Changelog ==

= 1.1.5 =
* Fix: Compact player variant now renders on sites where the page builder's WYSIWYG editor stored typographic quotes as HTML entities. 1.1.4 handled the raw-byte form of curly quotes but missed the entity form (like &amp;#8221;), so sites where the Text Editor widget encoded quotes on save still saw the compact shortcode disappear. This build decodes HTML entities before stripping curly quotes, so both storage formats are handled together.
* Fix: Volume slider now renders with its purple-to-blue gradient track on themes that style input[type="range"] with higher CSS specificity than a single-class selector. JNews was the reported case, but any theme that reaches into range inputs from a theme-wide input style could win the specificity race against the previous selector and render the track as a plain white bar. Selectors for the volume slider are now scoped under the player container class and marked !important on the properties themes are most likely to touch, so the styled gradient wins on those themes as well.
* Fix: Kebab menu text is now readable on every theme. The dropdown menu attaches to document.body outside the player container, which meant themes with dark body text (or themes that painted inputs with dark colors) could win the cascade and render menu items as black text on the dark navy background. Menu now carries hardcoded readable colors for text, headings, hover state, and the About section, with !important applied throughout to lock out theme interference.

= 1.1.4 =
* Fix: Compact player variant now renders reliably on sites built with page builders (Elementor, WPBakery, and other systems that texturize content). Some page builders were converting straight quotes in shortcode attributes to curly typographic quotes, which broke the variant="compact" attribute silently. The plugin now strips curly quotes defensively and registers the shortcode with the WordPress texturize skip list so the attribute value stays intact.
* New: Dedicated compact shortcode [vmplayer_compact] as a bulletproof alias for page builders that mangle shortcode attributes. Both [vmplayer variant="compact"] and [vmplayer_compact] produce the same output; the alias skips attribute parsing entirely for the most stubborn cases. Accepts an optional station attribute the same way the main shortcode does.
* New: Optional clock and date display per station. New Show Clock checkbox on each station card controls whether the clock appears in the top row of the main player and pop-out. Defaults to on so existing stations upgrading from 1.1.3 keep the header they had. The compact variant continues to not include a clock at all.

= 1.1.3 =
* New: Compact player variant available via [vmplayer variant="compact"]. A smaller two-row landscape layout sized for sidebars, footer strips, and other placements where the main player is too large.
* New: Listener count display. Enable per station on the Stations tab. When your stream server reports the current listener count, the player shows it in a small chip. Works with Shoutcast v1, Shoutcast v2, and Icecast. The display hides automatically when the server does not report a count.
* Improved: LIVE broadcast detection now catches the case where an encoder stops updating song metadata entirely. When the same song title has been reported for longer than a typical song, VMPlayer flags the source as live so listeners see LIVE instead of a stuck-forever old song.
* Fix: Song titles and station names containing ampersands or apostrophes now display correctly.
* Fix: MusicBrainz cover art loads faster and stalls far less often.
* Fix: Per-station display toggles now update correctly when switching between stations, and legacy stations that were saved with an older version get their toggle values normalized automatically on read so unchecking a toggle actually hides the feature.
* Fix: LIVE broadcast detection now re-evaluates on every metadata poll instead of freezing at the value cached during the first fetch, so toggling the setting or reaching the stale-title threshold takes effect immediately.
* Fix: Per-station display toggles now stay in sync when the browser restores a previously visited station on page load, closing a gap where the JS still applied the initial station's flags after localStorage restored a different station.

= 1.1.2 =
* Fix: Test Connection now handles streaming services that ignore Range headers.
* New: Live station sync between admin and frontend. When you add, delete, or reorder stations in the admin, any open frontend player in another tab picks up the change immediately through a BroadcastChannel message. No more refreshing the page to see new stations. Currently playing audio continues uninterrupted.
* New: Packaged default station logo. When you save a station without uploading a custom logo, VMPlayer now falls back to a branded default image instead of showing an empty spot or a generic SVG icon. The default lives at assets/images/default-station-logo.png and applies to both the artwork slot and the brand area.
* Major rewrite of the frontend player with a modern dark-neon design.
* New: iTunes and Deezer artwork lookup sources alongside MusicBrainz for wider indie and international catalog coverage.
* New: iTunes storefront selector (50+ countries) for regional artist matching.
* New: Pop-out player window with a portrait layout, full controls, compact bar mode with marquee title, and dock-back-to-main-player support.
* New: Kebab menu shared between main player and pop-out with Share, Switch Quality (when multiple mounts configured), Player Settings toggles, and About.
* New: YouTube and Bsky added to the social media platform list.
* New: Help tab in admin with setup walkthrough, FAQ, troubleshooting reference, and shortcode reference.
* New: Station counter pill displays "Station N of M" in the brand area when multiple stations are configured.
* New: CSS container queries make the player respond to its own available width instead of the viewport, so the layout adapts correctly inside Elementor sections, theme content columns, and sidebars.
* New: Frontend automatically falls back to the station logo when a remote artwork URL fails to load in the browser.
* New: Stream metadata is now checked for artwork first, before any external lookup source runs.
* Fix: Test Connection now works for streams behind reverse proxies (path-routed Shoutcast and Icecast). HEAD-first probe with GET+Range fallback plus ICY header detection.
* Fix: Web Audio API graph no longer causes silent audio on cross-origin streams without CORS headers.
* Fix: Previous and Next station buttons now disable automatically when only one station is configured.
* Fix: Social icons from one station no longer linger on another after cycling stations. All six platforms now render in the DOM with visibility controlled by the current station's configuration.
* Fix: SHOUTcast v2 stats XML now extracts SAMPLERATE and CHANNELS when the server exposes them. ICY headers fill in the gap for v1 SHOUTcast streams.
* Change: EQ visualizer runs in CSS animation mode by default. Real-time audio-reactive analysis is available as an opt-in flag for CORS-enabled streams.

= 1.0.1 =
* Fix: New station save incorrectly sent an existing-station update, triggering "Station not found at that index."
* Improvement: Admin assets now use filemtime-based versioning so browser cache clears itself whenever files change on disk.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.5 =
Follow-up fixes to the 1.1.4 page builder compatibility work. Handles the case where a WYSIWYG editor stored typographic quotes as HTML entities, the case where a theme's input[type="range"] style overrode the volume slider gradient, and the case where a theme's body text color made the kebab menu unreadable. Recommended if you saw the compact variant still failing after 1.1.4, the volume slider rendering as a plain white bar, or the kebab dropdown showing barely readable text.

= 1.1.4 =
Fixes the compact variant not rendering on sites with Elementor, WPBakery, or other page builders that texturize content. Also adds the dedicated [vmplayer_compact] shortcode alias and an optional per-station clock display toggle. Strongly recommended for anyone using the compact variant.

= 1.1.3 =
Adds a compact player variant for tighter placements, LIVE broadcast detection for stations with console or encoder-based live shows, an optional listener count display, and auto-resume across page refreshes so listeners only click play once per session. Also fixes character encoding on song titles and station names and speeds up MusicBrainz cover art. Recommended.

= 1.1.2 =
Major rewrite. Wider artwork coverage via iTunes and Deezer. Pop-out window, kebab menu, and Help tab added. Container queries for adaptive layout. Several audio and layout fixes. Recommended.

= 1.0.1 =
Bug fix for saving new stations. Recommended.
