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
Video.js is an extensible, open-source HTML5 video player designed for handling modern streaming formats. When combined with protocol-specific plugins, it supports adaptive bitrate (ABR) playback using HLS (HTTP Live Streaming) and MPEG-DASH (Dynamic Adaptive Streaming over HTTP). HLS streams are typically delivered in .m3u8 playlists, while DASH uses .mpd manifests referencing fragmented MP4 segments. Proper integration ensures seamless playback across varying network conditions and device capabilities, enabling browser-based delivery of live and on-demand video with efficient bitrate adaptation. Setting Up Video.js for HLS Playback HLS is a protocol for streaming video content over HTTP, especially for live events and VOD content. Video.js, when combined with the videojs-contrib-hls plugin, enables native HLS playback support within the player. Step 1: Install Video.js and HLS Plugin To begin, you include the Video.js library and the videojs-contrib-hls plugin. These components allow Video.js to support HLS playback across modern browsers.
Explanation: The Video.js library provides the core functionality for video playback. The videojs-contrib-hls plugin enables HLS support by providing the necessary mechanisms to parse and play M3U8 playlists. Step 2: Configure Video.js Player for HLS Once the necessary libraries are loaded, you can instantiate a Video.js player and configure it to use an HLS stream.
Explanation: The data-setup='{}' initializes the player with default settings. The
tag points to the .m3u8 HLS playlist URL, which Video.js uses to stream the content. Step 3: Customize Player Options Video.js allows you to customize the player settings by adding configuration options. For example, you can enable autoplay, set the initial volume, or specify a particular resolution for the HLS stream. Explanation: autoplay: true: Automatically starts the video when it’s ready. techOrder: ['html5']: Specifies that the player should prioritize the HTML5 tech for playback. Setting Up Video.js for DASH Playback DASH is a flexible and efficient streaming protocol that uses fragmented MP4 (fMP4) segments for delivery. Video.js supports DASH playback via the videojs-contrib-dash plugin, enabling seamless adaptive bitrate streaming. Step 1: Install the DASH Plugin To enable DASH support, you need to install the videojs-contrib-dash plugin. This plugin allows Video.js to handle .mpd manifests and stream the video content.
Explanation: The videojs-contrib-dash plugin allows Video.js to interpret and play DASH streams provided via .mpd manifest files. Step 2: Configure Video.js Player for DASH Once the plugin is installed, you can configure the player to stream DASH content. Provide the .mpd URL as the source for the video.
Explanation: The type='application/dash+xml' attribute is necessary for the player to recognize and handle the .mpd manifest file correctly. Step 3: Customize Player Settings for DASH Just as with HLS, you can adjust various player options for the DASH stream. For example, enabling autoplay and defining playback quality levels: Explanation: autoplay: true: Automatically starts the video playback as soon as it's ready. techOrder: ['html5']: Ensures that Video.js uses the HTML5 tech for DASH playback. Handling Adaptive Bitrate (ABR) with Video.js Both HLS and DASH support Adaptive Bitrate Streaming (ABR), which dynamically adjusts the video quality based on the viewer's network conditions. Video.js automatically handles ABR for both HLS and DASH streams without requiring additional configuration. For HLS , the player fetches the appropriate stream segment from the playlist based on the viewer’s bandwidth. For DASH , the player switches between different bitrate representations specified in the .mpd file. Example Command for ABR in DASH with FFmpeg: ffmpeg -i input.mp4 \ -map 0:v -s:v:0 1920x1080 -b:v:0 5000k \ -map 0:v -s:v:1 1280x720 -b:v:1 3000k \ -map 0:v -s:v:2 854x480 -b:v:2 1500k \ -map 0:a -c:a aac -b:a 128k \ -f dash -dash_segment_filename 'segment_%03d.m4s' -master_pl_name 'master.mpd' output.mpd Explanation: This command generates a DASH stream with multiple bitrates for adaptive switching. -map 0:v -s:v:0 1920x1080 -b:v:0 5000k: Specifies the 1080p stream at 5Mbps. -f dash: Sets the output format to DASH. Error Handling and Debugging in Video.js When integrating Video.js with HLS or DASH, proper error handling and debugging are crucial for maintaining a smooth user experience. Both protocols can encounter issues such as network errors, broken streams, or unsupported formats. Video.js provides a range of events and methods for monitoring and troubleshooting these issues. Error Event Handling You can handle error events in Video.js by listening for the error event on the player: player.on('error', function() { var error = player.error(); console.log('Video.js Error: ', error); }); Explanation: This code listens for any errors during playback and logs the error information for further debugging. Video.js Debugging Tools Video.js provides built-in logging tools that can be useful for troubleshooting issues related to HLS or DASH playback: player.on('loadedmetadata', function() { console.log('Metadata loaded: ', player.mediainfo); }); Explanation: This logs the metadata of the loaded video, which helps verify the stream’s details and confirm that the correct source is loaded.