native-audio icon indicating copy to clipboard operation
native-audio copied to clipboard

[Bug] Play remote sound

Open yacut opened this issue 4 years ago • 8 comments

Describe the bug The remote sound does not play on iOS

To Reproduce Steps to reproduce the behavior:

import { Plugins } from "@capacitor/core";

const { NativeAudio } = Plugins;

NativeAudio.preloadSimple({
  assetPath: "https://actions.google.com/sounds/v1/alarms/bugle_tune.ogg",
  assetId: "bugle_tune",
});

NativeAudio.play({
  assetId: "bugle_tune",
});

setTimeout(() =>
  NativeAudio.unload({
    assetId: "bugle_tune",
  })
, 5000);

Expected behavior Remote sound is played

Actual behavior Remote sound is not played

ERROR MESSAGE:  {"errorMessage":"","message":"Asset Path is missing"}

Smartphone:

  • Device: iPhone SE simulator
  • OS: iOS13.6/14
  • Version 0.1.3

yacut avatar Sep 19 '20 11:09 yacut

I don't think http resources are supported (see #10). The docs are misleading.

jsmith avatar Sep 21 '20 10:09 jsmith

I think it would be a significant feature to add

claudiomerli avatar Mar 18 '22 11:03 claudiomerli

Same thing, it doesn't work for me for https:// source, so my workaround was just to use html audio tag:

<audio id="audioDev" src="https://mywebsite/myaudio.mp3"></audio>
<script>
function play() {
  document.getElementById('audioDev').play()
}
function pause() {
  document.getElementById('audioDev').pause()
}
</script>

AEiosApp avatar Apr 22 '22 19:04 AEiosApp

#10 has been merged, so this should probably be closed?

kevnk avatar Jun 10 '22 18:06 kevnk

On iOS http and https links doesn't work for me with current master version of this plugin.

katche70 avatar Jul 06 '22 21:07 katche70

@katche70 I think there is some confusion here. This plugin does not support http/https!

jsmith avatar Jul 09 '22 20:07 jsmith

still no updates on this?

Gonzalo-Bruna avatar Aug 14 '23 22:08 Gonzalo-Bruna

Hello, is there any plan to support remote stream url ?

jeremiestudiochingy avatar Aug 14 '24 00:08 jeremiestudiochingy

Streaming a URL is a must in these days where you communicate with LLMs and play their sounds. I hope this gets implemented soon.

ubaranzorlu avatar Sep 28 '24 15:09 ubaranzorlu