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 those environments. 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 and SIMID support with rmp-vast is not currently available. Radiant Media Player supports those features through Google IMA SDK.
Browsers
WebViews
Smart TV & OTT
When serving ads from Google Ads network (Google Ad Manager, AdSense for Video) you must 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.
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/8.4.10/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: 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'); rmp.init(settings); </script>
<!-- Player container element --> <div id="rmp"></div> <!-- Set up async player configuration options --> <script> // Streaming source - HLS in this example const src = { hls: 'https://your-hls-url.m3u8' }; // Player settings const settings = { licenseKey: 'your-license-key', src: 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' ] }, // Here we pass the ID of the player container so that the core library may automatically initialize player when it finishes loading asyncElementID: 'rmp' }; // We push the player settings to a global rmpAsyncPlayers variable if (typeof window.rmpAsyncPlayers === 'undefined') { window.rmpAsyncPlayers = []; } window.rmpAsyncPlayers.push(settings); </script> <script async src="https://cdn.radiantmediatechs.com/rmp/8.4.10/js/rmp.min.js"></script>
ads: Boolean
Activate or not ads within the player. Default: false
.
adTagUrl: String
Specifies the ad tag url that is requested by the player from the ad server. Default: ''
.
We recommend using fully qualified URLs for the
adTagUrl
setting
adParser: String
Specifies which VAST parser the player should use. Possible values are
'rmp-vast'
and 'ima'
. Default: 'ima'
.
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 8 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: false
.
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
.
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>https://cdn.radiantmediatechs.com/rmp/8.4.10/rmp-vast/omweb-js-1.3.37/Service/omweb-v1.js</script>
<script>https://cdn.radiantmediatechs.com/rmp/8.4.10/rmp-vast/omweb-js-1.3.37/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
.
adSupportHlsCreatives: Boolean
Enables display of HLS creatives with 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: []
.
See our documentation about player labels here.
const labels = { ads: { controlBarCustomMessage: 'Ad', skipMessage: 'Skip ad', textForClickUIOnMobile: 'Learn more' } };
labels.ads.skipMessage
: the skip message to show on player when a skippable ad is detected and the ad is in a state where it can be skipped. Default: 'Skip ad'
labels.ads.textForClickUIOnMobile
: on mobile devices the click-through URL for a linear ad is provided in a box located at the top right corner of the player. This setting set the text for this box. Default: 'Learn more'
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.
Since Radiant Media Player 4.5.1 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. Since Radiant Media Player 4.5.2 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 page.
©2015-2022 Radiant Media Player. All Rights Reserved.