File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -386,10 +386,16 @@ export class AmpStoryPlayer {
386386 initializeAnchorElStories_ ( ) {
387387 const anchorEls = toArray ( this . element_ . querySelectorAll ( 'a' ) ) ;
388388 anchorEls . forEach ( ( element ) => {
389+ const posterImgEl = element . querySelector (
390+ 'img[data-amp-story-player-poster-img]'
391+ ) ;
392+ const posterImgSrc = posterImgEl && posterImgEl . getAttribute ( 'src' ) ;
393+
389394 const story = /** @type {!StoryDef } */ ( {
390395 href : element . href ,
391396 title : ( element . textContent && element . textContent . trim ( ) ) || null ,
392- posterImage : element . getAttribute ( 'data-poster-portrait-src' ) ,
397+ posterImage :
398+ element . getAttribute ( 'data-poster-portrait-src' ) || posterImgSrc ,
393399 } ) ;
394400
395401 this . initializeAndAddStory_ ( story ) ;
You can’t perform that action at this time.
0 commit comments