Media Angular
Angular standalone video player, image components, and infinite media feeds for Rixl, with typed inputs, outputs, and player injection.
Angular standalone video player, image components, and infinite media feeds for Rixl. @rixl/media-angular provides typed inputs, outputs, and player dependency injection over the shared Rixl media UI.
What you get
- Adaptive HLS playback, captions, quality selection, fullscreen, and picture-in-picture.
- Images with lazy loading and ThumbHash placeholders when available.
- Vertical media feeds with pagination, looping, and automatic advancement.
- Standalone Angular components with typed events and per-player injection.
- Included player styles; no Tailwind CSS setup or
CUSTOM_ELEMENTS_SCHEMAis needed when using the Angular wrappers.
Install
npm install @rixl/media-angularRequires Angular 20 or later, including @angular/core and @angular/common. Core and Lit are included as dependencies. The examples below target browser applications.
Connect before rendering
Add a browser application initializer to your existing app configuration so media mounts after authentication:
// app.config.ts
import {provideAppInitializer, type ApplicationConfig} from "@angular/core";
import {connect} from "@rixl/media-angular/core";
export const appConfig: ApplicationConfig = {
providers: [
provideAppInitializer(() =>
connect({
baseUrl: "https://api.rixl.com",
apiKey: "YOUR_PUBLIC_API_KEY",
})
),
],
};Keep your application's other providers. Use credentials intended for browser access. If your host already authenticates the shared @rixl/sdk client, reuse that connection instead.
Add media components
import {Component} from "@angular/core";
import {ImageComponent} from "@rixl/media-angular/image";
import {VideoComponent} from "@rixl/media-angular/video";
import {FeedComponent} from "@rixl/media-angular/feed";
@Component({
selector: "app-media",
standalone: true,
imports: [ImageComponent, VideoComponent, FeedComponent],
template: `
<rixl-media-video id="YOUR_VIDEO_ID" [muted]="true" class="player" />
<rixl-media-image id="YOUR_IMAGE_ID" alt="Mountain lake at sunrise" class="image" />
<rixl-media-feed feedId="YOUR_FEED_ID" [muted]="true" class="feed" />
`,
styles: `
.player,
.image {
display: block;
width: 100%;
aspect-ratio: 16 / 9;
}
.feed {
display: block;
height: 36rem;
}
`,
})
export class MediaComponent {}Production components request media by id or feedId through the SDK. Boolean inputs use normal Angular property binding, such as [muted]="false".
Events and custom controls
Video outputs include play, pause, ended, pausedChange, loadingChange, timeUpdate, loadedMetadata, volumeChange, rateChange, qualityChange, and error. Image emits loadingChange; Feed emits muteChange and mutedChange.
<rixl-media-video id="YOUR_VIDEO_ID" (pausedChange)="onPausedChange($event)" />pausedChange and loadingChange emit booleans. Use VideoPlayerComponent (<rixl-media-video-player>) to share one player with sibling controls. Custom controls can call injectPlayerId() or injectOptionalPlayerId() from /video; use /core for player state and actions. Each media component exposes its underlying Lit element.
Styling and imports
Use host class and style for dimensions and layout. Player styles live in shadow DOM; application CSS does not select internal controls. Give images and videos a height or aspect ratio, and feeds a height.
| Import | Exports |
|---|---|
@rixl/media-angular/image | ImageComponent, RixlImageComponent |
@rixl/media-angular/video | VideoComponent, VideoPlayerComponent, aliases, and player injection helpers |
@rixl/media-angular/feed | FeedComponent, RixlFeedComponent |
@rixl/media-angular/core | Headless APIs, stores, utilities, and types |
@rixl/media-angular | Components and Core exports |
An image-only subpath import excludes video, feed, and HLS code. For documented React or Astro server-rendering integrations, see the SDK overview.