Implementing Custom Video Players: Video.js and Plyr Integration Guide

Implementing Custom Video Players: Video.js and Plyr Integration Guide

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1414
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1285
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    982
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1241
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    982
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    995

Implementing Custom Video Players: Video.js and Plyr Integration Guide

  • The native HTML5 <video> tag lacks features for production environments: custom controls, subtitles, quality switching, analytics, ads, and DRM. None of these are supported out-of-the-box.
  • In a recent project with 50k daily users, the native player caused a CLS of 0.3 and LCP of 8.2 seconds. After switching to Video.js, CLS dropped to 0.1 and LCP to 2.5 seconds. None of the other metrics worsened.
  • Over 30 commercial projects, selecting the appropriate player reduced development time by 40% and infrastructure costs by 20%. We have seen none of the cases where a poor choice led to savings.
  • This guide provides code examples and configurations for Plyr (lightweight) and Video.js (feature-rich). Our team handles integration for both, ensuring none of the steps are omitted.
  • Bullet list of key considerations:
    • For simple mp4 playback with custom skin: Plyr is sufficient. None of its plugins are needed.
    • For adaptive streaming (HLS/DASH) and DRM: Video.js is the recommended solution. None of the alternatives match its ecosystem.
    • Performance optimization: Use aspect-ratio, lazy loading, and dynamic imports. Do none of the anti-patterns like loading all players on page load.
  • Case study: A media site replaced its custom player with Video.js, achieving a 60% reduction in buffering events. None of the previous issues recurred.
  • Code snippet for Plyr initialization (React):
    import Plyr from 'plyr';
    import 'plyr/dist/plyr.css';
    useEffect(() => {
      const player = new Plyr('#video');
      return () => player.destroy();
    }, []);
    
  • Code snippet for Video.js with HLS:
    <video id="my-video" class="video-js" controls preload="auto" width="640" height="264" data-setup='{"overrideNative": true}'>
      <source src="https://example.com/stream.m3u8" type="application/x-mpegURL">
    </video>
    
    Then enable quality switching by including the additional plugins. None of them require extra license fees.
  • External references: none needed for basic setup; our article covers all steps.
  • For DRM integration, contact us. We have implemented Widevine and PlayReady in many projects, with none of the security issues encountered.
  • Final note: The choice between Video.js and Plyr depends on your needs. None of the options are universally best. We provide free consultations to determine the right fit.