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:
- Create an
ads
attribute inside your config object. - Create a
clientSide
object inside theads
object - Inside the
clientSide
object, set theprovider
key toraf
. - Create a
raf
object inside theclientSide
object. insert raf configurations based on the configuration below
Attribute | Type | Required | Description |
---|---|---|---|
adUrl | string | yes | URL of the VAST or VMAP Ad Tag |
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.
Attribute | Type | Required | Description |
---|---|---|---|
macros | [key: string]: string | no | Values that you want to be replaced in the URL |
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"
}
}
}
...
})