blob: 0e6da190e9f28b1ca56e3c3644cd656222a8d623 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
/* global brightcove, brightcoveData */
( function( $ ) {
var script = document.createElement( 'script' ),
tld = 'co.jp' === brightcoveData.tld ? 'co.jp' : 'com',
timer = false;
// Load Brightcove script
script.src = 'https://sadmin.brightcove.' + tld + '/js/BrightcoveExperiences.js';
script.type = 'text/javascript';
script.language = 'JavaScript';
document.head.appendChild( script );
// Start detection for Brightcove script loading in its object
try_brightcove();
// Detect if Brightcove script has loaded and bind some events once loaded
function try_brightcove() {
clearTimeout( timer );
if ( 'object' === typeof brightcove ) {
$( document ).ready( brightcove.createExperiences );
$( 'body' ).on( 'post-load', brightcove.createExperiences );
brightcove.createExperiences();
} else {
timer = setTimeout( try_brightcove, 100 );
}
}
} )( jQuery );
|