I can control outside the audio in my canvas / HTML5 project?

I have a Flash project I export to HTML5 / canvas and there is an audio track in the background. Because he was tall, and causing the Flash loading wrong part, I decided it would be better to place it outside my Flash project using the audio tag. So I have this code:

"< automatic audio loop playback controls > < source src =" sounds/mySound.mp3"type =" audio/mpeg"> < source src =" sounds/mySound.ogg "type =" audio/ogg"> your browser does not support the audio tag. < / audio >

< canvas id = "canvas" width = "1200" height = "768" style = "background-color: #000000" > < / canvas >

Simple. I just want to be able to add a button to my Flash project to control the sound coming out of my audio tag. Is this feasible?

you don't know.

assign your audio tag an id attribute (for example, audioID) and you can use js like.

document.getElementById('audiID').play ();

document.getElementById("audioID').pause ();

etc.

Here is a list of the methods, properties, and events that you can use - reference DOM HTML audio/video

Tags: Adobe Animate

Similar Questions

Maybe you are looking for

  • where is the awesome bar for every night?

    I need to see and to be able to copy the url - search is nice but not necessary, because I find on my homepage (protopage) and of course the startup page every night.

  • Skype makes my pc Freeze I cany USE it at all!

    It's like this for weeks, I can't run Skype! Just connect to my pc freeze and I have to restart it please help

  • Script to show/hide the menu bar in the preferences

    Hi all First of all, my knowledge of script is fairly limited, so bear with me, okay? So, I was wondering if you could write a script that activates / deactivates the system preferences to show or hide the menu bar? I found this article http://goo.gl

  • Leak memory in cRIO running RT

    I am running RT 2009 on a compact chassis of RIO.  My very basic VI causes the RIO to restart, which seems to be linked to a leak memory.  I use system monitor and you can watch the use of memory on the chassis of RIO grow very slowly.  Attached is t

  • Broken keyboard key is covered by the warranty?

    Hello I bought Thinkpad T520 a month ago. Today, one of the areas that hold the key broken Z. The key is still usable but can be detached easily. I used the laptop on a desk only and I have not pressured the keys that could break them. It is a defect