You are on page 1of 5

(function(document, player) {

/* global TextTrackList, ActiveXObject, VimeoPlayer */

var config =
{"cdn_url":"https://f.vimeocdn.com","vimeo_api_url":"api.vimeo.com","request":
{"files":{"dash":{"separate_av":true,"streams":
[{"profile":164,"quality":"360p","id":825139354,"fps":25},
{"profile":165,"quality":"540p","id":825139359,"fps":25},
{"profile":169,"quality":"1080p","id":825139358,"fps":50},
{"profile":174,"quality":"720p","id":825139355,"fps":50}],"cdns":
{"akfire_interconnect_quic":{"url":"https://51skyfiregce-
vimeo.akamaized.net/exp=1541011610~acl=%2F232846650%2F
%2A~hmac=9657d556214f9a7d96cf3b06dbd2110576783ce5057bf6756fd5c969f5e2eab8/232846650
/sep/video/825139354,825139359,825139358,825139355/master.json?
base64_init=1","origin":"gcs"},"fastly_skyfire":
{"url":"https://skyfire.vimeocdn.com/1541011610-
0xf7f255efe56ff4ae80b6043e994bebc6ed3d3a54/232846650/sep/video/825139354,825139359,
825139358,825139355/master.json?
base64_init=1","origin":"gcs"}},"default_cdn":"fastly_skyfire"},"hls":
{"separate_av":false,"default_cdn":"fastly_skyfire","cdns":
{"akfire_interconnect_quic":{"url":"https://51skyfiregce-
vimeo.akamaized.net/exp=1541011610~acl=%2F232846650%2F
%2A~hmac=9657d556214f9a7d96cf3b06dbd2110576783ce5057bf6756fd5c969f5e2eab8/232846650
/video/825139354,825139359,825139358,825139356,825139355/master.m3u8","origin":"gcs
"},"fastly_skyfire":{"url":"https://skyfire.vimeocdn.com/1541011610-
0xf7f255efe56ff4ae80b6043e994bebc6ed3d3a54/232846650/video/825139354,825139359,8251
39358,825139356,825139355/master.m3u8","origin":"gcs"}}},"progressive":
[{"profile":165,"width":960,"mime":"video/mp4","fps":25,"url":"https://fpdl.vimeocd
n.com/vimeo-prod-skyfire-std-us/01/1569/9/232846650/825139359.mp4?token=1541011610-
0xf39c602c54cddf6b9559017933e4d4fcc82c37e7","cdn":"fastly","quality":"540p","id":82
5139359,"origin":"gcs","height":540},
{"profile":169,"width":1920,"mime":"video/mp4","fps":50,"url":"https://fpdl.vimeocd
n.com/vimeo-prod-skyfire-std-us/01/1569/9/232846650/825139358.mp4?token=1541011610-
0x264d112894da874521fe3269d735d9890f94201f","cdn":"fastly","quality":"1080p","id":8
25139358,"origin":"gcs","height":1080},
{"profile":175,"width":1920,"mime":"video/mp4","fps":25,"url":"https://fpdl.vimeocd
n.com/vimeo-prod-skyfire-std-us/01/1569/9/232846650/825139356.mp4?token=1541011610-
0x04ce4e96e543a22e5b30fd76eea159c4a8f53c00","cdn":"fastly","quality":"1080p","id":8
25139356,"origin":"gcs","height":1080},
{"profile":174,"width":1280,"mime":"video/mp4","fps":50,"url":"https://fpdl.vimeocd
n.com/vimeo-prod-skyfire-std-us/01/1569/9/232846650/825139355.mp4?token=1541011610-
0x07a92e77f505b340ef64599f9c80356054391e4d","cdn":"fastly","quality":"720p","id":82
5139355,"origin":"gcs","height":720},
{"profile":164,"width":640,"mime":"video/mp4","fps":25,"url":"https://fpdl.vimeocdn
.com/vimeo-prod-skyfire-std-us/01/1569/9/232846650/825139354.mp4?token=1541011610-
0x5deeb60d3f025de5d0152eb1eba0a096834c6881","cdn":"fastly","quality":"360p","id":82
5139354,"origin":"gcs","height":360}]},"lang":"en","sentry":
{"url":"https://6f5f8e1cecfa40fb850f578b69fc1705@sentry.io/1297650","enabled":false
,"debug_enabled":true,"debug_intent":0},"ab_tests":{"chromecast":{"data":
{},"group":false}},"referrer":"https://www.yogaforbjj.net/handstand-program-
1/","cookie_domain":".vimeo.com","timestamp":1541007710,"gc_debug":
{"bucket":"vimeo-player-
debug"},"expires":3600,"currency":"EUR","session":"9cb88f535693ac5d5d05cf14b1069ee7
a97d5bc21541007710","cookie":
{"scaling":1,"volume":1.0,"quality":null,"hd":0,"captions":null},"build":
{"player":"","backend":"1.0.20","js":"3.5.20"},"urls":
{"barebone_js":"https://f.vimeocdn.com/p/3.5.20/js/barebone.js","zeroclip_swf":"htt
ps://f.vimeocdn.com/p/external/zeroclipboard/ZeroClipboard.swf","fresnel":"https://
fresnel.vimeocdn.com/add/player-
stats","js":"https://f.vimeocdn.com/p/3.5.20/js/player.js","proxy":"https://player.
vimeo.com/static/proxy.html","chromeless_css":"https://f.vimeocdn.com/p/3.5.20/css/
chromeless.css","three_js":"https://f.vimeocdn.com/p/external/three.rvimeo.min.js",
"mux_url":"https://f.vimeocdn.com/p/external/mux.js","vuid_js":"https://f.vimeocdn.
com/js_opt/modules/utils/vuid.min.js","chromeless_js":"https://f.vimeocdn.com/p/3.5
.20/js/chromeless.js","zeroclip_js":"https://f.vimeocdn.com/p/external/zeroclipboar
d/ZeroClipboard-
patch.js","css":"https://f.vimeocdn.com/p/3.5.20/css/player.css"},"signature":"3526
0cd0bfa0cf77ae3d217ab22f46ab","flags":
{"preload_video":"metadata_on_hover","plays":1,"log_to_es":0,"webp":1,"dnt":0,"part
ials":1,"autohide_controls":0},"country":"IT"},"player_url":"player.vimeo.com","vid
eo":{"version":{"current":null,"available":
[]},"height":1080,"duration":457,"thumbs":
{"1280":"https://i.vimeocdn.com/video/654145419_1280.jpg","960":"https://i.vimeocdn
.com/video/654145419_960.jpg","640":"https://i.vimeocdn.com/video/654145419_640.jpg
","base":"https://i.vimeocdn.com/video/654145419"},"owner":
{"account_type":"pro","name":"YogaforBJJ","img":"https://i.vimeocdn.com/portrait/15
774908_60x60.jpg","url":"https://vimeo.com/yogaforbjj","img_2x":"https://i.vimeocdn
.com/portrait/15774908_120x120.jpg","id":469237},"file_codecs":{"hevc":{"hdr":
[],"sdr":[]},"avc":
[825139359,825139358,825139355,825139354]},"id":232846650,"embed_code":"<iframe
src=\"https://player.vimeo.com/video/232846650\" width=\"640\" height=\"360\"
frameborder=\"0\" allowfullscreen><\/iframe>","title":"Handstand Program
#1","share_url":"https://vimeo.com/232846650","width":1920,"embed_permission":"whit
elist","fps":25.0,"spatial":0,"live_event":null,"allow_hd":1,"hd":1,"lang":null,"de
fault_to_hd":1,"url":null,"privacy":"disable","bypass_token":"eyJ0eXAiOiJKV1QiLCJhb
GciOiJIUzI1NiJ9.eyJjbGlwX2lkIjoyMzI4NDY2NTAsImV4cCI6MTU0MTAxMTMxMH0.XcwtRRVQORLyuzr
VsEECxo4ktTRQ_kHWQpViN4Yq_-M","unlisted_hash":null},"user":
{"vimeo_api_interaction_tokens":null,"liked":0,"account_type":"none","vimeo_api_cli
ent_token":null,"progress":0,"owner":0,"watch_later":0,"logged_in":0,"id":0,"mod":0
},"embed":{"autopause":0,"playsinline":1,"settings":
{"fullscreen":1,"byline":0,"like":0,"playbar":1,"title":0,"color":0,"speed":0,"watc
h_later":0,"share":0,"scaling":1,"spatial_compass":0,"collections":0,"info_on_pause
":0,"portrait":0,"logo":0,"embed":0,"badge":0,"spatial_label":0,"volume":1},"color"
:"00adef","on_site":0,"app_id":"","muted":0,"dnt":0,"player_id":"","api":3,"editor"
:false,"context":"embed.main","time":0,"outro":"nothing","log_plays":1,"quality":nu
ll,"transparent":1,"loop":0,"autoplay":0},"view":1,"vimeo_url":"vimeo.com"};

if (!config.request) {
// console.error('Invalid config');
return;
}

if (typeof config.request === 'object' && 'error' in config.request) {


if ('html' in config.request) {
document.documentElement.innerHTML =
config.request.html.replace(/&lt;/g, '<').replace(/&gt;/g, '>');
}
return;
}

// This probably won't be needed, but we have frame origin set to only
// allow pages loaded from player.vimeo.com so if this is inside of an
// iframe we should not try to redirect to the vimeo.com url.
//
// We should only redirect if the player.vimeo.com/video/123 URL is
// requested directly.
//
// @see http://stackoverflow.com/questions/326069/how-to-identify-if-a-
webpage-is-being-loaded-inside-an-iframe-or-directly-into-t
var isIframe = (function() {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}());

// Redirect to the mobile site when player is loaded via the twitter app
// for iOS (and Android?). This is so we can leverage the mobile site's
// outro in these cases and provide a tweet button.
if (!isIframe && /twitter/i.test(navigator.userAgent) && config.video.url)
{
window.location = config.video.url;
}

// i18n ______________________________________________________
if (config.request.lang) {
document.documentElement.setAttribute('lang', config.request.lang);
}

// Support tests ______________________________________________________

// Check all the prefixed versions of the fullscreen api for support.
var fullscreenSupport = 'exitFullscreen' in document ||
'webkitExitFullscreen' in document || 'webkitCancelFullScreen' in document ||
'mozCancelFullScreen' in document || 'msExitFullscreen' in document ||
'webkitEnterFullScreen' in document.createElement('video');

// Check for h264 and text track support.


var videoSupport = (function() {
var video = document.createElement('video');

return {
h264: 'canPlayType' in video && video.canPlayType('video/mp4') !==
'',
textTracks: typeof TextTrackList !== 'undefined' && typeof
video.textTracks !== 'undefined' && video.textTracks instanceof TextTrackList
};
}());

// Does this browser support inlining SVG into HTML?


// From modernizr:
https://github.com/Modernizr/Modernizr/blob/master/feature-detects/svg/inline.js
var inlineSvgSupport = (function() {
var div = document.createElement('div');
div.innerHTML = '<svg/>';
return (div.firstChild && div.firstChild.namespaceURI) ===
'http://www.w3.org/2000/svg';
}());

// Put Windows phone through.


var windowsPhone = /MSIE 9/.test(navigator.userAgent) && /Windows
Phone/.test(navigator.userAgent);
var IE10 = /IE 10/.test(navigator.userAgent);
// Initialization _____________________________________________________

/**
* We want to use the player if:
* 1. The browser has fullscreen support, regardless of if it�s enabled,
* 2. IE10 with no Flash support,
* 3. Windows Phone
*/
var usePlayer = fullscreenSupport || IE10 || windowsPhone;

// We'll be inserting both the stylesheet and javascript before this script
var firstScript = document.getElementsByTagName('script')[0];
var script = document.createElement('script');
var jsDone = false;
var playerObject = false;

// If the browser doesn't support inline svg, don't use the player.
if (!inlineSvgSupport) {
usePlayer = false;
}

// @NOTE: Make sure this is commented out before committing. - Ryan


// usePlayer = false;

if (!usePlayer) {
// Remove placeholder if it exists for flash and fallback.
// It overlaps the content.
var placeholder = document.querySelector('.vp-placeholder');
if (placeholder && placeholder.parentNode) {
placeholder.parentNode.removeChild(placeholder);
}
}

if (usePlayer) {
// Add the loading class now to avoid any possibility of seeing
// something before the player loads
player.className = 'player loading';

var startTime = new Date().getTime();

// Start the loading of the javascript first


script.src = config.request.urls.js;

firstScript.parentNode.insertBefore(script, firstScript);
script['onreadystatechange' in script ? 'onreadystatechange' :
'onload'] = function() {
if (!jsDone && (!this.readyState || this.readyState === 'loaded' ||
this.readyState === 'complete')) {
jsDone = true;
playerObject = new VimeoPlayer(player, config, cssDone ||
{ link: link, startTime: startTime });
}
};

// Load the stylesheet


var cssDone = false;
var link = document.createElement('link');
link.rel = 'stylesheet';
// cacheBuster for ie only
http://stackoverflow.com/questions/10316247/media-queries-fail-inside-ie9-iframe
link.href = config.request.urls.css + (typeof cacheBuster ===
'undefined' ? '' : cacheBuster);

document.getElementsByTagName('head')[0].appendChild(link);
link.onload = function() {
cssDone = true;
};
}
else {
player.innerHTML = '<div class="fallback"><iframe
src="/video/232846650/fallback?js&amp;referrer=' +
encodeURIComponent(config.request.referrer) + '" frameborder="0"></iframe></div>';
}

if (!config.request.flags.dnt && !config.embed.dnt) {


window._vuid = [
['pid', config.request.session]
];
var vim = document.createElement('script');
vim.async = true;
vim.src = config.request.urls.vuid_js;
firstScript.parentNode.insertBefore(vim, firstScript);
}

}(document, document.getElementById('player')));

You might also like