I checked MediaPlugin with ionic-native 1.3.10 and it worked. But with v 2.0.3, it doesn't work. Please check again.
What is the error that you're getting?
I have installed cordova plugin media, ionic-native v2.0.3
import { MediaPlugin } from 'ionic-native';
......
check(){
let file = new MediaPlugin('path');
file.play();
}
but it doesn't work.
And when I try with old project with ionic-native v1.3.10. It works. Please help me
It doesn't show error. But it seems new MediaPlugin doesn't create
What version of TypeScript are you using?
It has version 2.0.3
Ok I figured the issue out, it's a mistake with my last commit to the media plugin.
I will fix it soon, in the meanwhile, you can call file.status.subscribe(()=>{}); before you attempt to play it.
Fixed in https://github.com/driftyco/ionic-native/commit/58a99a14d50b7de24d7236e2fd2006004d87976f and will be available in the next release
@ihadeed thank you so much
I'm getting ORIGINAL EXCEPTION: TypeError: undefined is not an object (evaluating 'pluginObj._objectInstance')
on file.init.then
Makes sense?
This is fixed in master. Will be available in next release.
As of now, you need to call .status.subscribe() right after creating a new
MediaPlugin in order to get it to work.
On Oct 3, 2016 12:56 AM, "thomas marban" [email protected] wrote:
I'm getting ORIGINAL EXCEPTION: TypeError: undefined is not an object
(evaluating 'pluginObj._objectInstance')
on file.init.thenMakes sense?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/driftyco/ionic-native/issues/610#issuecomment-251026569,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANJ8dK4ykaeKJWs_b-zLCzRBs090E2Jkks5qwIrjgaJpZM4KL0KE
.
Please update to latest ionic-native version, this is fixed now.
Most helpful comment
Fixed in https://github.com/driftyco/ionic-native/commit/58a99a14d50b7de24d7236e2fd2006004d87976f and will be available in the next release