> For the complete documentation index, see [llms.txt](https://docs.exoclick.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.exoclick.com/tutorials/ja/chtoriaru/paburisshkechtoriaru/how-implement-in-stream-part2.md).

# インストリーム：インストリームの実装方法。パート2：実装例

以下では、使用している動画プレーヤーに応じて、コードをサイトに統合する方法を示します。

XXXXXX の値を、 **ゾーン ID** あなたが作成した広告ゾーンの [**ステップ 1**](/tutorials/ja/chtoriaru/paburisshkechtoriaru/how-implement-in-stream-part1.md).

{% tabs %}
{% tab title="Fluid Player" %}
[**プレーヤーのウェブサイト**](https://www.fluidplayer.com/)

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

{% endtab %}

{% tab title="JWPlayer バージョン 6+（カスタム統合）" %}
[**プレーヤーのウェブサイト**](https://support.jwplayer.com/)

```html
<div id="my-video"></div>
<script type="text/javascript">
jwplayer("my-video").setup({
/**** ADVERTISING SECTION STARTS HERE ****/
advertising: {
  client: "vast",
  schedule: {
    "myAds": {
      "offset": "pre",
      "tag": "https://s.magsrv.com/v1/vast.php?idzone=XXXXXXX"
      }
    }
  },
  /**** ADVERTISING SECTION ENDS HERE ****/
  file: "http://content.jwplatform.com/videos/Wf8BfcSt-kNspJqnJ.mp4",
  image: "http://content.jwplatform.com/thumbs/Wf8BfcSt-640.jpg",
  width: "580",
  height: "370"
});
</script>
```

**注**: これは JWPlayer バージョン 6+（無料版では不可）でのみ動作し、ページに 1 つの JWPlayer だけが配置されている場合にのみ機能します。
{% endtab %}

{% tab title="Video.js（カスタム統合）" %}
[**プレーヤーのウェブサイト**](http://docs.videojs.com/)

```html
<head>
<link href="http://vjs.zencdn.net/4.7.1/video-js.css" rel="stylesheet">
<link href="lib/videojs-contrib-ads/videojs.ads.css" rel="stylesheet" type="text/css">
<link href="videojs.vast.css" rel="stylesheet" type="text/css">
<style type="text/css">
.description {
  background-color:#eee;
  border: 1px solid #777;
  padding: 10px;
  font-size: .8em;
  line-height: 1.5em;
  font-family: Verdana, sans-serif;
}
.example-video-container {
  display: inline-block;
}
</style>
<!--[if lt IE 9]><script src="lib/es5.js"></script>-->
<script src="http://vjs.zencdn.net/4.7.1/video.js">
<script src="lib/videojs-contrib-ads/videojs.ads.js">
<script src="lib/vast-client.js">
<script src="videojs.vast.js">
<body>
<p class="description">Video.js VAST プラグインの例。</p>
<div class="example-video-container">
<p class="description">自動再生なし。</p>
<video id="vid1" class="video-js vjs-default-skin" controls preload="auto"
  poster="http://video-js.zencoder.com/oceans-clip.png"
  data-setup=’{}’
  width=’640’
  height=’400’
>
<source src="https://vjs.zencdn.net/v/oceans.mp4" type=’video/mp4’ >
<source src="https://vjs.zencdn.net/v/oceans.webm" type=’video/webm’ >
<p>動画再生はサポートされていません</p>
</video>
</div>
<script>
  var vid1 = videojs(‘vid1’)
  vid1.muted(true);
  vid1.ads();
  vid1.vast({
  url: ‘https://s.magsrv.com/v1/vast.php?idzone=XXXXXXX’
});
</script>
</body>
```

{% endtab %}

{% tab title="Flowplayer（カスタム統合）" %}
[**プレーヤーのウェブサイト**](https://docs.flowplayer.com/)

```html
<head>
<link rel="stylesheet" href="https://releases.flowplayer.org/7.2.4/skin/skin.css">
<script src="https://code.jquery.com/jquery-1.12.4.min.js">
<script src="https://releases.flowplayer.org/7.2.4/flowplayer.min.js">
<script src="http://releases.flowplayer.org/hlsjs/flowplayer.hlsjs.light.min.js">
<script src="http://imasdk.googleapis.com/js/sdkloader/ima3.js">
<script src="https://releases.flowplayer.org/vast/goshow.tv/vast.min.js">
<style type="text/css" dangerouslySetInnerHTML={{__html: ".flowplayer {  background-image: url(//flowplayer.com/media/img/logo-blue.png);  background-size: 95%;  background-color: #6496ff;  -webkit-box-shadow: 0 0 20px #b8b8b8;  -moz-box-shadow: 0 0 20px #b8b8b8;  box-shadow: 0 0 20px #b8b8b8;  width: 640px;}--><!--" }}>
<script>
window.onload = function ();
    flowplayer("#vast", ;
    splash: true,
    ratio: 9/16,
    customPlaylist: true,
    playlist: [&lcub;
    ima: &lcub;
    ads: [&lcub;
    time: 10,
    adTag: ‘https://s.magsrv.com/v1/vast.php?idzone=XXXXXXX’
;],
;,
  sources: [
type: "application/x-mpegurl", src: "//edge.flowplayer.org/drive.m3u8";,
type: "video/mp4", src: "//edge.flowplayer.org/drive.mp4";
    ]
;]
;);
;;
</script>
<div id="vast" />
```

**注**: このプレーヤーには有料サブスクリプションが必要です。
{% endtab %}
{% endtabs %}

## トラブルシューティング

これらのコードを追加し、Zone ID を自分のものに置き換えた後、すぐに広告が表示され始めるはずです。

次のガイドのセクションでは、これが起こらない場合の基本的なトラブルシューティング手順を紹介します。 [**続行するにはここをクリック**](/tutorials/ja/chtoriaru/paburisshkechtoriaru/how-implement-in-stream-part3.md)

また、プレーヤーまたはバージョンが一覧にない場合は、選択してカスタマーサクセスチームにお問い合わせください **技術サポート** 問い合わせフォームの [**こちら**](https://www.exoclick.com/contact/).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.exoclick.com/tutorials/ja/chtoriaru/paburisshkechtoriaru/how-implement-in-stream-part2.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
