PixHub

20 January 2026 · 9 min read

How to Embed a Video on Your Site or Blog, with Your Own Player

A complete guide to video embedding: how to get the embed code, what player options are available, and how to make it responsive on any site or blog.

A link to a video works fine in a message or a forum post, but on your own site or blog, you usually want the clip to play directly on the page, not send the visitor somewhere else. That's where embedding comes in: a snippet of code that displays the video player right on your page, with its own controls, without the visitor ever leaving your site.

This guide walks through what video embedding actually means, how to get the code you need from an online video hosting platform like PixHub, and how to make sure the player looks and works correctly wherever you place it.

What "embed" actually means for a video

Embedding means incorporating an external element (in our case, a video player) directly into a web page, via an iframe. Visually, the result looks as if the video is part of your page, even though the content is actually being loaded from the hosting platform's server.

The difference from a simple link is significant: a link takes the visitor to a new page or a new tab, while embedding brings the player right to where you placed the code, keeping the visitor on your site for the entire viewing experience.

Technically, embedding uses an HTML <iframe> tag, which loads a minimal page dedicated exclusively to playing the clip, with no menus, no ads, and no other interface elements unrelated to the video itself.

How to get the embed code on PixHub

The process is the same whether you uploaded the clip with an account or anonymously:

  1. Upload the video on the online video hosting page, no account required.
  2. After processing (automatic transcoding for universal playback), the platform automatically generates several link formats, including the embed code.
  3. Copy the code snippet, which already contains a fully configured <iframe> tag with default dimensions.
  4. Paste the code into your site's or blog's editor, right where you want the player to appear.

You don't need to change anything manually for the player to work: the embed code is self-contained and loads everything it needs (player, styles, controls) with no extra external dependencies.

What the embedded player actually includes

The embed page uses a dedicated video player, not a plain <video> tag. Among the included features:

  • Playback speed control - visitors can choose between 0.5x and 2x speed, useful especially for tutorials or technical demos.
  • No exposed download button - the player is configured not to offer a direct way to save the file, keeping you in control of content distribution.
  • Right-click menu blocking - during playback, the browser's context menu is disabled, an extra measure against easily copying the source.
  • Ad-free playback - unlike many large video platforms, the embed doesn't overlay ads on top of your content.

How to make the embed responsive

An embed that doesn't adapt to its container's width looks bad on phones or small screens. The embed code generated by PixHub uses an iframe with relative dimensions, so the player keeps its correct aspect ratio (16:9 for most clips) regardless of the column width you place it in.

If you use a CMS (WordPress, Ghost, a static site generator), most themes already apply a CSS rule that limits iframe width to the parent container's width. If you notice the player overflowing the page edges, check whether your theme applies max-width: 100% to iframe elements in the content.

Embed, direct link, or a video tag: when to choose each

The three sharing options aren't interchangeable - each fits a different context:

  • Embed iframe - best for blog pages, articles, or documentation, where you want the player to appear directly in the content, with all its controls included.
  • Direct file link - suited for forum BBCode or cases where you only need the file's address, with no extra interface.
  • HTML <video> tag - useful when you're building your own custom player and just need the file source, not the hosting platform's ready-made interface.

For the exact difference between a page link and a direct file link, see also our guide on which video formats are accepted at upload, especially relevant if you want to know what happens to the file before you embed it.

Common embed problems and how to fix them

The player doesn't appear at all

Your site most likely has a Content Security Policy that blocks iframes from other domains. Check your site's CSP settings and add the hosting platform's domain to the allowed list.

The player appears, but without controls

Check whether you copied the complete embed code, not just the direct file link placed manually inside an iframe. The original embed code includes the attributes needed to display the controls.

The video autoplays, with sound

The embed code generated by PixHub doesn't enable autoplay by default. If you're seeing this behavior, check whether a theme or plugin on your site is adding extra attributes on top of the original iframe.

The embed doesn't resize on mobile

The issue is almost always in your theme's CSS, not in the embed code itself. Add a simple rule that limits iframe elements to 100% of the parent container's width.

Embedding on popular platforms

On WordPress, the embed code can be pasted directly into a custom HTML block in the editor. On simpler blogging platforms or static pages, the code is inserted straight into the article's HTML source. For technical documentation (guides, internal knowledge bases), embedding is especially useful for video tutorials that accompany written steps, without the reader having to leave the page to see the demonstration.

What difference a dedicated player makes compared to a plain video tag

A raw HTML <video> tag, with no additional player layered on top, uses the browser's native controls. These look different from one browser to another and often don't offer control over playback speed or right-click behavior. A dedicated player, like the one used in the embed code, offers the same experience regardless of the visitor's browser, with the same set of controls and the same visual appearance.

This consistency matters especially for technical or educational content, where you want the instructions about how to use the player (playback speed, pause, fullscreen) to hold true for every visitor, regardless of device.

How much space an embed takes up on the page

The embed code itself is minimal - a single iframe with a few attributes. The real weight comes from the player and the video file itself, which loads separately, on demand, not along with the rest of the page. In practice, having an embed on the page doesn't significantly slow down the article's initial load time, because the player and video content are only requested by the browser once the visitor scrolls to them or presses play, depending on how the iframe is configured.

You can measure how many people watched the embed

If you need view statistics, a free account on the hosting platform usually gives you access to a view counter for each file, including those played through an embed. For anonymous uploads, this information isn't kept, which is actually the main reason someone would choose an account in this scenario: measuring the impact of a clip embedded in a blog article or a product page, not just distributing it.

If you want a more detailed picture (traffic sources, visitor devices), you can combine the embed with a separate page analytics tool you already have installed on your site, which will record time spent on that page as an indirect signal of the clip being watched.

Frequently asked questions about video embedding

Does the embed work on phones too?

Yes. The embed code is responsive and automatically adapts to screen width, and the player supports playback on mobile devices as well, with the same basic controls.

Can I change the player's dimensions in the embed?

Yes, you can adjust the iframe's width and height directly in the HTML code, though it's recommended to keep the clip's original aspect ratio (usually 16:9) to avoid distorting the image.

Does the embed still work if I delete the original video?

No. The embed loads the file directly from the hosting platform, in real time. If the original file is deleted, the iframe will show an error instead of the player.

Do I need programming knowledge to use the embed?

No. The embed code is generated automatically and is ready to paste as-is, with no need to write or modify code. The only requirement is that your site's or blog's editor allows inserting custom HTML.

Does the embed affect the SEO of the page I put it on?

Not negatively. The text content around the embed remains normally indexable, and having a relevant video can even increase the time visitors spend on the page, an indirect positive signal for search engines.

Subtitles and accessibility in the embed

For tutorials or content aimed at a wider audience, subtitles make the difference between a clip that's easy to follow and one that's hard to understand without sound (useful for visitors browsing without headphones or in noisy environments). If the video file already has an embedded subtitle track, the embedded player can display it directly, with no extra configuration. If not, a simple alternative is adding a descriptive text below the player, on the page, summarizing the key steps shown in the clip.

Conclusion

Embedding remains the cleanest way to integrate a video directly into your own page, with no ads and without sending the visitor elsewhere. You can get the embed code right now, with no account, from the online video hosting page on PixHub.

Continue with video streaming vs. simple video hosting or how to send a screen recording without a watermark.