DCAST on a SendPulse website
The SendPulse website builder takes your own HTML in its Custom code widget. A DCAST player is a single iframe, so a video or a live broadcast goes onto a SendPulse page by pasting the code DCAST gives you. On that page the player works as it does on DCAST: adaptive playback, the live chat beside a broadcast, and paid access with the payment window inside the player.
What you need
- A DCAST account: sign up at dcast.pro. Every plan can embed its player, including the free one.
- A website in the SendPulse website builder that you can edit.
1. Copy the embed code
In your DCAST dashboard open the share menu of the video or broadcast card and choose Embed. Copy the Video player code. For a broadcast the same window also has the Live chat code.
Through the API the same codes come from GET /videos/{id}/embed (field iframe) and GET /streams/{id}/embed (fields iframe and chat.iframe); see Video API and Streams.
A player code looks like this, with the id of your video or broadcast in place of VIDEO_ID:
<iframe src="https://dcast.tv/embed/VIDEO_ID" width="720" height="405" frameborder="0" allow="autoplay; fullscreen; encrypted-media; picture-in-picture; payment" allowfullscreen style="border:0;border-radius:16px;overflow:hidden;max-width:100%;height:auto;aspect-ratio:16/9"></iframe>2. Paste it into a SendPulse page
- In SendPulse go to Websites, choose your website and open it in the builder.
- Pick the place on the page, click + and choose the Custom code widget.
- Click the new element, paste the player code and click Add. For the chat of a broadcast, add a second Custom code element with the chat code.
- The builder does not draw custom code, so the element stays empty in the editor. Click Preview to see the player, then Save.
Any website can show your player unless you set an embed allowlist. If you set one, add the domain of your SendPulse website to it, or the player will not show there.
Selling access on a SendPulse page
Give the video or the broadcast a price in DCAST, and the paywall appears inside the player on your SendPulse page. A price needs a payout method (Stripe, PayPal, Monobank or crypto) connected to your DCAST account; without one DCAST does not save the price.
- The viewer clicks Buy. The payment window opens inside the player, and the viewer stays on your page.
- Once access is granted, the player opens the video in place, without reloading your page. When the viewer comes back to the same page in the same browser, the access is remembered.
- The receipt email carries an access code. In another browser or on another device the viewer clicks Have a key? Enter it in the player and enters that code.
- The viewer does not need to be signed in to DCAST for any of this, and it works in Chrome and Safari, which block third-party cookies.
SendPulse courses
A lesson in a SendPulse course has no element for your own code, so the player cannot go inside a lesson. Put it on a page of your SendPulse website and link to that page from the lesson.
Support
Write to [email protected]. Plan limits and error codes are the same in the API and in the dashboard (see Errors and limits).
