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

In-Stream:如何实现 In-Stream。第 2 部分:实现示例

下面我们将根据您使用的视频播放器,向您展示如何将代码集成到您的网站中。

请记得将 XXXXXX 值替换为 区域 ID 您在 步骤 1.

播放器网站

<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"
                    }
                ]
            }
        }
    );

播放器网站

注意:它仅适用于 JWPlayer 6+ 版本(不包括免费版),并且仅在页面上只放置一个 JWPlayer 时才有效。

播放器网站

播放器网站

注意:此播放器需要付费订阅。

故障排除

在添加这些代码并将 Zone ID 替换为您自己的 ID 后,您应该会立即开始展示广告。

在我们的指南下一部分中,如果未出现这种情况,我们将提供一些基本的故障排除步骤。 点击此处继续

另外,如果您的播放器或版本未列出,请联系我们的客户成功团队,选择 技术支持 并通过联系表单 这里.

最后更新于

这有帮助吗?