Hi,
I’m using a conditional card to pop up a webRTC card showing a security camera when a motion is present. I know there’s other ways to do this but it seems simple and works fine. What I’d like to add to this is a ‘beep’ when this happens, so the Alexa Show that I’m running the display on beeps to catch my attention.
My first attempt at a simple way of doing this is by also conditionally opening up an iFrame/Webpage that runs a beep on opening - It’s located in the www folder along with the mp3.
<audio autoplay>
<source src="/local/Beep-Low.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
This works, but only on the first event. I’m thinking it’s probably as the web page once opened sits open in the background so never ‘re-opens’ when a second event happens. This I think is confirmed as when I alter the web page code to include a refresh every 5 sec, it then continues to beep every 5sec. (If I navigate to a different panel it stops, but then continues when I go back to the panel that has the conditional card on.)
My second attempt was to conditionally use a markdown card which had the same code as above. This opens the media player ok, but for some reason it doesn’t find the mp3 that’s in the /local/ folder?
So…
Is there any way to close an iFrame/webpage once it’s opened, as that would then mean my next re-opening would trigger the ‘autoplay’.
or
Is there a way of getting the markdown card to see the audio file? (Annoyingy if I put an image in my www folder and add , it finds that)
or
Has anyone managed to do this in an alternative way? (I’m aware that I could do browser_mod or go with a fully-kiosk arrangement but I think those are a bit complicated for what I need so was hoping for something simple)
Cheers,
Matt.