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
Web component-based video players implement video playback using custom HTML elements. These elements encapsulate the player’s structure, styles, and behavior, allowing the player to function as an independent module. This design uses browser-native features such as Custom Elements and Shadow DOM to isolate the component’s internals and enable consistent behavior across different web environments. Architecture 1. Custom Elements Custom elements allow defining new HTML tags representing the video player. The player’s functionality and markup are encapsulated within this element class, registered with the browser’s CustomElementRegistry. For example, a simple video player can be created by extending HTMLElement and defining the player’s markup in the connectedCallback lifecycle method: class MyVideoPlayer extends HTMLElement { connectedCallback() { this.innerHTML = `
`; }} customElements.define('my-video-player', MyVideoPlayer); This registers the
tag, which can then be used in HTML to embed a video player with a specified src attribute. 2. Shadow DOM The Shadow DOM provides encapsulation for the component’s internal DOM and styles. By attaching a shadow root, the component ensures that its styles and markup are isolated from the global document, preventing CSS conflicts and unintended side effects. Example: const shadow = this.attachShadow({ mode: 'open' }); shadow.innerHTML = `
Here, the video player’s styles apply only within the shadow root, isolating them from other page styles. This encapsulation also protects component scripts from external interference. 3. Attributes & Observed Properties Web components can react to changes in their attributes, enabling dynamic updates. By specifying which attributes to observe via observedAttributes, the component can respond to changes with attributeChangedCallback. static get observedAttributes() { return ['src']; } attributeChangedCallback(name, oldValue, newValue) { if (name === 'src' && this.videoEl) { this.videoEl.src = newValue; } } This allows updating the video source dynamically by changing the src attribute on the custom element. The component internally updates the video element’s src accordingly, keeping the UI in sync with attribute changes. Advantages Framework Agnostic Since web components are based on standard HTML APIs, they can be used in any frontend environment—whether React, Vue, Angular, or plain HTML—without modification. This allows developers to write the player once and reuse it across diverse projects without concern for framework compatibility. Example usage:
Encapsulation Shadow DOM encapsulation isolates the player’s CSS and JavaScript from the parent document and other components. This isolation prevents CSS selectors and JavaScript code from leaking out or being affected by the surrounding page, reducing styling conflicts and ensuring predictable behavior. Maintainability Encapsulating player logic within a self-contained component improves maintainability. It becomes easier to update, debug, or extend the player without impacting unrelated parts of the application. For example, adding new features such as subtitle support or analytics hooks can be done inside the component’s codebase independently. Reusability Once developed, a web component video player can be reused across multiple pages or applications without rewriting logic or duplicating code. This promotes code reuse and consistency, streamlining development workflows and reducing redundancy. Event Handling and Integration Web components can dispatch and listen for events like standard DOM elements, enabling external scripts or frameworks to respond to internal state changes or user interactions. This is especially important for embedding the player into complex applications or analytics systems. Dispatching Custom Events The component can communicate with its parent or external context by dispatching custom events via the dispatchEvent method. This approach provides a structured mechanism to notify external listeners of significant player events such as play, pause, or seek. Example: this.videoEl.addEventListener('play', () => { this.dispatchEvent(new CustomEvent('videoplay', { detail: { currentTime: this.videoEl.currentTime }, bubbles: true, composed: true })); }); Explanation: bubbles: true: Allows the event to propagate up the DOM tree. composed: true: Allows it to cross the Shadow DOM boundary. Now, a developer can listen to the videoplay event:
Receiving External Commands Web components can expose public methods or properties to accept commands from outside, allowing controlled interaction with the player’s internal elements. This enables operations like play, pause, or seeking without exposing the internal DOM structure. Example: class MyVideoPlayer extends HTMLElement { get videoEl() { return this.shadowRoot.querySelector('video'); } play() { this.videoEl.play(); } pause() { this.videoEl.pause(); } } Usage: document.getElementById('player').play(); This enables interaction from external scripts or other components in a structured and controlled way, avoiding DOM queries inside Shadow DOM. Integration with Frameworks To integrate web components seamlessly with popular frontend frameworks, specific patterns are recommended for method access and event handling: React: Use ref to access component methods directly and add event listeners using addEventListener . Vue: Pass data and configuration via attributes and listen for custom events with native event listeners. Angular: Register the component as a custom element and listen for events similarly to Angular’s @Output() pattern by using native event binding. React Example:
useEffect(() => { const player = playerRef.current; player.addEventListener('videoplay', (e) => console.log(e.detail)); }, []);