Sell video courses with WooCommerce and a secure player
Sell the course as a WooCommerce product and play the videos only to people who bought it, inside their own account, with their name on the picture and no license code to type.
Coming soonA dedicated XAPlayer plugin for WooCommerce, which grants access automatically after each order and removes it on refund, is coming soon. Today, the ready-made code in the tutorial does the same job.
Why XAPlayer for WooCommerce
Buyers only
The page checks the customer bought the product before showing the player; everyone else sees a buy button.
No license codes
Customers sign in with their WooCommerce account and watch right there: no code, no app.
The customer’s name on the video
The billing name and phone move across the picture, so leaks are traceable.
Download protection
Videos play encrypted, so IDM and download extensions can’t save them.
Three steps to secure playback
- Create the course in your XAPlayer panel and set up your API key and domain.
- Add the tutorial’s ready-made code so the player only shows to buyers of the product.
- After buying, customers watch the course on your site.
Tutorials and docs
A taste of the code
The full code, where it goes and how to test it are in the tutorial.
$user = wp_get_current_user();
if ( wc_customer_bought_product( $user->user_email, $user->ID, PRODUCT_ID ) ) {
echo do_shortcode( '[xaplayer course="COURSE_ID"]' );
} else {
echo '<a href="' . get_permalink( PRODUCT_ID ) . '">Buy this course</a>';
}
Questions
Soon. Until then the tutorial’s code does the job: it shows the player only to customers who bought the product.
The purchase check covers every paid order, so earlier buyers get access straight away.
Once an order is refunded, WooCommerce no longer counts it as a purchase and the player stops showing for that customer.
Yes. Issue each buyer a license in the panel so they watch at en.xaplayer.ir/play; bulk issuing handles long lists.
Other platforms
Protect your course today
Signing up takes two minutes. 14 days free, with 10 licenses on us.
Start your 14-day free trial