Gallery: Use 'poster' attribute for video thumnails

Bug: T191098
Change-Id: I0f4e456ec7a52ee71dcfca581c73415fc8ee6178
This commit is contained in:
Ed Sanders 2018-04-05 22:14:16 +01:00
parent 8b42a5917c
commit 43a8004abb

View file

@ -72,7 +72,8 @@ ve.dm.MWGalleryImageNode.static.toDataElement = function ( domElements, converte
attributes: { attributes: {
resource: ve.normalizeParsoidResourceName( img.getAttribute( 'resource' ) ), resource: ve.normalizeParsoidResourceName( img.getAttribute( 'resource' ) ),
altText: img.getAttribute( 'alt' ), altText: img.getAttribute( 'alt' ),
src: img.getAttribute( 'src' ), // 'src' for images, 'poster' for video/audio
src: img.getAttribute( 'src' ) || img.getAttribute( 'poster' ),
height: img.getAttribute( 'height' ), height: img.getAttribute( 'height' ),
width: img.getAttribute( 'width' ) width: img.getAttribute( 'width' )
} }