Simon Harvey Posted February 8, 2018 Posted February 8, 2018 Hello, Our forum allows users to post videos which are embedded directly into posts using HTML5 <video> tags. I was wondering if it is possible to insert the video thumbnail image into the recent posts feed in the sidebar? Does anyone have any idea of how this can be done? Thanks a lot.
opentype Posted February 8, 2018 Posted February 8, 2018 A HTML5 video doesn’t have a video thumbnail.
Simon Harvey Posted February 8, 2018 Author Posted February 8, 2018 Thanks for coming back to me so quickly. Sorry - I meant the poster image. At the moment the text between the <video> </video> tags is displayed as if the browser doesn't support video tags - which is expected. I could include an <img> in there but how can I enable images to be displayed in the posts feed? e.g. <video class="myvideovid" controls="" height="480" poster="/PATH/TO/IMAGE/theimage.jpg" width="640"> <source src="/PATH/TO/VIDEO/thevideo.mp4" type="video/mp4"> <img src="/PATH/TO/IMAGE/theimage.jpg" class="videoposter"> </video> I don't mind editing code - I'm just not sure where the post html is cleaned for displaying in the feed. Maybe I could allow images through by class? Or just images that are contained between video tags?
opentype Posted February 8, 2018 Posted February 8, 2018 There is no option to “enable” it. You would have to edit the postFeed template of your theme. The stripped version without images/videos is created through this: {$comment->truncated( true )|raw}
Simon Harvey Posted February 8, 2018 Author Posted February 8, 2018 Ah great, that's exactly what I was looking for - I'll create my own truncated version that allows for the video poster images to be displayed. Thanks for your help.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.