{"id":40105,"date":"2016-09-06T10:14:36","date_gmt":"2016-09-06T04:44:36","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=40105"},"modified":"2016-09-06T14:52:58","modified_gmt":"2016-09-06T09:22:58","slug":"ad-pods-with-jw-player-2","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/ad-pods-with-jw-player-2\/","title":{"rendered":"AD-Pods with JW Player"},"content":{"rendered":"<p><strong>Introduction:<\/strong><\/p>\n<p>All of us know about video Ad-breaks. Ad-breaks usually appear at the starting, mid or end of any <a title=\"OTT Video services\" href=\"http:\/\/www.tothenew.com\/digital-ott-video-solution\">streaming video<\/a> to gain user&#8217;s attention on a particular brand. Ad-Pods is an advance feature of showing multiple advertisements back-to-back in a single Ad-break. It can be dynamic or static depend on the user\u2019s requirement. JW-Player can play advertisements together anywhere in the scheduled ad-break. It would be helpful to gain user attention on multiple brands and gain profitability, Ad-Pods can be scheduled as Pre-Rolls, Mid-Rolls, and Post-Rolls.<\/p>\n<ul>\n<li><strong>Pre-Rolls Ads<\/strong>\u00a0are played before going to start video inside JW Player,<\/li>\n<li><strong>Mid-Rolls Ads<\/strong>\u00a0can be added to play in mid of video playing at defined time slot.<\/li>\n<li><strong>Post-Rolls Ads<\/strong>\u00a0are played after video completed.<\/li>\n<\/ul>\n<p><strong>Step by Step approach to implementing Ad-Pods with JW Player:<\/strong><\/p>\n<p><strong>\u00a0Step 1:\u00a0<\/strong>Create an XML file, which has multiple nodes for every ad<\/p>\n<p>[xml]<br \/>\n&lt;VAST xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; version=&quot;3.0&quot;<br \/>\n      xsi:noNamespaceSchemaLocation=&quot;vast3_draft.xsd&quot;&gt;<br \/>\n    &lt;Ad id=&quot;lr1&quot; sequence=&quot;2&quot;&gt;<br \/>\n        &lt;Wrapper followAdditionalWrappers=&quot;true&quot; allowMultipleAds=&quot;true&quot; fallbackOnNoAd=&quot;true&quot;&gt;<br \/>\n            &lt;AdSystem\/&gt;<br \/>\n            &lt;Impression id=&quot;&quot;&gt;<br \/>\n                &lt;![CDATA[ http:\/\/qa.jwplayer.com\/~todd\/impression.gif ]]&gt;<br \/>\n            &lt;\/Impression&gt;<br \/>\n            &lt;Error&gt;<br \/>\n                &lt;![CDATA[ http:\/\/qa.jwplayer.com\/~todd\/error.gif ]]&gt;<br \/>\n            &lt;\/Error&gt;<br \/>\n            &lt;VASTAdTagURI&gt;<br \/>\n                &lt;![CDATA[<br \/>\n       Ad video file path (.mp4 \/ other formats)<br \/>\n                ]]&gt;<br \/>\n            &lt;\/VASTAdTagURI&gt;<br \/>\n        &lt;\/Wrapper&gt;<br \/>\n    &lt;\/Ad&gt;<br \/>\n    &lt;Ad id=&quot;lr2&quot; sequence=&quot;2&quot;&gt;<br \/>\n        &lt;Wrapper followAdditionalWrappers=&quot;true&quot; allowMultipleAds=&quot;true&quot; fallbackOnNoAd=&quot;true&quot;&gt;<br \/>\n            &lt;AdSystem\/&gt;<br \/>\n            &lt;Impression id=&quot;&quot;&gt;<br \/>\n                &lt;![CDATA[ http:\/\/qa.jwplayer.com\/~todd\/impression.gif ]]&gt;<br \/>\n            &lt;\/Impression&gt;<br \/>\n            &lt;Error&gt;<br \/>\n                &lt;![CDATA[ http:\/\/qa.jwplayer.com\/~todd\/error.gif ]]&gt;<br \/>\n            &lt;\/Error&gt;<br \/>\n            &lt;VASTAdTagURI&gt;<br \/>\n                &lt;![CDATA[<br \/>\n                    Ad video file path (.mp4 \/ other formats)<br \/>\n                ]]&gt;<br \/>\n            &lt;\/VASTAdTagURI&gt;<br \/>\n        &lt;\/Wrapper&gt;<br \/>\n    &lt;\/Ad&gt;<br \/>\n&lt;\/VAST&gt;<br \/>\n[\/xml]<\/p>\n<p>There are\u00a0<code>&lt;Ad&gt;<\/code>\u00a0tags in above XML example that have advertisement&#8217;s video file path mentioned in\u00a0<code>&lt;VASTAdTagURI&gt;<\/code>\u00a0tag. It also contains advertisement playing details like the\u00a0sequence, etc. If we want to add more than one advertisement, then we have to add more <code>&lt;Ad&gt;<\/code> tags.<\/p>\n<p><strong>Step 2:\u00a0<\/strong>We can use this Ad XML file in our JW-Player&#8217;s JavaScript code with corresponding time slot as follows:<\/p>\n<p>[html]<br \/>\n&lt;script type=&quot;text\/javascript&quot;&gt;<br \/>\n    var playerobject = jwplayer(&quot;Video Div Container ID&quot;).setup({<br \/>\n                file: &quot;Video File Path&quot;,<br \/>\n                image: &quot;Video Cover Image&quot;,<br \/>\n                type: &quot;m3u8&quot;,<br \/>\n                androidhls: &quot;true&quot;,<br \/>\n                primary: &quot;html5&quot;,<br \/>\n                title: &quot;Made in America&quot;,<br \/>\n                width: &quot;100%&quot;,<br \/>\n                aspectratio: &quot;16:9&quot;,<br \/>\n                skin: {<br \/>\n                    name: &quot;glow&quot;<br \/>\n                },<br \/>\n                advertising: {<br \/>\n                    client: &quot;vast&quot;,<br \/>\n                    schedule: {<br \/>\n                        preadbreak: {<br \/>\n                            offset: &quot;pre&quot;,<br \/>\n                            tag: &quot;Ad Video file path(.mp4,.mov, other formats)&quot;<br \/>\n                        },<br \/>\n                        adbreak1: {<br \/>\n                            offset: &quot;12:05&quot;,<br \/>\n                            tag: &quot;Ads Pods XML file path&quot;<br \/>\n                        },<br \/>\n                        adbreak2: {<br \/>\n                            offset: &quot;18:20&quot;,<br \/>\n                            tag: &quot;Ads Pods XML file path&quot;<br \/>\n                        }<br \/>\n                    }<br \/>\n                }<br \/>\n            }<br \/>\n    );<br \/>\n&lt;\/script&gt;<br \/>\n[\/html]<\/p>\n<p>You can see in above example, there are three slots (mentioned in <code>schedule<\/code>) for ad-breaks. The first one is Pre-Roll (mentioned with <code>offset: \"pre\"<\/code>), this has a single ad break that appears at the beginning. The remaining 2 ads are Mid-roll Ad-pods with given time, <code>offset: \"12:05\"<\/code> and <code>offset: \"18:20\"<\/code>. These will appear during the streaming at 12 minutes 5 seconds and 18 minutes 20 seconds respectively. In the later case, the ad will be picked from the XML file mention in the <code>tag<\/code> variable.<\/p>\n<p>Hoping this information is helpful for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: All of us know about video Ad-breaks. Ad-breaks usually appear at the starting, mid or end of any streaming video to gain user&#8217;s attention on a particular brand. Ad-Pods is an advance feature of showing multiple advertisements back-to-back in a single Ad-break. It can be dynamic or static depend on the user\u2019s requirement. JW-Player [&hellip;]<\/p>\n","protected":false},"author":410,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":13},"categories":[1],"tags":[4852,4001],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/40105"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/410"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=40105"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/40105\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=40105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=40105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=40105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}