capacitor-community / capacitor-community/native-audio

Android Audio loop not work

Open
#37 6 comments 4 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
154
Forks
78
PR merge metrics
No merged PRs in 30d

Description

When I call the loop method, the sound is not played.
Only Android

**To Reproduce**
Steps to reproduce the behavior:
Angular Call
await NativeAudio.loop({assetId:soundToPlay.key});

**Expected behavior**
sound should be played

**Smartphone (please complete the following information):**
- Device: Gigaset GS270 plus
- OS: Android 8.1.0

**Problem located**
There was no exception.

File: AudioDispatcher.java line 93
`public void loop() throws Exception {
mediaPlayer.setLooping(true);
}`

I fix the problem with this change
`public void loop() throws Exception {
mediaPlayer.setLooping(true);
mediaPlayer.start();
}`

I don't know if this is the right place but it works.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.