简体   繁体   English

Ionic2没有本机插件

[英]Ionic2 with no native plugins

I'm trying to use a non native audio plugin, because this is the only one I found that measures the DB while recording. 我正在尝试使用非原生音频插件,因为这是我发现的唯一一个在录制时测量数据库的插件。

Plugin: https://github.com/remoorejr/cordova-plugin-media-with-compression 插件: https//github.com/remoorejr/cordova-plugin-media-with-compression

The thing is, that I'm pretty sure that I need to import the plugin into the .ts file, but I don't know how. 问题是,我很确定我需要将插件导入.ts文件,但我不知道如何。 The plugin is already installed. 该插件已安装。

Any clue how to use this plugin with Ionic2?? 任何线索如何使用这个插件与Ionic2?

Thank you!! 谢谢!!

Though never used this particular plugin. 虽然从未使用过这个特定的插件。 Install it by 安装它

ionic plugin install cordova-plugin-media-with-compression --save

save should add an entry in config.xml . save应该在config.xml添加一个条目。

Its global object seems to be window.Media . 它的全局对象似乎是window.Media

So in your component , do: 所以在你的组件中 ,做:

//import statements
    declare var window:any;
@Component({..})

And call the plugin functions within platform.ready().then 然后在platform.ready().then调用插件函数

this.platform.ready().then(()=>{
   window.Media.fun()
})

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM