Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VPAID integration #398

Merged
merged 26 commits into from Dec 5, 2019
Merged

VPAID integration #398

merged 26 commits into from Dec 5, 2019

Conversation

@golikov
Copy link
Collaborator

golikov commented Nov 18, 2019

No description provided.

@golikov golikov changed the title Vpaid integration VPAID integration Nov 18, 2019
@golikov

This comment has been minimized.

Copy link
Collaborator Author

golikov commented Nov 18, 2019

Sample code to invoke player

<!DOCTYPE html>
<html>
<head>
  <title>FluidPlayer VPAID ads</title>
  <script type="text/javascript" src="../fluidplayer.js"></script>
  <link rel="stylesheet" href="../fluidplayer.css" type="text/css"/>

</head>
<body style="text-align: center;">

  <video id='myVideo' controls style="width: 640px; height: 360px;">
    <source src='http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/WhatCarCanYouGetForAGrand.mp4' title='1080p'  type="video/mp4"  />
  </video>

</body>
  <script type="text/javascript">
    var myPlayer = fluidPlayer('myVideo',{
      layoutControls: {
        doubleclickFullscreen: true,
        autoPlay: true
      },
      vastOptions: {
          adList: [
              {
                  roll: 'preRoll',
                  vastTag: 'vpaid_linear.xml',
              },
              {
                  roll: 'midRoll',
                  vastTag: 'vpaid_nonlinear.xml',
                  timer: 10,
              }                     
          ]
      }      
    });
  </script>
</html>

Linear VPAID AD XML

<VAST
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd" version="3.0">
	<Ad id="1234567">
		<InLine>
			<AdSystem>GDFP</AdSystem>
			<AdTitle>Linear VPAID Example</AdTitle>
			<Description>Vpaid Linear Video Ad</Description>
			<Error>http://www.example.com/error</Error>
			<Impression>http://www.example.com/impression</Impression>
			<Creatives>
				<Creative sequence="1">
					<Linear>
						<Duration>00:00:00</Duration>
						<TrackingEvents>
							<Tracking event="start">http://www.example.com/start</Tracking>
							<Tracking event="firstQuartile">http://www.example.com/firstQuartile</Tracking>
							<Tracking event="midpoint">http://www.example.com/midpoint</Tracking>
							<Tracking event="thirdQuartile">http://www.example.com/thirdQuartile</Tracking>
							<Tracking event="complete">http://www.example.com/complete</Tracking>
							<Tracking event="mute">http://www.example.com/mute</Tracking>
							<Tracking event="unmute">http://www.example.com/unmute</Tracking>
							<Tracking event="rewind">http://www.example.com/rewind</Tracking>
							<Tracking event="pause">http://www.example.com/pause</Tracking>
							<Tracking event="resume">http://www.example.com/resume</Tracking>
							<Tracking event="fullscreen">http://www.example.com/fullscreen</Tracking>
							<Tracking event="creativeView">http://www.example.com/creativeView</Tracking>
							<Tracking event="acceptInvitation">http://www.example.com/acceptInvitation</Tracking>
						</TrackingEvents>
						<AdParameters>
							<![CDATA[
{"videos":[ {"url":"https://googleads.github.io/googleads-ima-html5/media/LinearVPAIDCreative.mp4","mimetype":"video/mp4"}]}
]]>
						</AdParameters>
						<VideoClicks>
							<ClickThrough id="123">http://google.com</ClickThrough>
							<ClickTracking id="123">http://www.example.com/click</ClickTracking>
						</VideoClicks>
						<MediaFiles>
						
						<MediaFile apiFramework="VPAID" type="application/javascript">
							https://googleads.github.io/googleads-ima-html5/vpaid/linear/VpaidVideoAd.js
						</MediaFile>

						</MediaFiles>
					</Linear>
				</Creative>
				<Creative sequence="1"/>
			</Creatives>
		</InLine>
	</Ad>
</VAST>

Non Linear VPAID AD XML

<VAST
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd" version="3.0">
	<Ad id="1234567">
		<InLine>
			<AdSystem></AdSystem>
			<AdTitle>NonLinear VPAID JS</AdTitle>
			<Description>Vpaid NonLinear Ad</Description>
			<Error>http://www.example.com/error</Error>
			<Impression>http://www.example.com/impression</Impression>
			<Creatives>
				<Creative sequence="1">
					<NonLinearAds>
						<TrackingEvents>
							<Tracking event="start">http://www.example.com/start</Tracking>
							<Tracking event="firstQuartile">http://www.example.com/firstQuartile</Tracking>
							<Tracking event="midpoint">http://www.example.com/midpoint</Tracking>
							<Tracking event="thirdQuartile">http://www.example.com/thirdQuartile</Tracking>
							<Tracking event="complete">http://www.example.com/complete</Tracking>
							<Tracking event="mute">http://www.example.com/mute</Tracking>
							<Tracking event="rewind">http://www.example.com/rewind</Tracking>
							<Tracking event="pause">http://www.example.com/pause</Tracking>
							<Tracking event="resume">http://www.example.com/resume</Tracking>
							<Tracking event="fullscreen">http://www.example.com/fullscreen</Tracking>
							<Tracking event="creativeView">http://www.example.com/creativeView</Tracking>
							<Tracking event="acceptInvitation">http://www.example.com/acceptInvitation</Tracking>
						</TrackingEvents>
						<NonLinear apiFramework="VPAID" width="480" height="90" id="overlay-1">
							<AdParameters>
								<![CDATA[{"overlays":["https://googleads.github.io/googleads-ima-html5/media/NonLinearVpaid.png"], "videos":[ {"url":"https://googleads.github.io/googleads-ima-html5/media/LinearVPAIDCreative.mp4","mimetype":"video/mp4"}]} ]]>
							</AdParameters>
							<StaticResource creativeType="application/javascript">
								<![CDATA[https://googleads.github.io/googleads-ima-html5/vpaid/nonlinear/VpaidNonLinear.js]]>
							</StaticResource>
							<NonLinearClickThrough id="GDFP">
								<![CDATA[ http://google.com ]]>
							</NonLinearClickThrough>
						</NonLinear>
					</NonLinearAds>
				</Creative>
			</Creatives>
		</InLine>
	</Ad>
</VAST>
@golikov golikov merged commit 98b7383 into master Dec 5, 2019
@golikov golikov deleted the vpaid_integration branch Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.