The steps below outline preparing your audio and video content and how to integrate Intrasonics JS Decoder to your website.
A token specifying which audio-triggers should be responded to is required to activate the JS Decoder.
The token included in the download from this site uses non-exclusive demonstration triggers and is prohibited for use in production.
To use the JS Decoder on your own website you must license unique commercial audio-triggers from Intrasonics. Please see the licensing page for more information.
Once you have licensed some commercial audio-triggers, you will be able to create a token via Intrasonics Portal, the online gateway to our products and services.
The JS Decoder responds to audio triggers encoded in audio and video content.
Your Portal credentials gain you access to Intrasonics Cloud Encoder to upload and watermark your audio and video content with your exclusive audio-triggers.
With your token and some media encoded with your exclusive audio-triggers, you can begin to integrate the Intrasonics JS Decoder...
<head>section of your document.
<script src="intrasonics.js" async></script>
The Intrasonics JS Decoder can only be started once a valid token has been loaded. A Promise chain is used to notify your web-content when this has happened.
Event Listeners are sections of your code that listen for and respond to the different events emitted by the JS Decoder.
Add this code before the closing
</body> tag of your HTML page to load the token, start the JS Decoder and respond to the events raised:
See a list of all the types of events raised by the JS Decoder in the API Documentation.
Open your web page in a compatible browser and play your encoded media. If you've followed the steps above you will see an alert dialog appear for each detected audio-trigger.
Now edit the response handler code to meet the specific requirements for your web-content.
If the JS Decoder isn't working for you, please trace your steps against the instructions above.
If you need further assistance in getting your codewords to be detected, please contact us for support.