A lightweight and responsive WordPress plugin that provides a simple video player with support for WebM and MP4 formats. The plugin uses a shortcode system and includes a custom play button with smooth hover effects.
- Dual Format Support: Prioritizes WebM format but falls back to MP4 for broader compatibility
- Custom Play Button: Beautiful SVG play button with rounded triangle design and hover effects
- Responsive Design: Fully responsive and mobile-friendly
- HTML5 Video Attributes: Support for controls, loop, autoplay, muted, and other standard video attributes
- Centered Layout: Videos are centered within a full-width container by default
- Accessibility: Keyboard navigation and screen reader support
- Multiple Instances: Support for multiple video players on the same page
- Download or clone this repository
- Upload the
simple-video-playerfolder to your WordPress/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Start using the
[simple_video]shortcode in your posts and pages
[simple_video mp4="https://example.com/video.mp4"]
[simple_video webm="https://example.com/video.webm" mp4="https://example.com/video.mp4"]
[simple_video
webm="https://example.com/video.webm"
mp4="https://example.com/video.mp4"
controls="true"
loop="false"
autoplay="false"
muted="false"
poster="https://example.com/poster.jpg"
width="100%"
]
| Parameter | Default | Description |
|---|---|---|
webm |
(empty) | URL to WebM video file |
mp4 |
(empty) | URL to MP4 video file |
controls |
true |
Show/hide video controls |
loop |
false |
Enable/disable video looping |
autoplay |
false |
Enable/disable autoplay |
muted |
false |
Enable/disable muted playback |
poster |
(empty) | URL to poster image |
width |
100% |
Container width |
preload |
metadata |
Video preload behavior |
- Boolean parameters (
controls,loop,autoplay,muted): Use"true"or"false" - URLs (
webm,mp4,poster): Full URLs to media files - Width: CSS width values (e.g.,
"100%","800px","50vw") - Preload:
"none","metadata", or"auto"
[simple_video mp4="https://example.com/my-video.mp4"]
[simple_video
mp4="https://example.com/video.mp4"
poster="https://example.com/thumbnail.jpg"
]
[simple_video
mp4="https://example.com/background.mp4"
autoplay="true"
muted="true"
loop="true"
controls="false"
]
[simple_video
webm="https://example.com/video.webm"
mp4="https://example.com/video.mp4"
width="80%"
]
simple-video-player/
├── simple-video-player.php # Main plugin file
├── assets/
│ ├── simple-video-player.css # Styles
│ └── simple-video-player.js # JavaScript functionality
└── README.md
The plugin prioritizes video formats in this order:
- WebM - Modern, efficient format with good compression
- MP4 - Fallback format for broader browser compatibility
- WebM: Modern browsers (Chrome, Firefox, Edge, Safari 14.1+)
- MP4: All modern browsers and older versions
- Custom Play Button: All browsers with CSS3 support
- Desktop: Full-size play button (80px)
- Tablet (≤768px): Medium play button (60px)
- Mobile (≤480px): Small play button (50px)
You can override the default styles by adding custom CSS to your theme:
/* Custom play button color */
.simple-video-play-button {
background: rgba(255, 0, 0, 0.8) !important;
}
/* Custom container styling */
.simple-video-player-container {
max-width: 800px;
margin: 2rem auto;
}The plugin exposes global functions for advanced usage:
// Reinitialize all video players
SimpleVideoPlayer.init();
// Setup a specific player
SimpleVideoPlayer.setupPlayer($wrapper, $video, $playButton);- Check that video URLs are accessible
- Verify video formats are supported
- Check browser console for errors
- Ensure HTTPS is used for HTTPS sites
- Check that JavaScript is enabled
- Verify jQuery is loaded
- Check browser console for JavaScript errors
- Check for CSS conflicts with theme
- Verify plugin CSS is loading
- Use browser developer tools to inspect elements
- WordPress 4.0 or higher
- jQuery (included with WordPress)
- Modern browser with HTML5 video support
This plugin is licensed under the GPL v2 or later.
For support and feature requests, please create an issue in the repository or contact the plugin author.
- Initial release
- WebM and MP4 format support
- Custom play button with hover effects
- Responsive design
- Full shortcode parameter support
- Accessibility features