Skip to content
Planning a business-critical broadcast? Business-critical broadcast? Talk to a video expert

How to Set Up Live Streaming on Your Website (7 Steps)

Learn how to set up live streaming on your website in 7 steps. Get the gear, embed code, and encoder settings to put a branded live player on your site.

embedding live streaming on website
In this article

Most live streams end up on YouTube or Facebook, not on the website you built for your audience. Live streaming on your website is a setup that plays real-time video inside a player embedded on your own pages, so viewers watch without leaving your domain.

Social embeds bring their own branding, ads, and suggested videos that pull viewers away. Building your own streaming server means running the transcoding and delivery infrastructure yourself. The faster route is simple: send your camera feed through an encoder to a streaming platform, then paste the platform’s embed code into your page.

This blog explains how to set up live streaming on your website in 7 steps, plus the settings that keep your stream stable.

What Does It Mean to Live Stream on Your Website?

Live streaming on your website is a setup that delivers real-time video to visitors through a player embedded on your own pages. The player sits on your domain and carries your branding, so viewers stay next to your content.

Browsers can’t play the RTMP feed your encoder sends. A streaming platform receives that feed and converts it to HLS (HTTP Live Streaming), a format web players can deliver to every modern browser. Safari plays HLS natively, while Chrome, Firefox, and Edge play it through a JavaScript player built on Media Source Extensions. The embed code is a short snippet, usually an iframe, that drops the platform’s player into your page.

That shift matters because audiences already watch most of their videos as streams. According to Neilsen, streaming held 47.5% of all US TV viewing in December 2025, the largest share ever recorded.

What Do You Need to Live Stream on Your Website?

Every website live stream runs on four parts working as a chain:

  1. a camera and microphone that capture the video,
  2. an encoder that compresses it into a stream,
  3. a streaming platform that converts and delivers it, and
  4. an embed player that shows it on your page.

Camera and Microphone

A camera and microphone are the capture devices that turn what’s happening in front of you into video and audio signals. Every other part of the chain works with what these two devices record.

The camera captures the picture and the microphone captures the sound, then both feed into your encoder. A camera connects over USB, or over HDMI through a capture card like the Elgato Cam Link 4K.

Better capture gear gives your viewers a sharper picture and clearer voices. Viewers forgive a soft image far more easily than muffled or echoing audio, so the microphone matters as much as the camera.

Choose by the kind of stream you run:

  • Talks, classes, and webinars: the Logitech C920 webcam plugs straight into USB and needs no capture card.
  • Creator shows, product demos, and small events: the Sony ZV-E10 II mirrorless camera records sharper, more detailed video with interchangeable lenses.
  • Speakers who move around: the Rode Wireless GO clip-on microphone keeps audio clean without a cable.

The best all-round pick is the Sony ZV-E10 II paired with the Shure MV7+, a microphone that connects over USB-C or XLR and grows with your setup.

Encoder

An encoder is software or hardware that compresses your raw camera feed into a stream small enough to send over the internet.

Its task is to package your video and audio into a format like RTMP, SRT, or WHIP and push it to your streaming platform. Most encoders also let you switch cameras, add graphics, and mix audio.

A well-configured encoder keeps your stream smooth on a normal upload connection. It also turns a single camera into a produced show with titles, logos, and multiple scenes.

Choose by budget and how many cameras you use:

  • Free, single computer: OBS Studio runs on Windows, macOS, and Linux and supports RTMP, SRT, and WHIP.
  • Paid, multi-camera productions: vMix (Windows) and Wirecast (Windows and macOS) add instant replay, built-in titles, and remote guests.
  • Streaming without a computer: hardware encoders like the Blackmagic ATEM Mini Pro switch up to 4 HDMI cameras and stream over Ethernet.
  • Streaming from a phone: Larix Broadcaster sends RTMP or SRT from iOS and Android.

The best pick for most setups is OBS Studio, since it’s free and works with Castr out of the box. Move up to the Blackmagic ATEM Mini Pro when you run several cameras and want to free up your computer.

If you don’t have an encoder, Castr’s Webcam option streams straight from your laptop’s browser.

Streaming Platform

A streaming platform is the cloud service that receives your encoder’s feed and delivers it to viewers’ browsers.

Its task is to ingest your stream, transcode it into HLS (the web-ready streaming format), and hand it to a CDN (content delivery network). The CDN copies your video to servers near each viewer.

