Skip to content

Instantly share code, notes, and snippets.

@giannif
giannif / gist:4755496
Last active December 12, 2015 09:59
Endslate
(function() {
"use strict";
var player = window.MTVNPlayer.getPlayers()[0];
// this is required because the flash player doesn't emit a config event yet.
if(!player.config.module) {
player.config.module = {};
}
player.config.formFactorID = prompt("formFactorID"); // change this to test different form factors.
// adjust these urls to your liking.
player.config.module.endslate = {
@giannif
giannif / gist:4475490
Last active December 10, 2015 18:38
BRBPL-3391 Listen for the player `performance` event, and report to omniture. Requires embed api v2.5.0.
// make sure this is defined on window.
var _gaq = window._gaq = window._gaq || [];
// set the account here. UA-37497376-1 is the one tied to gianni.ferullo@mtvn.com.
_gaq.push(['_setAccount', 'UA-37497376-1']);
// callback for 'performance' event.
function onPerformanceResults(event){
// see https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingTiming
// event.data is the performance results, loop through them: