Production-Ready Video Engine

Custom Video Player (CYP)

Zero-dependency universal video player architecture for HTML5 videos and YouTube streams with link privacy shielding, progressive disclosure, and 6 battle-tested developer UI presets.

Zero Runtime Bloat (24KB gz) S.O.L.I.D. Provider Architecture WCAG 2.2 AAA Contrast Stream Link Shielding Progressive Disclosure Autonomous Web Component Smart Ad Passthrough

Interactive Player Test Suite

Live Engine
Stream Presets:
Speed:
Mode:
Live Player Event Bus Monitor
[System] Initializing custom YouTube video player test suite...
Privacy & Link Shielding Guardrails Active: Context menus (contextmenu) and dragging are suppressed across all surfaces to shield raw video URLs from browser right-click copying. External third-party browser extension content scripts (such as content-youtube-embed.js) are trapped to maintain seamless execution.

Developer UI Models & Design Presets

1-Click Live Switch

Choose from 6 production-grade design presets tailored for specific sectors. Clicking any card immediately applies typography, backdrop blur, control geometry, and accent tokens to the live player above.

Glassmorphism
Frost Dock

Floating frosted-glass dock with 24px backdrop blur, translucent borders, and ambient electric cyan glow.

Radius: 16px Track: 4px Accent: #38bdf8
Modern Minimal
Floating Pill

Distraction-free floating pill dock with pure monochrome white highlights and slender 3px seeker track.

Radius: 24px Track: 3px Accent: #ffffff
Professional Studio
Broadcast

Broadcast workstation console with dark charcoal matte, studio amber tally, and monospace timecode.

Radius: 6px Track: 5px Accent: #f59e0b
Cyber Advanced
Sci-Fi HUD

Futuristic HUD console with sharp angular lines, high-tech status indicators, and neon cyan glow.

Radius: 2px Track: 4px Accent: #00ffcc
Cinema OLED
Champagne

Pure pitch-black canvas with warm champagne gold accent and subtle cinematic edge softness for movies.

Radius: 8px Track: 4px Accent: #d4af37
Classic Dark
Default

Standard neutral dark zinc video player with signature video red accent and balanced contrast.

Radius: 12px Track: 5px Accent: #e50914

Customization Studio & Live Code Generator

Interactive
Accent Highlight #e50914
Branding Watermark
Logo Opacity: 85%
Control Buttons Visibility
// Loading snippet...

Developer Implementation Guide

Documentation

Implementation patterns for React, Next.js, Vue 3, Svelte, and Native HTML.

1 React / Next.js Hook & Component

import React, { useEffect, useRef } from 'react';
import { createPlayer } from '@researcher-tizar/cyp-player';
import '@researcher-tizar/cyp-player/dist/player.css';

export function MyVideo({ videoId }) {
  const containerRef = useRef(null);
  const playerRef = useRef(null);

  useEffect(() => {
    if (!containerRef.current) return;
    const player = createPlayer({
      element: containerRef.current,
      videoId,
      preset: 'glass',
      lazy: true
    });
    playerRef.current = player;
    return () => player.destroy();
  }, [videoId]);

  return <div ref={containerRef} className="aspect-video w-full" />;
}

2 Autonomous Web Component

<!-- Import bundle -->
<script type="module" src="custom-youtube-player/dist/player.es.js"></script>
<link rel="stylesheet" href="custom-youtube-player/dist/player.css">

<!-- Use anywhere in HTML -->
<custom-youtube-player video-id="dQw4w9WgXcQ" preset="cinema" lazy="true">
</custom-youtube-player>

Easily extend the player with built-in or custom plugins using our lightweight plugin interface.

1 Built-In Plugins

import { 
  createPlayer, 
  resumePlugin, 
  chaptersPlugin, 
  keyboardPlugin, 
  gesturesPlugin 
} from '@researcher-tizar/cyp-player';

const player = createPlayer({
  element: '#player',
  videoId: 'dQw4w9WgXcQ',
  plugins: [
    resumePlugin(),       // Remembers position in localStorage
    keyboardPlugin(),     // Space, J, K, L, M, F, T shortcuts
    gesturesPlugin(),     // Mobile double-tap left/right seeking
    chaptersPlugin({      // Chapter markers & drawer
      chapters: [
        { time: 0, title: 'Intro' },
        { time: 45, title: 'Deep Dive' }
      ]
    })
  ]
});

2 Writing a Custom Plugin

const analyticsPlugin = () => ({
  name: 'analytics',
  install(player) {
    player.on('playing', () => console.log('Playback started'));
    player.on('ended', () => console.log('Playback finished'));
  },
  destroy(player) {
    // cleanup
  }
});

player.use(analyticsPlugin());

Public API Reference

TypeScript Typed
Method Parameters Description
player.play() None Starts or resumes playback. Returns Promise.
player.pause() None Pauses video playback.
player.togglePlay() None Toggles playback state between play and pause.
player.seekTo(sec) seconds: number Seeks to an exact timestamp in seconds.
player.seekBy(offset) offsetSeconds: number Seeks relative to current playback position (e.g. +10 or -10).
player.setVolume(val) volume: 0..100 Adjusts player audio volume.
player.setPlaybackRate(r) rate: 0.5..2.0 Sets playback speed rate (0.5, 0.75, 1, 1.25, 1.5, 1.75, 2).
player.load(target, sec?) target: string, start?: number Loads a new video by URL, video ID, or b64:... token.
player.applyPreset(name) preset: 'glass'|'minimal'|... Applies complete design model preset dynamically.
player.destroy() None Cleans up timers, event listeners, plugins, and removes DOM elements.

Autonomous Native Web Component Showcase

<custom-video-player>

Zero-setup Custom Element that works directly in vanilla HTML or any modern framework without wrapper libraries. Supports reactive attributes: src, video-id, preset, theme, accent-color, and radius.