Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<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
You can’t perform that action at this time.