Get the code

Websites will now be able to selectively support Dolby Audio as a premium sound experience. Websites that want to use Dolby should feature detect on the format and be prepared to stream alternative audio formats on systems that don’t support Dolby Audio.

Step 1: Add this script to your HTML file 

<script type="text/javascript"src=""></script>

Step 2: Add the Method 


Step 3: Playback: HTML5 and Javascript

Once you’ve got your video and/or audio assets prepared (mixed, encoded, and formatted), all that remains is serving up the media files on the web. Modern web browsers supporting HTML5 can handle most of the work for you through a combination of HTML tags (the <video> and <audio> tags) and JavaScript. 

The most basic playback of a video file containing a Dolby Digital Plus (DD+) audio track, simply uses the video element to point to the encoded file. The browser does the rest, providing a simple player and performing the decoding.

Using the <video> and <audio> elements with their default behavior alone is just the beginning. You can use JavaScript and tag attributes to customize the player as you desire, with custom start/pause/playback speed buttons, alternative video sizes, and many other attributes. See this article from Microsoft on using JavaScript to customize your video playback experience.

Web Audio API

If you’ve prepared your audio assets in DD+ (and typically a fallback encoding), you can use these same audio files to create interactive experiences using the WebAudio API. Browsers running on systems that support DD+ (MS Windows 10 and above; Mac OS 10.11 and above) can decode DD+ audio streams in the same way they decode other audio formats. Use AudioContext.DecodeAudioData(). You can use mono, stereo, or multi-channel inputs. Once you have the audio ingested you can further manipulate it using the WebAudio API features, including the PannerNode to place your sounds dynamically based on user input or desired events. See the re.flow demo and blog post series which showcases blending 3D graphics objects in WebGL with 3D panning in WebAudio to create an immersive interactive audio/video experience using Dolby Digital Plus.