Releases: jhonsferg/ngx-streaming-player
Releases · jhonsferg/ngx-streaming-player
v1.0.0
First stable release of ngx-streaming-player.
Added
Core architecture
- Adapter pattern isolating protocol-specific logic from the component tree (
IPlayerAdapterinterface) PlayerServiceas the orchestrator: detects protocol, creates the right adapter, and exposes a unified APIPlayerStateServicewith fully reactive state via Angular Signals (signal,computed)NgxPlayerControlServicefor programmatic control from anywhere in the app
Protocol adapters
- HlsAdapter - HLS streaming via
hls.jswith quality levels, live detection viaLEVEL_LOADED, and subtitle track support viaSUBTITLE_TRACKS_UPDATED - DashAdapter - DASH streaming via
dash.jswith quality levels, live detection viaisDynamic(), and subtitle track support viagetTracksFor('text') - NativeAdapter - MP4 / native browser video with WebVTT subtitle detection via
loadedmetadata - YouTubeAdapter - YouTube iFrame API with quality sync, captions module, PiP guard (iframe API restriction)
Angular provider pattern
providePlayer(...features)- configure the player globally inapp.config.tsusingmakeEnvironmentProviders()withTheme(theme)- set a globalPlayerThemeapplied to every<ngx-sp-player>in the appwithDefaults(config)- set globalPlayerConfigdefaults; per-player[config]and shorthand inputs take prioritywithTranslations(translations)- localise all UI strings; any key omitted keeps its English default
Component inputs
[src],[config],[theme],[autoplay],[muted],[volume],[playbackRates],[enablePiP],[enableKeyboard],[playerId],[controlsLayout]- Priority layering:
withDefaults()<[config]< shorthand inputs;withTheme()<config.theme<[theme]
Component outputs
(playerReady),(play),(pause),(ended),(timeUpdate),(volumeChange),(error),(fullscreenChange),(pipChange),(qualityChange),(subtitleChange)
UI components
<ngx-sp-player>main player with 3-ring counter-rotating loading spinner and pulsing play buttonPlayerControlsComponentwith left/right control groups, separator, andhasSettingsguardNgxSpButtonComponent- ripple effect, tooltip with arrow, modifier classes for play/pause/skip/PiP/active statesNgxSpProgressBarComponent- hover tooltip with time preview, drag-outside-bounds support viadocument:mousemoveNgxSpVolumeControlComponent- custom CSS gradient fill via--volproperty, volume badge on hoverNgxSpSettingsMenuComponent- gear spin animation, quality / speed / subtitles sub-panelsNgxSpTimeDisplayComponent- tabular-nums, current / total with opacity contrast- Quality row hidden automatically when no quality levels are available
Subtitles system
SubtitleTrackmodel (id,label,language)setSubtitle(id)onPlayerServicedelegates to the active adapter- Language selector in the settings menu, conditional on
supportsSubtitles()
Picture-in-Picture
- Native browser PiP API guarded by
readyState >= 1 supportsPiPsignal; YouTube automatically sets it tofalse
Hot-swap source
- Changing
[src]or callingNgxPlayerControlService.load()tears down the current adapter and initialises a new one; volume and mute state are preserved
Live stream
- Animated LIVE badge, speed selector hidden, progress bar hidden for live streams
CSS theming
--ngx-sp-*CSS custom property system (primary, secondary, accent, bg, text, radius, control-size, fonts, shadows)applyTheme()scopes variables to the container element, never the document root
Keyboard shortcuts
k/Space- play/pause,ArrowLeft/ArrowRight- seek -5s / +5s,ArrowUp/ArrowDown- volume,m- mute toggle,f- fullscreen,p- PiP
Multi-player
- Each
<ngx-sp-player>instance gets its ownPlayerServiceandPlayerStateServicevia component-levelproviders
Documentation
- Live showcase app deployed to GitHub Pages
- Full API reference with tables for all inputs, outputs,
PlayerConfig,PlayerTheme,PlayerTranslations,providePlayer(),NgxPlayerControlService, and CSS variables