A streaming platform removes the hardest work from your plate. You don’t run servers, and 500 people watching at once don’t overload a single machine.

Choose based on how much control you need:

  • Free social platforms: YouTube, Facebook, and Twitch host the stream but keep their own branding on the player (compared in detail later in this guide).
  • Self-hosted servers: open-source software gives full control but leaves bandwidth, scaling, and maintenance to you.
  • Dedicated streaming platforms: these give you a branded player, security controls, and CDN delivery without running any servers.

The best pick for a website stream is Castr. It accepts RTMP, RTMPS, SRT, and WHIP ingest, delivers through a multi-CDN backed by Akamai, Fastly, and CloudFront, and gives you an embed player, multistreaming, and a paywall in one dashboard. Plans start at $19.99/month with a 7-day trial.

HTML5 Embed Player

An HTML5 embed player is the video window that sits on your web page and plays the stream in any modern browser without plugins.

Its task is to fetch the HLS stream from the CDN and display it, with controls for play, volume, and full screen. You add it to a page with a single iframe snippet.

A good player keeps viewers watching on every device. A responsive player resizes to fit phones, tablets, and desktops, and a branded one makes the stream look like part of your site.

Choose based on your technical skills:

  • No coding: use the hosted player that comes with your streaming platform and paste its iframe.
  • Custom design: open-source players like Video.js play an HLS URL inside a player you style yourself.

The best pick for most websites is Castr’s built-in player, which comes with every Castr live stream, so you don’t need a separate player service. You embed it with one iframe, and viewers watch in their browser without installing an app or signing in to an account.

The player includes these features:

  • No forced platform branding: your stream plays without another platform’s logo or recommended videos around it.
  • Multi-CDN delivery with automatic failover: playback runs across Akamai, Fastly, and CloudFront at the same time, and traffic shifts to a healthy network if one slows down. It’s included on every plan and backed by a 99.9% uptime SLA.
  • Adaptive bitrate: viewers on slow connections get a lower-quality version instead of a frozen picture (Premium and higher).
  • Player rewind: viewers can rewind a live broadcast and catch back up to the live edge, up to one hour on Premium and up to four hours on Ultra and higher.
  • Timeshifting: one broadcast plays at each audience’s local time, so 9 a.m. means 9 a.m. in San Francisco, Dublin, and Dubai (Premium and higher).
  • Access controls: password protection works on every plan, while domain allowlisting and country-level restrictions start on Premium.
  • DRM protection: multi-DRM (Widevine, FairPlay, and PlayReady) is available as an add-on on every plan for premium content.
  • Automatic replays: every broadcast records automatically, so you can publish the replay to your video library when the stream ends.

You can also add your logo, colors, poster image, offline message, and event countdown without writing code.

How Do You Set Up Live Streaming on Your Website?

You can set up live streaming on your website in seven steps:

  1. Create a live stream on your streaming platform.
  2. Connect your encoder with the RTMP URL and stream key.
  3. Copy the embed code for your live player.
  4. Paste the embed code into your web page.
  5. Customize the player before viewers arrive.
  6. Run a private test stream.
  7. Go live and monitor stream health.

The walkthrough below uses Castr’s dashboard labels, but the same flow applies to most streaming platforms.

Step 1: Create a Live Stream on Your Streaming Platform

Start by creating a stream inside your streaming platform. In Castr, click Livestream in the left sidebar, then click Create New.

Give the stream a name and pick the Hosting Region closest to where you’ll broadcast from. A nearby ingest server gives you the best ingest quality.

Step 2: Connect Your Encoder With the RTMP URL and Stream Key

Your encoder needs two values to reach the platform: the server URL and the stream key. In Castr, open Source Setup, select Publish, then RTMP, and copy the Primary RTMP server URL and the Streaming Key.

In OBS Studio, open Settings, then Stream, choose Custom, and paste both values. Click Start Streaming to send the feed.

Treat the stream key like a password, because anyone who has it can broadcast to your stream.

Castr also accepts RTMPS for encrypted ingest and SRT for unstable networks, both from the same Source Setup panel.

Step 3: Copy the Embed Code for Your Live Player

The embed code is the link between your page and the player. In Castr, open the Playback tab, confirm Enable Playback is on, and choose Responsive or Fixed size.

Pick Responsive for almost every site, because the player scales to the width of its container on phones and desktops. Copy the iframe code that appears.

If you’d rather share a link than embed, copy the Direct Player Link instead. For recurring events, Castr’s Dynamic Player keeps one embed code on your page while you switch the live source behind it.

