From 60dba7c6ad99229ab3f0c82f16ec1db15385b3e2 Mon Sep 17 00:00:00 2001 From: Sangwon Oh Date: Mon, 2 May 2022 14:15:57 +0900 Subject: [PATCH] Make display poster using video element --- src/js/view/components/helpers/main.js | 13 +++++++++++++ src/js/view/components/helpers/thumbnailTemplate.js | 1 - 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/js/view/components/helpers/main.js b/src/js/view/components/helpers/main.js index 00080130..58798a41 100644 --- a/src/js/view/components/helpers/main.js +++ b/src/js/view/components/helpers/main.js @@ -76,9 +76,22 @@ const Helpers = function($container, api){ messageBox = MessageBox($current, api, message, description, withTimer, iconClass, clickCallback, dontClose); } function createThumbnail(){ + + const mediaElement = api.getMediaElement(); + + if (mediaElement) { + mediaElement.poster = '' + } + + if (api.getConfig().image) { + mediaElement.poster = api.getConfig().image; + } + + if(thumbnail){ thumbnail.destroy(); } + thumbnail = Thumbnail($current, api, api.getConfig()); } function createWaterMark() { diff --git a/src/js/view/components/helpers/thumbnailTemplate.js b/src/js/view/components/helpers/thumbnailTemplate.js index 6c9cbe5a..fee60b3b 100644 --- a/src/js/view/components/helpers/thumbnailTemplate.js +++ b/src/js/view/components/helpers/thumbnailTemplate.js @@ -1,6 +1,5 @@ export default (uiText, data) => { return (`
`+ - `${data.image ? ``:``}` + `${data.title ? `
${data.title}
`:``}` + `
`); }; \ No newline at end of file