In this tutorial discuss about how to play video using IOS native player. so follow simple steps that have been given below. so open the terminal and run below command.
- $ ionic start tutorial sidemenu --type=ionic-angular
- $ cd tutorial/
- $ ionic cordova platform add ios
- $ cordova plugin add cordova-plugin-add-swift-support
- $ cordova plugin add cordova-plugin-hkvideoplayer
- $ ionic cordova run ios
To play video design play button in home, so edit home.html
<ion-header>
<ion-navbar>
<button ion-button menuToggle>
<ion-icon name=“menu”></ion-icon>
</button>
<ion-title>AV Player</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<button ion-button secondary (click)=“play()”>Play</button>
</ion-content>
To play video player edit home.ts as below
import { Component } from ‘@angular/core’;
import { NavController } from ‘ionic-angular’;
declare var HKVideoPlayer;
@Component({
selector: ‘page-home’,
templateUrl: ‘home.html’
})
export class HomePage {
constructor(public navCtrl: NavController) {
}
play() {
HKVideoPlayer.play(“http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4”);
}
}
Follow up with high-quality video tutorial on YouTube
this is a supeb..
Thank for visiting