Signed URL for VOD & Live stream
FastPix Player offers powerful token-based authentication to ensure secure access to your media assets, whether you’re dealing with on-demand or live streams. This guide will walk you through how to use token-based signed URLs effectively for different types of streams, along with integration tips and best practices to keep your streaming secure and reliable.
What are signed URLs?
Signed URLs are secured links embedded with a cryptographic signature. This signature, generated using a token or key, authenticates and authorizes access to your media resources. In essence, they ensure that only approved users or applications can play the content, giving you more control and peace of mind over your media's distribution.
Understanding token usage
Tokens are at the heart of how FastPix Player controls access to media. They are essential for managing secure playback and ensuring that your content is accessible only to those who have permission.
Secured on-demand streams
For on-demand streaming, tokens play a key role in securing access to various assets:
The token passed to playback-id for on-demand streams can be used for playback, thumbnail, and spritesheet
Playback token: This token provides authenticated access to the main video content. It kicks off the playback, ensuring the video is streamed securely in the FastPix Player.
Example playback URL:
https://stream.fastpix.io/{playbackId}.m3u8?token={JWT}
Thumbnail token: Used to securely access thumbnail images tied to the video. Allows fetching of thumbnail previews to improve the visual experience in the player interface.
Example thumbnail URL:
https://images.fastpix.io/{playbackId}/thumbnail.jpg?token={JWT}
Spritesheet token: Grants access to spritesheets for animations and interactive elements like
Example spritesheet URL:
https://images.fastpix.io/{playbackId}/spritesheet.jpg?token={JWT}
Passing a token to FP-Player for on-demand streams
To integrate a token with the FP-Player component for on-demand streams, you can include it in the player setup like this:
<fp-player
playback-id="playback-id"
token="JWT"
stream-type="on-demand"
/>
Replace playback-id
with the actual playback ID of your video and JWT
with your generated JSON Web Token.
Secured live streams
For live streaming, tokens secure real-time content delivery:
Playback token: Ensures that access to live video streams is authenticated. Allows the secure streaming of live video content, maintaining safety and reliability throughout the session.
Example signed playback stream URL:
https://stream.fastpix.io/{playbackId}.m3u8?token={JWT}
Tips on dynamic token management
Managing your tokens effectively is crucial for smooth media access and maintaining security. Here are some tips:
Handle token expiration: Implement mechanisms to handle expired tokens gracefully, so your stream isn’t interrupted.
Renew tokens automatically: Set up an automated process to renew tokens when needed or prompt users to refresh them as required.
Control permissions: Assign permissions based on user roles or subscription levels to limit unauthorized access and uphold your security policies.
Security best practices
Protecting your tokens and ensuring secure streaming involves following some essential practices:
Secure transmission: Always use HTTPS to encrypt your token data during transmission. This prevents interception and ensures that your data stays safe.
Limit token scope: Be precise about what a token can do. Limit the scope to specific functionalities, like playback or thumbnails, to minimize risk and stick to the principle of least privilege.
Playing signed URLs with custom domains
FastPix Player supports using signed URLs with custom domains, which allows you to personalize your media delivery while keeping security tight. This part explains how to combine signed URLs and custom domains for optimal streaming.
Custom domain signed URL examples
Playback stream:
https://stream. /${playbackId}.m3u8?token={JWT}
Thumbnail:
https://image./${playbackId}/thumbnail.jpg?token={JWT}
Spritesheet:
https://image./${playbackId}/spritesheet.jpg?token={JWT}
Configure the FastPix Player: To set up the player with a custom domain, specify the custom-domain attribute:
HTML Example
<fp-player
playback-id="PLAYBACK_ID"
token="JWT"
custom-domain="media.example.com"
</fp-player>
Benefits of using signed URLs with custom domains
Enhanced branding: Display media assets from your own domain (e.g., media.example.com
), this builds trust and reinforces your brand identity.
Improved performance: You can utilize CDNs linked with your custom domain for faster, more reliable media delivery.
Secure access: Continue to ensure that only authorized users can view your content using signed URLs.
Updated 2 days ago