Skip to content

Commit

Permalink
Implelmentation of renderStart and noContentAvaliable API
Browse files Browse the repository at this point in the history
Following the guidance of this documentation, [ads README.md](https://github.com/ampproject/amphtml/blob/master/ads/README.md)
  • Loading branch information
PengXing committed Nov 29, 2018
1 parent f07730e commit 85fd9ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
9 changes: 5 additions & 4 deletions ads/_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,6 @@ export const adConfig = {
],
},

'baidu': {
prefetch: 'https://dup.baidustatic.com/js/dm.js',
},

'adthrive': {
prefetch: [
'https://www.googletagservices.com/tag/js/gpt.js',
Expand Down Expand Up @@ -1072,4 +1068,9 @@ export const adConfig = {
],
},

'baidu': {
prefetch: 'https://dup.baidustatic.com/js/dm.js',
renderStartImplemented: true,
},

};
11 changes: 10 additions & 1 deletion ads/baidu.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,14 @@ export function baidu(global, data) {
async: true,
});

loadScript(global, 'https://dup.baidustatic.com/js/dm.js');
loadScript(
global,
'https://dup.baidustatic.com/js/dm.js',
() => {
global.context.renderStart();
},
() => {
global.context.noContentAvailable();
},
);
}

0 comments on commit 85fd9ca

Please sign in to comment.