audio_player_plugin 1.0.3 copy "audio_player_plugin: ^1.0.3" to clipboard
audio_player_plugin: ^1.0.3 copied to clipboard

PlatformAndroid

A Flutter plugin that provides play audio functionality

接入步骤 #

1.在pubspec.yaml中添加依赖. #

audio_player_plugin: ^x.x.x(x.x.x请替换为实际版本号)

2.打开项目目录下的android/build.gradle文件,添加内部maven仓库地址。 #

allprojects {
repositories {
...//已有仓库
//内部maven仓库
maven { url 'http://maven.wosai-inc.com/nexus/content/groups/public/'
allowInsecureProtocol = true}
maven { url 'http://nexus.wosai-inc.com/nexus/content/repositories/snapshots/'
allowInsecureProtocol = true}
}}

3.运行flutter pub get拉取插件。 #

4.使用。 #

4.1 项目启动初始化音频。
AudioPlayer.instance.bindPlayerAudio();
4.2 启用音频。
AudioPlayer.instance.setPlayEnable(true);
4.3 播放音频,支持按队列播放。
AudioPlayer.instance.playAudio("50",count: 2);
4.4 解绑操作。
AudioPlayer.instance.unBindPlayerAudio();

如果想自行实现语言播放器,可参考文档:https://sqb.feishu.cn/docx/TRISdTiIboTr7yxO0jScKOlSnph

0
likes
115
points
35
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin that provides play audio functionality

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on audio_player_plugin