Products
Products
Video Hosting
Upload and manage your videos in a centralized video library.
Image Hosting
Upload and manage all your images in a centralized library.
Galleries
Choose from 100+templates to showcase your media in style.
Video Messaging
Record, and send personalized video messages.
CincoTube
Create your own community video hub your team, students or fans.
Pages
Create dedicated webpages to share your videos and images.
Live
Create dedicated webpages to share your videos and images.
For Developers
Video API
Build a unique video experience.
DeepUploader
Collect and store user content from anywhere with our file uploader.
Solutions
Solutions
Enterprise
Supercharge your business with secure, internal communication.
Townhall
Webinars
Team Collaboration
Learning & Development
Creative Professionals
Get creative with a built in-suite of editing and marketing tools.
eCommerce
Boost sales with interactive video and easy-embedding.
Townhall
Webinars
Team Collaboration
Learning & Development
eLearning & Training
Host and share course materials in a centralized portal.
Sales & Marketing
Attract, engage and convert with interactive tools and analytics.
"Cincopa helped my Enterprise organization collaborate better through video."
Book a Demo
Resources
Resources
Blog
Learn about the latest industry trends, tips & tricks.
Help Centre
Get access to help articles FAQs, and all things Cincopa.
Partners
Check out our valued list of partners.
Product Updates
Stay up-to-date with our latest greatest features.
Ebooks, Guides & More
Customer Stories
Hear how we've helped businesses succeed.
Boost Campaign Performance Through Video
Discover how to boost your next campaign by using video.
Download Now
Pricing
Watch a Demo
Demo
Login
Start Free Trial
Encrypted Media Extensions (EME) is a W3C standard API designed to enable secure media playback in web browsers. EME works with Digital Rights Management (DRM) systems to securely deliver encrypted video and audio content. By integrating EME into HTML5 video players, web developers can implement content protection strategies that ensure only authorized users can access and view protected media. This API provides a secure way to interact with external DRM systems like Widevine, PlayReady, and FairPlay. Key Components of EME Media Key System Access To enable secure streaming, a web application needs to request access to a media key system that supports the selected DRM system. The key system controls the encryption and decryption of content during playback. const config = { initDataTypes: ['cenc'], audioCapabilities: [{ contentType: 'audio/mp4; codecs='mp4a.40.2'' }], videoCapabilities: [{ contentType: 'video/mp4; codecs='avc1.4d401e'' }], }; navigator.requestMediaKeySystemAccess('com.widevine.alpha', [config]) .then(keySystemAccess => { console.log('Key system access granted', keySystemAccess); }) .catch(error => { console.error('Error requesting key system access', error); }); Explanation : initDataTypes: Specifies the types of initialization data for the key system. audioCapabilities and videoCapabilities: Describe the supported audio and video formats. requestMediaKeySystemAccess: Requests permission from the browser to use a specific DRM system. Creating Media Keys and Media Key Sessions Once access is granted, the next step is to create media keys and establish a media session. This session handles the actual encryption and decryption of content. keySystemAccess.createMediaKeys() .then(mediaKeys => { console.log('Media keys created'); return videoElement.setMediaKeys(mediaKeys); }) .catch(error => { console.error('Error creating media keys', error); }); Explanation : createMediaKeys: Creates the media keys required for decryption. setMediaKeys: Assigns the keys to a video element to manage decryption. License Acquisition for Decryption In order to decrypt the content, a valid license must be requested from the licensing server. This license contains the keys necessary to decrypt and play the content. const mediaKeySession = mediaKeys.createSession(); mediaKeySession.generateRequest('license', initData) .then(() => { console.log('License request generated'); }) .catch(error => { console.error('Error generating license request', error); }); Explanation : createSession: Creates a new session to handle the license. generateRequest: Sends a request to the licensing server to acquire the license. License Handling and Decryption Decryption and Playback Control After acquiring the license, the player can decrypt the content and begin playback. If the license is invalid or expired, the video will not be able to start. mediaKeySession.addEventListener('message', event => { const message = event.message; // Send this message to the licensing server // The server will send a license or response to continue playback }); Explanation : message event: Fired when a response is received from the licensing server, containing a license or an error message. Handling Errors and License Expiry It is important to handle errors such as expired licenses. If the license expires or cannot be retrieved, the video will stop playing, and the player should handle this gracefully by providing the user with appropriate feedback. mediaKeySession.addEventListener('error', event => { console.error('Error with media key session: ', event); }); Explanation : error event: Listens for errors that occur during the license or decryption process. Integration with Media Source Extensions (MSE) For efficient video streaming, MSE can be used alongside EME to deliver encrypted video content. MSE allows the browser to dynamically load media segments as they are received from the server. const mediaSource = new MediaSource(); const videoElement = document.querySelector('video'); videoElement.src = URL.createObjectURL(mediaSource); mediaSource.addEventListener('sourceopen', () => { const sourceBuffer = mediaSource.addSourceBuffer('video/mp4; codecs='avc1.4d401e''); // Append decrypted video segments to the source buffer }) Explanation : MediaSource: Used to create a streamable source for the video element. addSourceBuffer: Adds a source buffer for media segments (e.g., video). Security Best Practices for EME Integration 1. License Management Ensure that licenses are securely retrieved and stored. Licenses should be short-lived and periodically renewed to maintain secure access. Consider using encrypted storage for license data to avoid exposure. 2. Session Management Manage media key sessions efficiently by limiting their lifetime and ensuring they are cleaned up properly once the session is no longer needed. Always ensure sessions are terminated once playback finishes. 3. Fallback for Unsupported Browsers Provide fallback solutions for browsers that do not support EME or the DRM systems in use. Consider using older video playback methods or notifying users that their browser is incompatible. if (!document.pictureInPictureEnabled) { alert('Your browser does not support EME or the required DRM system. Please update or switch browsers.'); } Explanation : This ensures users without support for EME or the required DRM systems are properly informed.