I'm trying to add in-app video by following this tutorial: link
I did everything right I believe, but when I run the application with ionic serve -c, and open it on Ionic DevApp I get the message by clicking the PlayVideo button:
console.warn: Native: tried calling VideoPlayer.play, but the VideoPlayer plugin is not installed.
[15:49:16] console.warn: Install the VideoPlayer plugin: 'ionic cordova plugin add link '.
But I have the plugin installed, already removed and installed, I got to create other projects but always in the end returns this error as if it did not have the plugin installed. It still appears in "plugins". Does anyone know what this can be? Could it be from Ionic DevApp? I have no emulator to test, only devapp. And I have not found many tutorials on how to video in the app. I will actually add an image, and clicking on it play the video, a real "advertisement". But at first I'm trying to add the video. If anyone can help me, I will be very grateful. Thanks!
My Home.Ts code is:
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { VideoPlayer, VideoOptions } from '@ionic-native/video-player';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
videoOptions: VideoOptions;
videoUrl: string;
constructor(private videoPlayer: VideoPlayer, public navCtrl: NavController) {
}
async playVideo() {
try {
this.videoOptions = {
volume: 0.7
}
this.videoUrl = "http://techslides.com/demos/sample-videos/small.mp4"
this.videoPlayer.play(this.videoUrl, this.videoOptions)
}
catch (e) {
console.error(e);
}
}
}