rmp-vast is a lightweight open-source client-side JavaScript solution to load, parse and display VAST resources. It is maintained by Radiant Media Player team and is offered as an alternative to Google IMA SDK. The main purpose of rmp-vast is to offer a VAST 2, 3 and 4 compliant solution to display video ads in web-based mobile/OTT applications as Google HTML5 IMA SDK may not officially be compatible with all environments we support. rmp-vast can also be used in environments like desktop or mobile browsers.
rmp-vast supports the following VAST 4.2 features:
Note that VMAP support with rmp-vast is not currently available. Radiant Media Player supports VMAP through Google IMA SDK.
Browsers
WebViews
Smart TV & OTT
When serving ads from Google Ads network (Google Ad Manager, AdSense for Video) you should use the IMA HTML5 SDK with our player.
ADX & AdSense for Video ads may not render with rmp-vast.
Google Ad Manager ads may render with rmp-vast but we cannot guarentee support for all Google Ad features. The
choice of VAST parser is made through the adParser
player setting ('ima' or 'rmp-vast').
rmp-vast uses JavaScript XMLHttpRequests to load VAST tags. Hence proper CORS configuration is required on your ad-server in order for rmp-vast to be able to retrieve VAST tags. Refer to this Google documentation for more information.
Player settings for using rmp-vast are very similar to using Google IMA SDK.
The only difference resides in specifying the VAST parser which you want
to use through the
adParser
setting.
Here is a complete 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> <script> // Streaming source - HLS in this example const src = { hls: 'https://your-hls-url.m3u8' }; // Player settings const settings = { licenseKey: 'your-license-key', src, width: 640, height: 360, ads: true, // We tell the player to use rmp-vast to load and parse VAST resources adParser: 'rmp-vast', // We pass our adTag here - the player will attempt to load it upon startup adTagUrl: 'https://your-ad-tag-url', contentMetadata: { poster: [ 'https://your-poster-url.jpg' ] } }; 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>
ads: Boolean
Activate or not ads within the player. Default: false
.
adTagUrl: String
Specifies the VAST ad tag URL that is requested by the player from the ad
server.
Default: ''
.
We recommend
using fully qualified URLs for the
adTagUrl
setting
adsResponse: String
Specifies a VAST document (as in XML string) to be used as the ads
response instead of making a
request via an ad tag url. This can be useful for debugging and other situations where a
VAST response is
already available. Default: ''
. Using the adTagUrl
setting is
preferred
when both options are available.
adParser: String
Specifies which VAST parser the player should use. Possible values are
'rmp-vast'
and 'ima'
. Default: 'ima'
.
adForceNativeFullscreenOnIosForAds: Boolean
Forces native fullscreen on iOS when video ads are enabled in the player. This allows a fullscreen experience
for video ads on iOS but skippable video ads will not be skippable when in fullscreen mode. When set to false
the player will use an emulated fullscreen mode that allows for skippable ads to be skippable in fullscreen
mode at the cost of a lesser viewing experience in fullscreen mode. Default: true
.
adLoadVastTimeout: Number
Represents the Ajax timeout in milliseconds for each VAST request (or
VAST
wrapper). When timeout is reached without a valid server response the VAST
loading process is aborted. Default: 8000
.
adLoadMediaTimeout: Number
Timeout (in milliseconds) when loading a creative media file (after a
successful
VAST response). If loading takes longer than this timeout, the ad playback
is cancelled and content resumes. Default: 12000
which
represents a 12
seconds timeout.
adAjaxWithCredentials: Boolean
AJAX request to load VAST tag from ad server should or should not be made
with credentials. Default: false
.
adShowRemainingTime: Boolean
When set to true, a remaining time bar UI will be displayed
on top of the player control bar for linear creatives. Default: false
.
adMaxNumRedirects: Number
Specifies the maximum number of redirects before the subsequent redirects
will be denied, and the ad load aborted. The number of redirects directly
affects latency and thus user experience. This applies to all VAST wrapper
ads. Default: 4
.
adShowMarkers: String
Adds markers on timeline for on-demand streams indicating to
viewers when ad-breaks are scheduled. Works for VMAP tags and our ad-scheduler. Default:
true
.
adCountDown: Boolean
A countdown to be displayed within the player control bar. It shows the
remaining
time for the video ads. Default: true
.
adTagReloadOnEnded: Boolean
When set to true this setting will cause the player to attempt to reload
the initial adTag (or VMAP/ad-schedule) when a user requests content to be played after
having ended. This
setting is compatible with the adTagWaterfall
setting
and outstream ads.
Default: true
.
Note that we currently only support Creative Access Mode (e.g. full).
We support OMID (OM Web SDK) with rmp-vast. This feature needs to be enabled as follows:
First adds the following libraries to your web page - those are required to enable OMID support in rmp-vast and are not bundled or automatically with the player:
<script src="https://cdn.radiantmediatechs.com/rmp/10.2.0/rmp-vast/omweb-js-1.4.12/Service/omweb-v1.js"></script>
<script src="https://cdn.radiantmediatechs.com/rmp/10.2.0/rmp-vast/omweb-js-1.4.12/Session-Client/omid-session-client-v1.js"></script>
Then enables OMID support in rmp-vast with setting adOmidSupport
to true.
adOmidSupport: Boolean
Enables OMID support in rmp-vast. Default: false
.
omidAllowedVendors: Array
List of allowed vendors for ad verification. Vendors not listed will be rejected.
Example: ['com.vendor.aaa', 'com.vendor.bbb']. Default: []
.
This feature is a BETA feature - feedback is welcome!
We support displaying HLS creatives with rmp-vast and Radiant Media Player. This feature needs to be
explicitly enabled with the adSupportHlsCreatives
setting. First you need to add hls.js library
to your page.
<script src="https://cdn.radiantmediatechs.com/rmp/10.2.0/hls/hls.min.js"></script>
Then set adSupportHlsCreatives
setting to true.
adSupportHlsCreatives: Boolean
Enables display of HLS creatives with rmp-vast and Radiant Media Player. Default: false
.
See our SIMID and VPAID advertisement documentation page.
See our documentation about player labels here.
const labels = { ads: { controlBarCustomMessage: 'Ad', skipMessage: 'Skip ad', textForClickUIOnMobile: 'Learn more', adBlockDetectedMessage: 'AdBlock detected', adBlockMessageMessageExtended: 'Our website needs to show advertisement to our viewers - please allow ads on our website', adBlockDetectedButton: 'I have disabled AdBlock' } };
By default when ads
setting is set to true it automatically detects ad-blocker.
If an ad-blocker is detected the player fires a
'adblock' event. This however does not prevent playback of content, it just notifies the publisher that a
video ad-blocker has been detected.
adOnAdBlockPreventPlayback: Boolean
When enabled, this setting will prevent playback of content when a video ad-blocker is detected and present a
viewer with a message: 'AdBlock detected' and 'Our website needs to show advertisement to our viewers - please
allow ads on our website' (in the appropriate language for the viewer). A button will also be shown allowing
the viewer to reload page after having disabled the ad-blocker. The message can be customized through the
hint.ads.adBlockDetectedMessage
and hint.ads.adBlockMessageMessageExtended
player
labels. Default: false
.
Offering ad skipping options to your audience is a great way to monetise your content while providing a gentle and smart advertisement experience. Radiant Media Player supports ad skipping in the following way: VAST 3+ skippable video ads. When a valid VAST 3+ tag with skippable information (e.g. skip information are held within the VAST XML response) is presented to the player, it will automatically read that information and display a skip button when appropriate in the advertisement UI. This is available for the Google IMA and our rmp-vast - no extra configuration is required.
As when using the Google IMA SDK, autoplay of pre-roll linear video ads on desktop and muted autoplay on mobile devices are supported. Refer to our documentation about autoplay support for more information.
We support ad scheduling with rmp-vast through our ad scheduler.
VAST redirect / VAST Wrapper have always been supported with rmp-vast since
it was made publicly available. We also
support ad waterfalling through the
adTagWaterfall
setting with rmp-vast. See our
ad waterfalling documentation for more
information.
See the companion ads documentation for more information on how to retrieve companion ads information with rmp-vast.
See the ad tag variables & macros documentation.
©2015-2025 Radiant Media Player. All Rights Reserved. ✝