Step 4: Paste the Embed Code Into Your Web Page

Paste the iframe into the HTML of the page where viewers should watch. Most site builders accept it through an HTML or embed block, covered builder by builder in the next section.

Publish the page once the code is in place.

Step 5: Customize the Player Before Viewers Arrive

Your player is live on the page before you are, so set up what visitors see while they wait. Castr’s Settings tab, under Player Interface, lets you configure:

  • an Offline Message of up to 50 characters,
  • an Event Countdown to your start time,
  • a Custom Embed Poster image of up to 2 MB,
  • a Player Theme Color that matches your site, and
  • an Embed Watermark with your logo.

Under Player Functions, you can also turn on autoplay and the built-in chat box.

Step 6: Run a Private Test Stream

Run a test stream at least a day before the real event. Start your encoder, open the page on a phone and a laptop, and watch for 10 minutes.

Check that:

  • audio and video stay in sync,
  • the picture doesn’t buffer on mobile data, and
  • the player scales without cropping.

If the page is already public, turn on password protection during the test so nobody stumbles into it.

Step 7: Go Live and Monitor Stream Health

Go live by starting your encoder, then watch the stream’s health, not just the picture. Castr’s Monitoring tab plots your bitrate in real time.

A steady line near your encoder’s target bitrate means a healthy feed. Sharp dips usually point to an unstable upload connection.

Turn on Cloud Recording in the Live To VOD tab before you start, and the broadcast becomes an on-demand video afterward.

Where Do You Paste the Embed Code on WordPress, Squarespace, Wix, and HTML Sites?

Every major site builder accepts the iframe from Step 3. Only the block name changes.

How Do You Add a Live Stream to WordPress?

WordPress doesn’t need a plugin to show a live stream. In the block editor, click the + icon, add a Custom HTML block, and paste the iframe.

Use Preview to confirm the player renders, then click Update. If you’re on WordPress.com rather than self-hosted WordPress, check that your plan allows iframes in custom HTML.

How Do You Add a Live Stream to Squarespace?

Edit the page, add a Code block, and paste the iframe into it. Set the block’s display mode to HTML, leave Display Source switched off, and save.

Iframes in Code blocks need the Core plan or higher, according to Squarespace’s Code blocks guide.

Open the live page afterward to confirm the player loads.

How Do You Add a Live Stream to Wix?

In the Wix Editor, click Add Elements, choose Embed Code, then Embed HTML. Click Enter Code, paste the iframe under Add your code here, and click Update. In the newer Wix Harmony Editor, click + Add and drag the Embed code element onto the page instead.

Wix’s HTML element is itself an iframe, so the player won’t resize responsively on its own. Drag the element’s handles until the player fits the width of its section.

How Do You Add a Live Stream to a Custom HTML Page?

On a hand-coded site, paste the iframe inside the page body where the player belongs. Wrap it in a container with max-width set to 100% so it never overflows on small screens.

The responsive embed from Step 3 scales with that container automatically.

Which Encoder Settings and Upload Speed Keep a Website Stream Stable?

Most buffering traces back to two causes: encoder settings and upload speed.

Set your encoder to these values:

  • Video codec: H.264, which Castr requires for playback
  • Rate control: CBR (constant bitrate)
  • Keyframe interval: 2 seconds
  • Audio: AAC at 48 kHz, stereo, 128 kbps
  • Resolution: 720p for modest connections, 1080p when your upload allows it

Plan your bitrate around resolution. Castr’s playback tiers budget about 3 Mbps for 720p and 7 Mbps for 1080p.

Then leave the headroom. Keep your measured upload speed at least 50% above your total stream bitrate, because Wi-Fi and shared office networks fluctuate. Castr’s free bandwidth calculator estimates what your setup needs.

Use a wired Ethernet connection whenever you can.

Your viewers face the opposite problem, since their connections vary. Adaptive bitrate (ABR) creates several quality versions of your stream, so a viewer on weak mobile data gets 480p instead of a frozen 1080p picture. Castr includes ABR from the Premium plan.

Should You Embed YouTube, Facebook, or Twitch, or Use a Dedicated Streaming Platform?

Social embeds are free and fast, but the platform controls the player, not you.

OptionCostPlayer brandingAccess controls
YouTube Live embedFreeYouTube logo and linksPublic or unlisted videos only
Facebook Live embedFreeFacebook interfacePublic posts only
Twitch embedFreeTwitch branding and chatTwitch channel settings only
Castr embed playerFrom $19.99/monthYour logo, colors, and posterPassword, domain, and country restrictions

