This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Include this below all other code in your event --> | |
<script type='text/javascript'> | |
window.addEventListener("message", function(event) { | |
var ctaId = window.frameElement.id.split('_')[1]; | |
var playerId = window.frameElement.src.split('/'); | |
playerId = playerId[playerId.length-3]; | |
// only allow from domains that end in allowedDomains | |
if (!event.origin.match(/vidyard\.(dev|com)$/)) { return; } | |
if (typeof event.data !== 'string') { return; } | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type='text/javascript' src="//play.vidyard.com/v0/api.js"></script> | |
<script type='text/javascript' src="//play.vidyard.com/v1/progress-events.js"></script> | |
<script type='text/javascript'> | |
VidyardProgressEvents(function (result){ | |
if (result.event==1) { | |
dataLayer.push({ | |
event: 'vidyard', | |
eventCategory: 'video', | |
eventAction: "Play", | |
eventLabel: result.player.metadata.chapters_attributes[result.chapter].video_attributes.name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Include this script below: Google Analytics, Player Embed(s), and Vidyard API | |
Example Customer Implementations: | |
VidyardProgressEvents(function (result){console.log(result.event)}); | |
VidyardProgressEvents(function (result){console.log(result.event)}, [1,10,20,30,40,50,60,70,80,90]); | |
// Returns: | |
// result.event as integer | |
// result.chapter as integer | |
// result.player as a Vidyard player object | |
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<h1>Choose your next video!</h1> | |
<div> | |
<a href="http://play.vidyard.com/EXAMPLE.html"> | |
The first video | |
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Replace [UUID] with the UUID of the player you are attemping to embed. | |
To find the UUID of a player, see http://support.vidyard.com/articles/Public_Support/Find-the-UUID-for-your-player/ | |
--> | |
<div id="[UUID]"> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style type="text/css"> | |
#innerContainer { | |
position: relative; | |
display: block; | |
width: 100% !important; | |
height: 0; | |
padding: 56.25% 0 0 0; /* This should reflect your video aspect ratio */ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style type="text/css"> | |
#innerContainer { | |
position: relative; | |
display: block; | |
width: 100% !important; | |
height: 0; | |
padding: 56.25% 0 0 0; /* This should reflect your video aspect ratio */ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/***** | |
Purpose: | |
This code detects all inline embedded Vidyard players on a page and sets up the necessary event | |
listeners allowing you to execute code on the standard Vidyard player API events such as play, | |
pause, ready, etc. The script will also calculate when 0, 25, 50, 75 and 99 percent of a chapter | |
has been viewed and allow you to execute code at these points. | |
Usage: | |
This script should be included below the Vidyard API, web analytics tracking code (if applicable) and | |
all Vidyard embedded players. You can use the following line example to include it: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
The code below is a page with two embedded players. The player in the div "video-1" DOES NOT have a popout CTA on it. The player in the div "video-2" DOES have a CTA on it. | |
We have used media queries to separate the CSS into two branches. They have been labeled "Desktop CSS" and "Mobile CSS" in the comments. You can see that the split occurs when the screen width dips below 972px. | |
This is calculated by taking the maximum width of your player and adding enough pixels to cover the width of your CTA. By default this is 331px, which accounts for 300px plus a 31px border. In our example, the player is 640px so 640+331=971px. | |
*** You will likely need to change the value of 972px in BOTH media queries to accommodate the dimensions and layout of your page. Again, this should be the maximum width of your player + the width of your CTA *** | |
Your page must allow sufficient space in the iframe for both the player and the popout CTA when the CTA enabled player is visible. | |
I have done my best to comment the relevant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script> | |
function isElementInViewport (el) { | |
//special bonus for those using jQuery | |
if (typeof jQuery === "function" && el instanceof jQuery) { | |
el = el[0]; | |
} |