Audio tag not working with variables



I am developing an app for iPad.

The Audio tag works when I hard code it

<audio controls>
<source src="audio/file.wav" type="audio/wav">

But when I use a variable it doesn’t work

<audio controls>
<source src="{{}}" type="audio/wav">


I’ve same issue.
If you find a solution, please post it.


Hi @Romaelz I haven’t found the solution. However, I have used an alternate temporary solution until I find the solution.

in html file

<div id="audio"></div>

In app.js

var str = "<audio controls><source src=' "+$" ' type='audio/wav'></audio>";
document.findElementById('audio').innerHTML = str;


What about using ngSrc?

Wouldn’t the following work:

<audio controls>
    <source ng-src="{{}}" type="audio/wav">

~ Brad


Hi @ArcReaction,

Using ng-src works for me. Thanks.

@Romaelz Try what ArcReaction said.


Good stuff… glad it’s working for you. :smile:

~ Brad