Skip to content

Instantly share code, notes, and snippets.

@jramsahai
Created July 27, 2017 13:28
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 jramsahai/22389e843833d941935c85202832b4d2 to your computer and use it in GitHub Desktop.
Save jramsahai/22389e843833d941935c85202832b4d2 to your computer and use it in GitHub Desktop.
Using the Vidyard player API to grab the Vidyard visitor ID for a given viewer.
var player = new Vidyard.player(uuid);
var callback = function() {
if (!player.metadata.visitorID) { return; }
// We have a visitor ID, do things!
console.log(player.metadata.visitorID);
// If we only want this callback to execute exactly once:
callback = function() {};
};
player.on('ready', callback);
player.on('visitor', callback);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment