jw播放器怎么加大量广告

How to add vast advertisement to jw player

我正在尝试从 jwplayer 上的广告网站添加大量广告 这是我从广告网站上得到的

Bebi Video Ads :: Vast Instructions

To get vast url you should first include Bebi script on top of your page:

<script type="text/javascript" data-cfasync="false" src="//st.bebi.com/bebi_v3.js"></script>

then to get a vast url you should call:

BB.getVASTUrl(209831);

wherever you need it.


More information and examples can be found at:

https://bebimedia.freshdesk.com/solution/articles/14000075614-how-to-use-bebi-video-ads

我试过了,不知道下一步

<script type="text/javascript" data-cfasync="false" src="//st.bebi.com/bebi_v3.js"></script>

<script src="https://cdn.jwplayer.com/libraries/SNAMyqnD.js"></script>

<div id="player"></div>

<script>
var videoPlayer = jwplayer("player");
videoPlayer.setup({
sources: [{file: "https://www.w3schools.com/tags/mov_bbb.mp4"}],
width:"100%",
height:"100%",
});
</script>

首先,您需要满足以下两个要求:

其次,此代码应在 JW Player 的前置广告插播时段加载您的 Bebi 广告。如果您有额外的广告插播(插播广告,post-rolls),请查看 JW Player 的 advertising 文档。

<html>

<head>
    <script type="text/javascript" data-cfasync="false" src="https://st.bebi.com/bebi_v3.js"></script>

    <script src="https://cdn.jwplayer.com/libraries/SNAMyqnD.js"></script>
</head>

<body>
    <div id="player"></div>

    <script>
        var videoPlayer = jwplayer("player");
        var vasturl = BB.getVASTUrl(your_placement_id); 

        videoPlayer.setup({
            "playlist": [{
                "file": "https://www.w3schools.com/tags/mov_bbb.mp4"
            }],
            "height": 360,
            "width": 640,
            "advertising": {
                "client": "googima",
                "schedule": [{
                    "offset": "pre",
                    "tag": vasturl                  
                }]
            }
        });
    </script>
</body>

</html>