<p>Just recently worked a similar project so I'll share what we've uncovered.</p>

<p>Your needs are basically 2-fold: take payment and provide a platform where people can log into and consume content.</p>

<blockquote>
  <p><strong>Is this possible with CraftCMS or would it need Commerce</strong>?</p>
</blockquote>

<p>Craft has you covered on content, however taking payment is where having Commerce built-in can be beneficial. </p>

<p>If you're able to build the billing component yourself, you don't need Commerce, however having it built-in, can save a lot of development time and having it integrated in the same system makes sense, especially if someone might have access to tiers of content (this class goes here, this one is not included, etc.) Using Craft's user groups can be pretty beneficial here. </p>

<blockquote>
  <p><strong>We're thinking the Stripe payment plugin - any advice/alternatives?</strong></p>
</blockquote>

<p>Does your client already have other systems where their customers already "subscribe" (eg MindBody, ZenPlanner, Pike13, etc)? </p>

<p>If that's the case, you could interface the two. Upon login (or periodically via cron) ping the 3rd party billing system and see if there's an active subscription. If there is, let them continue; if not, throw up an error message.
If you're going to offer subscriptions, Stripe is currently the only first-party gateway to do so. Payment Gateways are definitely a weak spot for Commerce at the moment. </p>

<p>A lot of offline business will have their own merchant accounts so using a gateway like Authorize.Net is pretty common, however the 3rd party plugin doesn't support subscriptions yet.</p>

<p>As an aside, payment processors hate risk. And the risk becomes higher with digital products, subscriptions, etc. Payment gateways like Stripe are notorious for withholding funds especially if your client scales too quickly, too fast.</p>

<p>When it comes to recurring billing and high ticket amounts, these are payment processor red flags. Having a solid payment processor history is helpful when it comes to disputes and chargebacks. It's a huge bummer to have a client have a super successful launch and then they get an email from their processor saying their account is on hold or that they're withholding funds for 2 weeks. Having a "backup" option of taking payment even if it's manual can be helpful.</p>

<blockquote>
  <p><strong>Can we stream off S3 or is it better to use Vimeo CDN, is there a plugin to assist?</strong></p>
</blockquote>

<p>Unless you like giving more money to Bezos than necessary, bandwidth on S3 is expensive. And it doesn't really handle video all that well IMO. If someone is on a smartphone with a mediocre internet connection, you don't want to send them down 4K video when medium quality SD or HD would suffice.  </p>

<p>Vimeo and Wistia are better options in this respect. These services can tailor the streaming experience and you can easily lock down content. Wistia excels when it comes to more analytics (who watched what, how long and more). Their <a href="https://wistia.com/support/developers/data-api" rel="noreferrer">API</a> is pretty easy to work with as well.</p>

<blockquote>
  <p><strong>How to ensure videos are only available to logged in users?</strong></p>
</blockquote>

<p>Both <a href="https://wistia.com/support/embed-and-share/sharing-videos" rel="noreferrer">Wistia</a> and <a href="https://vimeo.com/blog/post/video-privacy-explained/" rel="noreferrer">Vimeo</a> have options to embed only on domains but unlike YouTube and Vimeo, Wistia doesn't let Google index its content by default so it makes it a slightly better choice.</p>

<p>Unlike YouTube where there's not really a good way to prevent users from going back to watch the video on the site (where users can then go and bookmark it), you can customize the player and branding so it's really "embedded" on the site.</p>

<blockquote>
  <p><strong>What happens when somebody unsubscribes - how do we automatically remove/pause their access?</strong></p>
</blockquote>

<p>On every page load of a restricted page, typically you want to <code>{% requireLogin %}</code> and then check to see if the user has an active subscription.</p>

<p>The <a href="https://docs.craftcms.com/commerce/v3/dev/element-queries/subscription-queries.html#example" rel="noreferrer">Commerce docs</a> and <a href="https://github.com/craftcms/commerce/tree/develop/templates/shop/plans" rel="noreferrer">included templates</a> are good examples of a starting place. </p>

<p>Depending on how you setup your site and what the user has access to,  you can relate the Commerce subscription with the class/video module in question to make sure the user is only allowed to see what they currently have purchased or have access to.</p>

CC BY-SA 4.0
2020-05-18T07:48:01.817Z
Wow, thank you for your very comprehensive response RitterKnight.  Lots to think about there.  They do use MindBody so it's probably worth exploring how we could interface with that to keep things 'tidy' on the business admin side.  I suspect this is a much bigger project than they anticipate.  Thanks again!
Martin
CC BY-SA 4.0
2020-05-18T08:49:17.797Z
I run a Craft application that does a very similar thing, though for a different market, and RitterKnight's answer is spot on. We use Vimeo Pro for video, all of our content is served from Craft and I've just built a Commerce integration to handle subscriptions using Stripe. The latter is quite involved - go in with open eyes, Commerce needs some reasonably strong dev/problem-solving skills if you're not doing things in a 'standard' way.
Martin Spain
CC BY-SA 4.0
2020-05-17T21:26:47.983Z
2020-05-17T21:26:47.983Z
RitterKnight
<p>I'm looking for advice. We've had a client float an idea with us for a possible extension to their existing Craft website.  They want to provide a library of pre-recorded fitness video classes for their customers - This would be a subscription AND 'on demand' service. I guess like Mijingo but for fitness? Here's some questions I have:</p>

