Skip to content

Commit

Permalink
fix bladeOnLoad callback (#24683)
Browse files Browse the repository at this point in the history
  • Loading branch information
gershman authored and calebcordry committed Oct 1, 2019
1 parent 0ab715e commit f69d65e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ads/blade.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,17 @@ export function blade(global, data) {
}`;
createContainer(containerId);

global[`_bladeConfig-${containerId}`] = {
const bladeConfig = `_bladeConfig-${containerId}`;
global[bladeConfig] = {
playerId: data['blade_player_id'],
apiKey: data['blade_api_key'],
version: '1.0',
macros,
};
const ctx = global.context;

global[`_bladeOnLoad-${containerId}`] = function(error, player) {
const bladeOnLoad = `_bladeOnLoad-${containerId}`;
global[bladeOnLoad] = function(error, player) {
if (error) {
global.context.noContentAvailable();
return;
Expand All @@ -73,7 +75,7 @@ export function blade(global, data) {
data['blade_player_id']
}/player.js?t=${
data['blade_player_type']
}&callback=_bladeOnLoad&config=_bladeConfig&c=${containerId}`,
}&callback=${bladeOnLoad}&config=${bladeConfig}&c=${containerId}`,
undefined,
() => {
global.context.noContentAvailable();
Expand Down

0 comments on commit f69d65e

Please sign in to comment.