VideoPlayer plugin from ionic native is not working


#1

Hi,

I need to open a native video player to play the video from local file storage or directly streamed from server. I installed VideoPlayer plugin but it has started complaining in console as follows.

Native: tried calling t.play, but the t plugin is not installed. main.js:181
Install the t plugin: ‘ionic plugin add cordova-plugin-videoplayer’ main.js:186
plugin_not_installed

I have written a code as follows:

 import { VideoPlayer } from 'ionic-native';
  playVideo(): void {
    VideoPlayer.play("http://player.vimeo.com/external/85569724.sd.mp4?s=43df5df0d733011263687d20a47557e4")
    .then(() => {
      console.log('video completed');
    }).catch(err => {
      console.log(err);
    });
  }

Please point me any resources telling any other way to invoke native video player.


#2

same problem, why is this not working, and why isn’t ionic support not responding to this?


#3

Well, we may better create an issue on the ionic native project on github. I did so:


#4

If you’re still having problems, i used this plugin instead, https://ionicframework.com/docs/v2/native/streamingmedia/

If you point to a media (fileEntry.toURL()) on the file system it works.


#5

The streamingmedia plugin api does not have a way to close / stop the video while it’s playing. Any idea if there’s another plugin that allows you to play and stop the video before it ends?

Thank you!