<ol>
<li>Is this possible with CraftCMS or would it need Commerce?</li>
<li>We're thinking the Stripe payment plugin - any advice/alternatives?</li>
<li>Can we stream off S3 or is it better to use Vimeo CDN, is there a plugin to assist?</li>
<li>How to ensure videos are only available to logged in users?</li>
<li>What happens when somebody unsubscribes - how do we automatically remove/pause their access?</li>
</ol>

<p>If anyone has experience in something like this and can offer any pointers, pitfalls to avoid etc,  i'd be so grateful.</p>

<p>Many thanks!</p>

<stripe><video>
Building a video subscription library
# Building a video subscription library

(Asked by: username_0 on 2020-05-17)

I'm looking for advice. We've had a client float an idea with us for a possible extension to their existing Craft website. They want to provide a library of pre-recorded fitness video classes for their customers - This would be a subscription AND 'on demand' service. I guess like Mijingo but for fitness? Here's some questions I have:

1. Is this possible with CraftCMS or would it need Commerce?
2. We're thinking the Stripe payment plugin - any advice/alternatives?
3. Can we stream off S3 or is it better to use Vimeo CDN, is there a plugin to assist?
4. How to ensure videos are only available to logged in users?
5. What happens when somebody unsubscribes - how do we automatically remove/pause their access?

If anyone has experience in something like this and can offer any pointers, pitfalls to avoid etc, i'd be so grateful.

Many thanks!

**Tags:** stripe, video


---

## 1 answers

### Answer by username_1 on 2020-05-17. Score: 5 | Accepted answer

Just recently worked a similar project so I'll share what we've uncovered.

Your needs are basically 2-fold: take payment and provide a platform where people can log into and consume content.

> **Is this possible with CraftCMS or would it need Commerce**?

Craft has you covered on content, however taking payment is where having Commerce built-in can be beneficial.

If you're able to build the billing component yourself, you don't need Commerce, however having it built-in, can save a lot of development time and having it integrated in the same system makes sense, especially if someone might have access to tiers of content (this class goes here, this one is not included, etc.) Using Craft's user groups can be pretty beneficial here.

> **We're thinking the Stripe payment plugin - any advice/alternatives?**

Does your client already have other systems where their customers already "subscribe" (eg MindBody, ZenPlanner, Pike13, etc)?

If that's the case, you could interface the two. Upon login (or periodically via cron) ping the 3rd party billing system and see if there's an active subscription. If there is, let them continue; if not, throw up an error message.
If you're going to offer subscriptions, Stripe is currently the only first-party gateway to do so. Payment Gateways are definitely a weak spot for Commerce at the moment.

A lot of offline business will have their own merchant accounts so using a gateway like Authorize.Net is pretty common, however the 3rd party plugin doesn't support subscriptions yet.

As an aside, payment processors hate risk. And the risk becomes higher with digital products, subscriptions, etc. Payment gateways like Stripe are notorious for withholding funds especially if your client scales too quickly, too fast.

When it comes to recurring billing and high ticket amounts, these are payment processor red flags. Having a solid payment processor history is helpful when it comes to disputes and chargebacks. It's a huge bummer to have a client have a super successful launch and then they get an email from their processor saying their account is on hold or that they're withholding funds for 2 weeks. Having a "backup" option of taking payment even if it's manual can be helpful.

> **Can we stream off S3 or is it better to use Vimeo CDN, is there a plugin to assist?**

Unless you like giving more money to Bezos than necessary, bandwidth on S3 is expensive. And it doesn't really handle video all that well IMO. If someone is on a smartphone with a mediocre internet connection, you don't want to send them down 4K video when medium quality SD or HD would suffice.

Vimeo and Wistia are better options in this respect. These services can tailor the streaming experience and you can easily lock down content. Wistia excels when it comes to more analytics (who watched what, how long and more). Their [API](https://wistia.com/support/developers/data-api) is pretty easy to work with as well.

> **How to ensure videos are only available to logged in users?**

Both [Wistia](https://wistia.com/support/embed-and-share/sharing-videos) and [Vimeo](https://vimeo.com/blog/post/video-privacy-explained/) have options to embed only on domains but unlike YouTube and Vimeo, Wistia doesn't let Google index its content by default so it makes it a slightly better choice.

Unlike YouTube where there's not really a good way to prevent users from going back to watch the video on the site (where users can then go and bookmark it), you can customize the player and branding so it's really "embedded" on the site.

> **What happens when somebody unsubscribes - how do we automatically remove/pause their access?**

On every page load of a restricted page, typically you want to `{% requireLogin %}` and then check to see if the user has an active subscription.

The [Commerce docs](https://docs.craftcms.com/commerce/v3/dev/element-queries/subscription-queries.html#example) and [included templates](https://github.com/craftcms/commerce/tree/develop/templates/shop/plans) are good examples of a starting place.

Depending on how you setup your site and what the user has access to, you can relate the Commerce subscription with the class/video module in question to make sure the user is only allowed to see what they currently have purchased or have access to.

> **Comments:**
> **username_0**: Wow, thank you for your very comprehensive response username_1.  Lots to think about there.  They do use MindBody so it's probably worth exploring how we could interface with that to keep things 'tidy' on the business admin side.  I suspect this is a much bigger project than they anticipate.  Thanks again!  
> **username_2**: I run a Craft application that does a very similar thing, though for a different market, and username_1's answer is spot on. We use Vimeo Pro for video, all of our content is served from Craft and I've just built a Commerce integration to handle subscriptions using Stripe. The latter is quite involved - go in with open eyes, Commerce needs some reasonably strong dev/problem-solving skills if you're not doing things in a 'standard' way.  

---

