JW Player如何添加2个VAST广告?

How to Add 2 VAST Ads in JW Player?

我正在使用 JW Player 我有一个代码可以正常工作,但我想在播放器中插入 2 个中贴片广告。当我尝试以不同的时间复制和粘贴相同的代码时。具有更高时间的代码仅适用。

下面的代码工作正常,因为广告会在 5 分钟后播放,但如果我尝试再次复制粘贴相同的代码,然后使用更高时间的代码(例如 600 秒),那么只有该代码有效,前一个代码无效

advertising: {
                client: "vast",
                schedule: {
                    "myAds": {
                        "offset":300,
                        "tag": "https://www.example.com"
                    }
                }
            },

如果我尝试像这样放置代码,那么只有一个广告有效...

advertising: {
                client: "vast",
                schedule: {
                    "myAds": {
                        "offset":300,
                        "tag": "https://www.example.com"
                    }
                }
            },

advertising: {
                client: "vast",
                schedule: {
                    "myAds": {
                        "offset":600,
                        "tag": "https://www.example.com"
                    }
                }
            },

请帮助我。

您可以使用计划块添加 2 个 VAST 广告:

advertising: {
                client: "vast",
                schedule: [{
                        "offset":300,
                        "tag": "https://www.example.com"
                    }, {
                        "offset":600,
                        "tag": "https://www.example.com"
                    }]
            },

更多信息请参考文档:https://developer.jwplayer.com/jw-player/docs/developer-guide/advertising/monetize-your-content/#add-multiple-ad-breaks-to-a-player

"advertising": {
   "client" : "vast",
   "schedule" : [
    {
      tag: ["https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=[timestamp]"],
      type: "linear",
      offset: 15
    },
    {
      tag: ["https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=[timestamp]"],
      type: "linear",
      offset: 45
    },
    {
      tag: ["https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=[timestamp]"],
      type: "linear",
      offset: 125
    }
  ]
}