Learn how to integrate Fermion recorded videos into your website using our SDK, including public and private video embedding options.
This guide explains how to embed recorded videos into external websites using the Fermion SDK.
The Fermion SDK is open source and available on GitHub: github.com/fermion-app/sdk
First, go to Manage features
tab on your instructor dashboard and enable Video library
:
After that, go to Video library
and upload a video if you haven’t:
Each video on Fermion has a unique identifier (e.g., 6779080e80ec97e953a17971
). You’ll need this ID for embedding.
For public videos, you can use the following code:
If your video is not public, you’ll need to generate a JWT token for authentication:
Important notes: - Replace FERMION_API_KEY
with your actual API key -
Provide a unique user ID for each viewer - Recommended token validity is
10h-20h
Then use the token to embed the video:
Once the video is embedded, you can control its playback programmatically using the play()
and pause()
methods.
The SDK automatically assigns a unique ID to the iframe when you use
getPubliclyEmbedPlaybackIframeCode
or getPrivateEmbedPlaybackIframeCode
.
This allows play()
and pause()
to find the iframe automatically without
you passing the iframe element.
If you have multiple videos or a custom iframe setup, you can pass the iframe element directly to the methods:
Track video playback events using the SDK’s event system:
Event listeners only work when using the Fermion video player through
getPubliclyEmbedPlaybackIframeCode
or getPrivateEmbedPlaybackIframeCode
.
They are not available when using manual M3U8 playback.
For security, all Fermion videos are encrypted using AES-128 (clearkey) encryption. The Fermion video player, embedded via the iframe methods, handles the decryption process seamlessly. We highly recommend using the default Fermion player as it is robust, production-ready, and provides a user-friendly experience out of the box.
However, for advanced use cases where you need to integrate the video into your own custom video player (like HLS.js, Video.js, etc.), you can get the M3U8 playback URL. The getM3U8PlaybackUrl
method fetches the M3U8 manifest, patches it with the necessary decryption key, and returns a blob URL that your player can use.
DRM-protected videos can only be played using the Fermion iframe embed. The custom M3U8 playback method does not support DRM at this time.
To get the playback options (origin, m3u8Pathname, decryptionKey,
signedUrlSearchParams), you need to call the
get-signed-url-data-for-recorded-video-playback
API endpoint from your
backend server with your Fermion API key. Refer to API
Reference for
more information.