hi guys, is there any plugin available that can display a static image and a video. something like how Facebook, twitter displays image and videos using the same container i guess… or can i write my own plugin
EDIT - Misread the question. I know of no plugin that does what you’re looking for but I have done this with no plugin. Here’s a possible workaround.
Container is a group.
Child 1 is a group with an image
Child 2 is a group with a video
Both children are invisible on page load. Both children collapse height when hidden.
Your post has a type (lets say 1 for image, 2 for vid)
You chose which child to show using conditionals based on the type.
Hope that helps.
Unsolicited observation:
Facebook seems to have an image thumbnail of the video when the page loads. They use an overlay on the image(video) which is the play button. It used to be that the video didn’t load if not clicked on. When play was clicked, you’d see the screen go black (thumbnail disappearing) and a loading spinner until the video was loaded, then it started playing.
I think they have now built out some sort of optimization algorithm to load the video below the fold or when it’s short or load the first x seconds. Must’ve come up when they had video autoplay enabled because since they’ve turned autoplay off, most videos play immediately. But either way if you inspect the element it looks like there’s no player element until you click play. You could try building out something like that if you’re really keen.
thanks i will try that and will dm you a reply thanks a lot