0.0.4 ⢠Published 3 years ago
ion-video-player v0.0.4
š Table of Contents
ā Prerequisites
The current version of the library is compatible with Ionic 6+.
ā¬ļø Install
Using npm
npm install ion-video-player --saveUsing yarn
yarn add ion-video-playerš Setup
Once installed you need to import our module in the parent module for the component you will be using it in:
import { IonVideoPlayerModule } from 'ion-video-player';
@NgModule({
...
imports: [IonVideoPlayerModule, ...],
...
})
export class YourModule {
}Usage
Include the component on page template, like the example below:
<ion-video-player [options]="{
src: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
type: 'video/mp4',
poster:'https://via.placeholder.com/500x400',
controls: true,
autoplay: false,
muted: false
}"
(play)="yourEvent()"
(pause)="yourEvent()"
(ended)="yourEvent()"
(volumechange)="yourEvent()"
(playing)="yourEvent()"
(error)="yourEvent()"
(error)="yourEvent()"
></ion-video-player>API
Properties
- options
- src:
stringany valid video link/path - type:
stringvideo mimetype. e.g:'video/mp4' - poster:
stringany valid poster image link/path - controls:
booleanshow constrols on video element - autoplay:
booleanauto play video - muted:
booleanto mute video
CSS
Apply css to video element.
::ng-deep .ion-video-player{
width: 100%!important;
height: 400px!important;
}Author
š¤ Najam Us Saqib
- Github: @saqib92
š¤ Contributing
Contributions, issues and feature requests are welcome! Feel free to check issues page.
Show your support
Give a āļø if this project helped you!