Login

Use custom domain in player

You can use custom domains to stream video assets from a domain of your choice rather than the default fastpix.io. This guide will help you set up and use a custom domain with the FastPix player, enhancing your control over media delivery. Leveraging custom domains can enhance your branding, improve SEO, and increase user trust.


Default behavior

By default, all FastPix video assets—including posters, storyboards, and media sources—are hosted on fastpix.io. This means that when you use the FastPix player without a custom domain, your video and image assets are streamed directly from FastPix servers.


Setting up a custom domain


To set up a custom domain with the FastPix player, follow these steps:

  1. Configure your DNS: Point your custom domain to the appropriate FastPix asset servers. This typically involves setting up CNAME records in your DNS settings. For example:
    • media.example.com should point to assets.fastpix.io
    • image.media.example.com should point to images.fastpix.io
    • stream.media.example.com should point to videos.fastpix.io

  2. Verify domain configuration: Ensure your DNS settings are correctly configured and propagated across the network.

Providing the custom domain to the FastPix player

Once your custom domain is set up, the next step is to inform the FastPix player about it using the custom-domain attribute or the customDomain property.


HTML element example

To use a custom domain with the FastPix player in an HTML element, include the custom-domain attribute with your domain:

<fp-player  
  playback-id="PlaybackId"  
  custom-domain="media.example.com"  
  stream-type="on-demand"  
></fp-player> 

In this example, media.example.com is your custom domain. Internally, the FastPix player will expand this value to image.media.example.com for images and stream.media.example.com for video streaming.


Here's a more detailed example of how to integrate the FastPix player with a custom domain:

<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="UTF-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
    <title>FastPix Player with Custom Domain</title> 
</head> 
<body> 
    <h1>Welcome to My Custom Video Player</h1> 
    <p>This video is served from my custom domain, enhancing branding and trust.</p> 
    <fp-player  
        playback-id="qIJBqaJPkhNXiHbed8j2jyx02tQQWBI5fL6WkIQYL63w"  
        custom-domain="media.example.com"  
    ></fp-player> 
</body> 
</html> 

Understanding custom domain behavior

When you specify a custom domain, the behavior is as follows:

  • Videos will be streamed from stream.<your-custom-domain>.
  • Images will be loaded from image.<your-custom-domain>.

For example, if your custom domain is media.example.com:

  • Videos will be streamed from stream.media.example.com.
  • Images will be loaded from image.media.example.com.

Troubleshooting when using custom domains

If you run into issues while setting up or using a custom domain with the FastPix player, consider these troubleshooting tips:

Check your DNS configuration: Ensure your DNS records are correctly configured and fully propagated.

Inspect network requests: Use your browser’s developer tools to inspect network requests and confirm that assets are being loaded from the correct custom domain.

Review console logs: Look for any errors or warnings in the browser console that could point to configuration issues.