Skip to content

Instantly share code, notes, and snippets.

@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:
@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:5187610
Last active December 15, 2015 02:29
Endslate Module JSON
var config = {
module:{
endslate: {
"$": {
"shim": true,
"url": "http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"
},
"mtvn-util": "http://media.mtvnservices.com/player/api/module/mtvn-util/latest/mtvn-util.min.js",
"endslate-css": "http://media.mtvnservices.com/player/api/module/endslate/latest/style.css",
"endslate": "http://media.mtvnservices.com/player/api/module/endslate/latest/endslate.min.js"
@giannif
giannif / gist:6527629
Last active December 22, 2015 20:39
p-js in syndication
<!DOCTYPE html>
<html lang="en">
<head>
<title>MTVNPlayer</title>
<style>
.MTVNPlayer {
width: "100%";
height: "100%";
}
</style>
@giannif
giannif / gist:6598709
Last active December 23, 2015 07:09
p-js in a brand page
<!DOCTYPE html>
<html lang="en">
<head>
<title>MTVNPlayer</title>
<style>
.MTVNPlayer {
width: "100%";
height: "100%";
}
</style>
{
"feed": "xml/feed/feed_hills.xml",
"mediaGen": "http://www.mtv.com/global/feeds/common/uber_mediaGenBase.jhtml?device=iPad&acceptMethods=hls,phttp&uri={uri}",
"relatedFeed": "xml/feed/feed_hills.xml",
"nielsenClientID": "us-400235",
"nielsenReporterEnabled": true,
"nielsenVideoCensusID": "b03",
"networkPlayerName": "Site",
"partnerPlayerName": "Partner",
"viralPlayerName": "Syndicated",
@giannif
giannif / gist:8846860
Last active August 29, 2015 13:56
p-js in syndication alternate
<!DOCTYPE html>
<html lang="en">
<head>
<title>MTVNPlayer</title>
<style>
.MTVNPlayer {
width: "100%";
height: "100%";
}
</style>
{
"uri": "http://api39-phx.unicornmedia.com/now/stitched/mp4/7b65c9c3-5342-4d95-8867-2a51d0d7cbbf/1d52fc9e-d747-4a9b-8ad3-aff289c377e7/3a41c6e4-93a3-4108-8995-64ffca7b9106/bbba6e67-349d-4de3-9e2a-28e7eed1c31a/content.mp4?oasid=e493cc14-89c3-4cc0-8814-e191d1c1d2fa&umtp=0",
"totalDuration": "686.266",
"trackers": [{
"breakId": "0",
"event": "firstQuartile",
"url": "http://tracking.adprovider.qa.unicornapp.com/beacon/noe/firstQuartile",
"timeToFire": 3
}, {
"breakId": "0",
{
"vmap:VMAP": {
"@version": "1.0",
"@xmlns:uo": "uo",
"@xmlns:vmap": "vmap",
"@xmlns:xsi": "xsi",
"vmap:Extensions": {
"uo:unicornOnce": {
"@ttl": "600",
"@contenturi": "http://api33-phx.unicornmedia.com/now/stitched/mp4/7b65c9c3-5342-4d95-8867-2a51d0d7cbbf/1d52fc9e-d747-4a9b-8ad3-aff289c377e7/3a41c6e4-93a3-4108-8995-64ffca7b9106/bbba6e67-349d-4de3-9e2a-28e7eed1c31a/content.mp4?oasid=477b95dd-35d5-437e-8ff2-97ff5f331d8d&umtp=0",
@giannif
giannif / gist:9009022
Last active August 29, 2015 13:56
p-js service config response

URL:

/config/:uri

{
  "mediaGen": {
    "vmap": {
      // The stream url to play.
      "uri": "http://streamurl.com",
      // The duration of the stream (including ads, of course).