Using Fluid Player with Angular
app.component.html
<video #ref>
<source
src="https://cdn.fluidplayer.com/videos/valerian-1080p.mkv"
data-fluid-hd
title="1080p"
type="video/mp4"
>
</video>app.component.ts
import {AfterViewChecked, Component, ElementRef, ViewChild} from '@angular/core';
import fluidPlayer from 'fluid-player';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements AfterViewChecked {
fluidPlayer: any;
@ViewChild('ref') ref!: ElementRef;
ngAfterViewChecked() {
if (!this.fluidPlayer) {
this.fluidPlayer = fluidPlayer(this.ref.nativeElement);
}
}
}angular.json
Was this helpful?