I’m creating a custom module which has a video field.
For some reason, I cannot find a way to change the play icon in the video. Is there a way to override this button?
I have tried doing it via css but it didn’t work. Using javascript also didn’t work because of the CORS issue since the iframe domain is different than the page itself.
Hi, @sariyanta Welcome to the community! Let’s see if we can get the conversation started — hey @Jnix284@Stephanie-OG@LMeert have you managed to edit the “play” button in a video module? Or a similar type of customization?
Hi @sariyanta, happy to help, we’re all learning here! Yes, it is possible, I wouldn’t be able to help point you in the right direction without seeing how the module is coded. I don’t have as much experience building the modules as I do modifying them. I bet @Stephanie-OG will have a much quicker answer for you
As others have said, I don’t think you can edit HubSpot’s own video module. In the past, when I’ve created a custom video module I’ve used a custom module with a “File” field to select the video.
Then I add in the button using HTML, absolute position it in the center of the video using CSS and use JavaScript so that clicking on it will hide the button/play the video.
Hi @sariyanta, I’m not sure if it’s possible to change the styles of the play button if it comes from an iframe. You would need to change it on the original url, but if it’s a third party service I don’t think you will be able to do it (unless they offer customization options).
One thing you could do is to create an image with your desired play button that on click will open your video in a modal element, something like this.
@sariyanta I didn’t realize you were referring to the HubSpot standard module previously. Here’s an example of a custom video module styled with different layouts and buttons.
Thank you for the pointer. I see that the video is played in a pop-up on all the examples, and they are played automatically. Perhaps we will try something similar on our project.
If you want to use a native HubSpot video field, as @albertsg said this looks like it’s not possible since it’s an iframe and you don’t have access to the css/js files of that page.
I second the method of having a custom image + play button (could be added on top as CSS even, not necessarily included in the thumbnail this way you can add a :hover state to your button).
However, I’ve found out that the HubSpot video player makes the page load way slower, and in an effort to optimize the page speed, I’ve used this lightweight youtube embed plugin.
You can find the demonstration codepen here.
It works wonders, is very light to set up, customize and youtube analytics will give you plenty of free playback insights.
Hope this helps !