diff --git a/ads/nativeroll.js b/ads/nativeroll.js index d4cfde308fa4..9ab41d6c4dbc 100644 --- a/ads/nativeroll.js +++ b/ads/nativeroll.js @@ -26,19 +26,28 @@ export function nativeroll(global, data) { global, 'https://cdn01.nativeroll.tv/js/seedr-player.min.js', () => { - initPlayer(data); + initPlayer(global, data); } ); } /** + * @param {!Window} global * @param {!Object} data */ -function initPlayer(data) { +function initPlayer(global, data) { const config = { container: '#c', desiredOffset: 50, gid: data.gid, + onError: () => { + global.context.noContentAvailable(); + }, + onLoad: () => { + const height = global.document.getElementsByClassName('nr-player')[0] + ./* OK */ offsetHeight; + global.context.requestResize(undefined, height); + }, }; // eslint-disable-next-line no-undef SeedrPlayer(config); diff --git a/examples/ads.amp.html b/examples/ads.amp.html index 8cd2100fa802..25100d1739eb 100644 --- a/examples/ads.amp.html +++ b/examples/ads.amp.html @@ -276,9 +276,9 @@ - +