Skip to content

Instantly share code, notes, and snippets.

@msukmanowsky
Last active September 20, 2016 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msukmanowsky/2ba49b9e531370dc1d3ce5d1fefd9e8b to your computer and use it in GitHub Desktop.
Save msukmanowsky/2ba49b9e531370dc1d3ce5d1fefd9e8b to your computer and use it in GitHub Desktop.
<script src="http://content.jwplatform.com/libraries/2SJ3KAcS.js"></script>
<div id="embed_container">Loading the player...</div>
<script type="text/javascript">
var player = jwplayer("embed_container");
player.setup({
file: "http://content.jwplatform.com/videos/xxxxxxxx.mp4",
image: "http://content.jwplatform.com/thumbs/xxxxxxxx.jpg",
mediaid: "myvideoid12345",
width: 640,
height: 360,
title: 'Basic Video Embed',
description: 'A video with a basic title and description!'
});
player.on('ready', function() {
player.on("play", function(){
var playlistItem = player.getPlaylistItem(player.getPlaylistIndex());
PARSELY.video.trackPlay(
playlistItem.mediaid,
{
// required
title: playlistItem.title,
// recommended
image_url: playlistItem.image,
section: "My Video's Section",
pub_date_tmsp: 1474393968763, // milliseconds since unix epoch
// optional
tags: ["mytag1", "mytag2"],
authors: ["My Video's Author"]
});
});
player.on("pause", function(){
var playlistItem = player.getPlaylistItem(player.getPlaylistIndex());
PARSELY.video.trackPause(playlistItem.mediaid);
});
player.on("stop", function(){
var playlistItem = player.getPlaylistItem(player.getPlaylistIndex());
PARSELY.video.trackPause(playlistItem.mediaid);
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment