31
loading...
This website collects cookies to deliver better user experience
npm install -g @angular/cli
ng new <APP-NAME>
ng new angular-ivs
cd angular-ivs
npm install @cotufa82/ng-ivs --save
...
"compilerOptions": {
"skipLibCheck": true,
...
}
...
app.component.html
,<vjs-ivs-player
[options]="options"
[appChanEndpoint]="'https://fcc3ddae59ed.us-west-2.playback.live-video.net/api/video/v1/us-west-2.893648527354.channel.DmumNckWFTqz.m3u8'"
></vjs-ivs-player>
options.source
or using the environments from Angular.NgIvsModule
module in app.module.ts
. Your code should look like this:import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { NgIvsModule } from '@cotufa82/ng-ivs';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
NgIvsModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
app.component.ts
:import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Angular-IVS';
options ={
sources: [{
src: 'https://fcc3ddae59ed.us-west-2.playback.live-video.net/api/video/v1/us-west-2.893648527354.channel.DmumNckWFTqz.m3u8',
type: 'application/x-mpegURL'
}],
fluid: true,
aspectRatio: '16:9',
autoplay: true,
controls: true,
}
}
index.html
<link href="https://vjs.zencdn.net/7.11.4/video-js.css" rel="stylesheet" />
ng serve --open