Documentation

HTML5 Audio Advertisement

Scope of support for HTML5 audio advertisement

Radiant Media Player supports streaming to HTML5 audio in HLS, MPEG-DASH or progressive download with flexible configuration options. See our HTML5 audio docs for more information.

HTML5 audio advertisement are supported in our HTML5 audio player through the Google IMA SDK in various formats (support may vary based on device capabilities): M4A (AAC), MP3, OGG or even HLS (where natively supported by the device). We currently do not support HTML5 audio advertisement with our rmp-vast parser with our audio-only player. Note that audio-ads must be served with VAST as the IMA SDK does not currently support IAB DAAST standard.

It is also possible to use our video player to display audio-only content and therefore display video ads with audio-only content. See this section for more information on the subject.

HTML5 audio advertisement should be linear audio ads.

HTML5 audio advertisement and our HTML5 audio player can be controlled through our player API. You can also use ad waterfalling or our ad scheduler for HTML5 audio advertisement.

Audio ads with audio-only content - see this example here

<!-- Include Radiant Media Player JavaScript file in your <body> or <head> -->
<script src="https://cdn.radiantmediatechs.com/rmp/10.2.0/js/rmp.min.js"></script>
<!-- Player container element -->
<div id="rmp"></div>
<!-- Set up player configuration options -->
<script>
  // Streaming source - HLS audio-only in this example
  const src = {
    hls: 'https://your-audio-only-hls-url.m3u8'
  };
  // Player settings
  const settings = {
    licenseKey: 'your-license-key',
    src,
    width: 640,
    // Enabling ads
    ads: true,
    adTagUrl: 'https://your-audio-ad-tag-url',
    adTagWaterfall: [
      'https://your-audio-ad-tag-fallback-url'
    ],
    audioOnly: true
  };
  const rmp = new RadiantMP('rmp');

  // Initialization ... and done!
  async function initRmpPlayer() {
    try {
      await rmp.init(settings);
    } catch(error) {
      console.error('Radiant Media Player failed to initialize', error);
    }
  }
  initRmpPlayer();

</script>

Video ads with audio-only content - see this example here

Using the audioOnlyUseVideoLayout setting you can display audio-only content in our HTML5 video player. This makes video ads available for audio-only content.

Player code example:

<!-- Include Radiant Media Player JavaScript file in your <body> or <head> -->
<script src="https://cdn.radiantmediatechs.com/rmp/10.2.0/js/rmp.min.js"></script>
<!-- Player container element -->
<div id="rmp"></div>
<!-- Set up player configuration options -->
<script>
  // Streaming source - HLS audio-only in this example
  const src = {
    hls: 'https://your-audio-only-hls-url.m3u8'
  };
  // Then we set our player settings
  const settings = {
    licenseKey: 'your-license-key',
    src,
    width: 640,
    height: 360,
    audioOnly: true,
    // Specifies we want to use video layout for audio-only content
    audioOnlyUseVideoLayout: true,
    // We pass video ads data to the player
    ads: true,
    // We can use Google IMA (default) or rmp-vast to display video ads with audio-only content
    // adParser: 'rmp-vast',
    adTagUrl: 'https://your-ad-tag-url',
    contentMetadata: {
      poster: [
        'https://your-poster-url.jpg'
      ]
    }
  };
  const elementID = 'rmp';
  const rmp = new RadiantMP(elementID);

  // Initialization ... and done!
  async function initRmpPlayer() {
    try {
      await rmp.init(settings);
    } catch(error) {
      console.error('Radiant Media Player failed to initialize', error);
    }
  }
  initRmpPlayer();

</script>
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License.

©2015-2025 Radiant Media Player. All Rights Reserved.