diff --git a/src/amp-story-player/amp-story-player-impl.js b/src/amp-story-player/amp-story-player-impl.js index 36896f4f7206..4e99f2c8b547 100644 --- a/src/amp-story-player/amp-story-player-impl.js +++ b/src/amp-story-player/amp-story-player-impl.js @@ -386,10 +386,16 @@ export class AmpStoryPlayer { initializeAnchorElStories_() { const anchorEls = toArray(this.element_.querySelectorAll('a')); anchorEls.forEach((element) => { + const posterImgEl = element.querySelector( + 'img[data-amp-story-player-poster-img]' + ); + const posterImgSrc = posterImgEl && posterImgEl.getAttribute('src'); + const story = /** @type {!StoryDef} */ ({ href: element.href, title: (element.textContent && element.textContent.trim()) || null, - posterImage: element.getAttribute('data-poster-portrait-src'), + posterImage: + element.getAttribute('data-poster-portrait-src') || posterImgSrc, }); this.initializeAndAddStory_(story);