Embed Player
Add Castiz videos to your website using responsive iframes.
Quick Embed (iframe)
The easiest way to embed a video is with an iframe. Copy this code and replaceVIDEO_IDwith your video ID.
<iframe
src="https://castiz.com/embed/VIDEO_ID"
width="640"
height="360"
frameborder="0"
allow="autoplay; fullscreen; picture-in-picture"
allowfullscreen
></iframe>Tip: Get the embed code directly from the Castiz dashboard by clicking the "Share" button on any video.
Responsive Embed
For responsive layouts, wrap the iframe in a container with padding-based aspect ratio.
<style>
.video-container {
position: relative;
padding-bottom: 56.25%; /* 16:9 aspect ratio */
height: 0;
overflow: hidden;
}
.video-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>
<div class="video-container">
<iframe
src="https://castiz.com/embed/VIDEO_ID"
frameborder="0"
allow="autoplay; fullscreen; picture-in-picture"
allowfullscreen
></iframe>
</div>Embed Parameters
Customize the player behavior by adding query parameters to the embed URL.
| Parameter | Type | Description |
|---|---|---|
| autoplay | boolean | Start playing automatically (muted by default) |
| muted | boolean | Start muted |
| loop | boolean | Loop video continuously |
| controls | boolean | Show player controls (default: true) |
| t | number | Start time in seconds |
| color | string | Accent color (hex without #) |
https://castiz.com/embed/VIDEO_ID?autoplay=1&muted=1&loop=1&color=ff0000Domain Restrictions
Protect your videos by restricting which domains can embed them. Configure this in your Castiz dashboard or via the API.
curl -X PATCH "https://api.castiz.com/videos/VIDEO_ID" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"allowed_domains": ["example.com", "www.example.com"]
}'Domain Matching
Domains are matched exactly. Add both example.com and www.example.com if you use both. Subdomains like app.example.com need to be added separately.
oEmbed Support
Castiz supports the oEmbed standard for automatic video embedding in platforms like WordPress, Medium, and Notion.
GET https://castiz.com/api/oembed?url=https://castiz.com/watch/VIDEO_ID{
"type": "video",
"version": "1.0",
"provider_name": "Castiz",
"provider_url": "https://castiz.com",
"title": "My Video Title",
"thumbnail_url": "https://cdn.castiz.com/thumbnails/...",
"thumbnail_width": 1280,
"thumbnail_height": 720,
"html": "<iframe src=\"https://castiz.com/embed/VIDEO_ID\" ...></iframe>",
"width": 640,
"height": 360
}