Can You Embed a YouTube Live Stream on Your Website?

You can embed a YouTube live stream on your website once your channel has YouTube’s advanced features enabled, since live stream embedding sits in that tier. Check this under Feature eligibility in YouTube Studio, then click Share, then Embed, on the live video and copy the iframe.

Each scheduled YouTube stream gets a new video ID, so a weekly show often means replacing the embed code before every broadcast. YouTube’s branding also stays on the player.

How Do You Embed a Facebook Live Stream on Your Website?

Facebook lets you embed a live video from any public video post by a Page or person. Open the post’s options menu, choose Embed Video, and copy the code.

Private and group videos won’t play on your site. Viewers see Facebook’s interface, and its buttons push them back toward Facebook.

How Do You Embed a Twitch Stream on Your Website?

Twitch embeds need two extra conditions. The iframe’s parent parameter must list your website’s domain, and your site must use HTTPS, or the player shows a playback error.

Use player.twitch.tv/?channel=YOURCHANNEL&parent=yourdomain.com as the iframe source. Twitch’s branding and chat culture come along with the player.

What Does a Dedicated Streaming Platform Embed Offer?

A dedicated streaming platform gives you a player that carries only your content and your brand. Castr’s player takes your logo, colors, and poster image, and you decide who can watch (see the next section).

Castr’s Dynamic Player also fixes the weekly-code problem from YouTube. You embed one player once, then assign each new live stream to it from the dashboard.

How Do You Secure, Monetize, and Track a Website Live Stream?

How Do You Stop Other Sites From Stealing Your Embed?

Anyone can copy an iframe from your page source and paste it on their own site. Domain whitelisting blocks that, because the player only loads on domains you approve.

Castr pairs it with password protection and country-level geo-blocking for licensed or private content. Password protection works on every plan, while domain and geo restrictions start on Premium.

Can You Charge Viewers With a Pay-Per-View Paywall?

Live streams make money when you charge for access. Castr’s Paywall puts a pay-per-view checkout in front of your embedded player, with card payments processed through Stripe.

Castr’s commission drops as your plan rises, from 18% on Starter to 5% on Ultra. It fits ticketed concerts and paid workshops.

Which Viewer Analytics Should You Track?

Analytics tell you whether the stream worked. Castr reports these for each stream:

  • concurrent viewers and visits,
  • viewer geography and devices, and
  • input health, including video bitrate, audio bitrate, and frame rate.

You can also add your Google Analytics ID to the player to track plays alongside your site traffic.

Can You Stream to Your Website and Social Platforms at the Same Time?

You don’t have to choose between your website and social reach. Multistreaming sends one encoder feed to your embedded player and to social platforms at the same time.

In Castr, open the Destinations tab, click Add destination, and connect each platform by account login or with a server URL and key. Supported destinations include:

  • YouTube, Facebook Live, and LinkedIn for community and business audiences
  • Twitch and Kick for gaming audiences
  • Instagram, TikTok, and X for social audiences (TikTok LIVE requires 18+ and 1,000+ followers, and TikTok grants stream-key access to only some accounts)

The Starter plan includes 6 destinations, and Ultra supports up to 30. Your connection only uploads one stream, because Castr creates the copies in the cloud.

How Much Does It Cost to Live Stream on Your Website?

You can live stream on your website for free with a social platform embed. You pay instead in branding and control (see the comparison above).

A dedicated platform charges a monthly fee that covers the infrastructure between your encoder and your viewers. Castr’s Starter plan costs $19.99/month ($199.99/year) and includes:

  • 2 concurrent streams (3 on the annual plan),
  • 2.4 TB of bandwidth plus 200 GB of player bandwidth,
  • 100 GB of storage, and
  • 6 multistream destinations.

Premium ($199.99/month) is the tier that adds adaptive bitrate and domain whitelisting. A 7-day trial lets you run Step 6’s test stream before you pay.

Building your own server with open-source software avoids subscription fees but shifts bandwidth bills and maintenance onto you.

Wrapping Up

Your website is the one place where you set the rules, which makes it the natural home for your live video. When the stream plays on your own pages, every viewer you earn stays connected to your brand instead of drifting into someone else’s feed. 

Castr puts the whole setup in one dashboard, so start your free 7-day Castr trial and host your next broadcast on your own site.