DPlayer for Angular
npm install angular-dplayer




> An Angular 6.x video player component based on DPlayer.
``bash`
npm install angular-dplayer --save
#### Example Browser App Usage
> style.css
`css`
@import "~dplayer/dist/DPlayer.min.css";
> app.module.ts
`typescript
import { DPlayerModule } from 'angular-dplayer';
@NgModule({
imports: [
// DPlayerModule // Or
DPlayerModule.forRoot({ // Global config
autoplay: true // All player can autoplay by default
})
]
})
`
> app.component.ts
`typescript
import { Component } from '@angular/core';
import { DPlayerService } from 'angular-dplayer';
@Component({
selector: 'app-root',
template:
})
export class AppComponent {
constructor(
private DPService: DPlayerService
) {
}
onResize() {
console.log('resize');
}
}
`
#### Attribute Like A Native Video Element
`angular2html`
#### Advanced Usage
> enable hls or dash suppot by directive
`angular2html`
> FLV Live Stream
`angular2html`
> control video status
`typescript
import { Component } from '@angular/core';
import { DPlayerService } from 'angular-dplayer';
@Component({
selector: 'app-root',
template:
})
export class AppComponent {
constructor(
private DPService: DPlayerService
) {
}
onResize(player) {
player.pause();
}
}
``
This content is released under the MIT License.