On this page
What does embedding mean?
Embedding means: you paste a small snippet of code into your page, and your video player appears at that spot. The video itself stays securely hosted with us — you only link to it.
You do not need to program anything. You copy the finished code from the app and paste it where the video should appear.
Where do I find the embed code?
- 1
In the app, open the library you want and click the video.
- 2
On the video detail page, scroll to the „Embed-Code“ (Embed code) section.
- 3
There you will find two variants to copy: an iFrame code and a player code.
iFrame or player code?
Both show the same player. The difference is how the video is included in your page:
iFrame code
Embeds the video in an isolated frame. Simplest and usable anywhere — works in practically every CMS and shop.
Recommended for most casesPlayer code
Includes the player directly in your page. Offers more control over appearance and behavior, but requires that your system allows custom scripts.
For full controlLive demo
On the left you see a real, embedded player. On the right is exactly the code that produces it — so you can see immediately what to expect.
<link href="https://app.videooptimizer.eu/vendor/videojs/video-js.min.css" rel="stylesheet" />
<video-js controls playsinline preload="auto" poster="https://scalecommerce-videooptimizer.cdn.videooptimizer.eu/thumbnails/e7ab89b1-b74f-42fd-b2a9-53bfe1d492a8/thumb_01.jpg"
class="video-js vjs-big-play-centered" style="width:100%;aspect-ratio:640/360">
<source src="https://scalecommerce-videooptimizer.cdn.videooptimizer.eu/encoded/e7ab89b1-b74f-42fd-b2a9-53bfe1d492a8/hls/master.m3u8" type="application/x-mpegURL" label="Auto" />
<source src="https://scalecommerce-videooptimizer.cdn.videooptimizer.eu/encoded/e7ab89b1-b74f-42fd-b2a9-53bfe1d492a8/h264/360p.mp4" type="video/mp4" label="360p" />
<source src="https://scalecommerce-videooptimizer.cdn.videooptimizer.eu/encoded/e7ab89b1-b74f-42fd-b2a9-53bfe1d492a8/h264/480p.mp4" type="video/mp4" label="480p" />
<source src="https://scalecommerce-videooptimizer.cdn.videooptimizer.eu/encoded/e7ab89b1-b74f-42fd-b2a9-53bfe1d492a8/h264/720p.mp4" type="video/mp4" label="720p" />
<source src="https://scalecommerce-videooptimizer.cdn.videooptimizer.eu/encoded/e7ab89b1-b74f-42fd-b2a9-53bfe1d492a8/h264/1080p.mp4" type="video/mp4" label="1080p" />
</video-js>
<script src="https://app.videooptimizer.eu/vendor/videojs/video.min.js"></script>
Pasting it into your system
Paste the copied code wherever your editor allows custom HTML or embed code. Look for a block with one of these names:
- An “HTML”, “Code” or “Embed” element (for example in WordPress, Webflow, Shopify, TYPO3).
- A “source code” / “code view” mode in the rich-text editor (often a “</>” symbol).
- A dedicated field for “Custom HTML” or “Embedded content”.
Responsive display
To keep the correct aspect ratio on every screen size, you can wrap the iFrame in a container. Replace YOUR_EMBED_URL with the URL from your iFrame code:
<div style="position:relative;width:100%;aspect-ratio:16/9;">
<iframe src="YOUR_EMBED_URL" loading="lazy"
style="position:absolute;top:0;left:0;width:100%;height:100%;border:0;"
allow="autoplay;fullscreen;picture-in-picture"
allowfullscreen></iframe>
</div>
Controlling playback (autoplay, muted, loop)
You can control the behavior per embed by appending parameters to the embed URL: autoplay, muted, loop and controls (1 = on, 0 = off). Only the parameters you set override the settings stored in the player. The following example starts the video automatically, muted, looping and without controls — ideal for a background video:
<div style="position:relative;width:100%;aspect-ratio:16/9;">
<iframe src="YOUR_EMBED_URL?autoplay=1&loop=1&controls=0" loading="lazy"
style="position:absolute;top:0;left:0;width:100%;height:100%;border:0;"
allow="autoplay;fullscreen;picture-in-picture"
allowfullscreen></iframe>
</div>
Note: browsers only allow autoplay for muted videos, so muted is set automatically. The iFrame also needs the attribute allow="autoplay", otherwise automatic playback is blocked.
Video in a lightbox (one click with sound)
If the video opens in a lightbox on click, it should start with sound straight away. To do this, append autoplay=1&muted=0 to the embed URL and create the iFrame only on click. The visitor’s click then allows the browser to play with sound:
<button id="open-video">Video ansehen</button>
<div id="video-lightbox" hidden
style="position:fixed;inset:0;background:rgba(0,0,0,.85);display:flex;align-items:center;justify-content:center;">
<div id="video-box" style="position:relative;width:90vw;max-width:960px;aspect-ratio:16/9;"></div>
</div>
<script>
const lightbox = document.getElementById('video-lightbox');
const box = document.getElementById('video-box');
document.getElementById('open-video').addEventListener('click', () => {
box.innerHTML = '<iframe src="YOUR_EMBED_URL?autoplay=1&muted=0"'
+ ' style="position:absolute;inset:0;width:100%;height:100%;border:0;"'
+ ' allow="autoplay;fullscreen;picture-in-picture" allowfullscreen></iframe>';
lightbox.hidden = false;
});
lightbox.addEventListener('click', (e) => {
if (e.target !== lightbox) return;
// Only hiding the iframe? Pause it instead of removing it:
// box.querySelector('iframe').contentWindow.postMessage(
// { type: 'videooptimizer:command', command: 'pause' }, '*');
box.innerHTML = '';
lightbox.hidden = true;
});
</script>
If a browser still does not allow sound (e.g. Safari on iPhone/iPad), the video starts muted and shows the „Ton einschalten“ (Turn on sound) button – one more tap is enough. The attribute allow="autoplay" on the iFrame is required. If your lightbox only hides the iFrame when closing, pause the video with a postMessage command (play, pause, mute, unmute), as shown in the comment.
Help & frequently asked questions
The player does not appear.
Usually the CMS strips out the pasted code. Make sure you are using a real HTML/embed element and not the ordinary text editor, which treats code as plain text.
The video is the wrong size.
Use the responsive wrapper from the section above. It makes the player take the full width and keep its aspect ratio.
Can the video start automatically?
Yes. Autoplay, loop and muting can be enabled in the embed options on the video detail page before you copy the code. Note: browsers usually only allow autoplay when the video is muted.