For the complete documentation index, see llms.txt. This page is also available as Markdown.

In-Stream: How to implement In-Stream. Part 2: Implementation examples

Below we show you how to integrate the code into your site depending on the video player you are using.

Remember to replace the XXXXXX value with the Zone ID of the ad zone you created in Step 1.

Player website

<script src="https://cdn.fluidplayer.com/v3/current/fluidplayer.min.js"></script>

<video id="my-video" controls style="width: 640px; height: 360px;">
    <source src="main_video.mp4" type="video/mp4" />
</video>

<script type="text/javascript">
    var testVideo = fluidPlayer(
        "my-video",
        {
            vastOptions: {
                adList: [
                    {
                        roll: "preRoll",
                        vastTag: "https://s.magsrv.com/v1/vast.php?idzone=XXXXXXX"
                    },
                    {
                        roll: "midRoll",
                        vastTag: "https://s.magsrv.com/v1/vast.php?idzone=XXXXXXX",
                        timer: 8
                    },
                    {
                        roll: "midRoll",
                        vastTag: "https://s.magsrv.com/v1/vast.php?idzone=XXXXXXX",
                        timer: 10
                    },
                    {
                        roll: "postRoll",
                        vastTag: "https://s.magsrv.com/v1/vast.php?idzone=XXXXXXX"
                    }
                ]
            }
        }
    );

Troubleshooting

After adding these codes and replacing the Zone ID with your own, you should start showing ads right away.

In the next section of our guide, we will offer some basic troubleshooting steps in case this is not happening. Click here to continue

Also, if your player or version is not listed contact our Customer Success team selecting Technical Assistance from the contact form here.

Last updated

Was this helpful?