Skip to main content

Insert Clientside Ads

Client-side ads are important for delivering a seamless and engaging user experience. With client-side rendering, video ads are processed and rendered directly on the user's device, allowing for faster ad load times, smoother playback, and reduced buffering. Client-side ads also enable dynamic ad insertion, allowing for personalized and targeted ad content based on user behavior and preferences. Additionally, client-side ads provide more flexibility in ad formats, such as interactive video ads and rich media ads, which can captivate users and boost ad engagement.

RAF Clientside Ad Configuration

LuraPlayer, comes equipped with its own fully VAST-compliant ad manager, making it easy for you to monetize your content by including multimedia ads within your websites and apps. With LuraPlayer's ad manager, you can seamlessly integrate ads and serve them to your audience while maintaining full control over your content video playback. You can also customize the ad experience to suit your needs and preferences, including ad format, placement, and frequency. By leveraging LuraPlayer's ad manager, you can optimize your ad revenue and enhance your user engagement.

To configure the LuraPlayer Ad Manager, you need to go through the following steps:

  1. Create an ads attribute inside your config object.
  2. Create a clientSide object inside the ads object
  3. Inside the clientSide object, set the provider key to raf.
  4. Create a raf object inside the clientSide object. insert raf configurations based on the configuration below
AttributeTypeRequiredDescription
adUrlstringyesURL of the VAST or VMAP Ad Tag
info

LuraPlayer Ad Manager will assume that the entered URL is a VMAP URL if no offset is provided and will try to fetch the data from the provided URL. However, if the response is not a VMAP, LuraPlayer Ad Manager will ignore it.

Here is a configuration example that uses LuraPlayer Ad Manager:

m.player.callFunc("setConfig", {
...
ads: {
clientSide: {
provider: "raf",
raf: {
adUrl: "https://example.com/your_vast_url.xml"
}
}
}
...
})

You can also provide macros in your configuration and URL. The macros provided in the macro attribute will replace the macros in the URL.

AttributeTypeRequiredDescription
macros[key: string]: stringnoValues that you want to be replaced in the URL
caution

LuraPlayer also includes reserved macros that are all prefixed with LURA_. If you include a macro key that is prefixed with LURA_, LuraPlayer will ignore it and use its own logic. Please see macros for more detail.

m.player.callFunc("setConfig", {
...
ads: {
macros: {
CUSTOM_MACRO: "my-url-safe-macro"
},
clientSide: {
provider: "raf",
raf: {
adUrl: "https://example.com/your_vast_url.xml"
}
}
}
...
})