jwPlayer- Initialize Advertsing after Setup() with setConfig()

19 Views Asked by At

I am trying to add Advertising() option in JWPlayer after it has been setup. I have tried different methods to somehow modify the initial jwplayer.setup(), the closest I got is jwplayer().setConfig() - documentation link below:

https://docs.jwplayer.com/players/reference/jwplayersetconfig

The requirement is to add Advertising after the jwPlayer() has been setup, here is what I have tried and doesn't seem to work as setConfig() doesn't have advertising option:

jwplayer().setConfig({
     mute: true,
     autostart:true,
     advertising: {
          client: "vast",
          schedule: {
            "pre-roll": {
              "offset": "60",
              "tag": adTagUrl
            },
            "mid-1": {
              "offset": "500",
              "tag": adTagUrl
            },
            "post-roll": {
              "offset": "post",
              "tag": adTagUrl
            }
          }
    },
});

Is there any such function or a way to add "advertising" option to jwplayer() after it has been initially setup. Please help. thanks

0

There are 0 best solutions below