Specific directions for adding code for video background

I’ve read the directions for adding a video background but as I am new I need to ask for more specific help. Exactly where should I paste the code found here Background Control – Bricks Academy? I pasted it into my functions.php file of my child theme and got errors.

Also can you specify how to do this?
“load the bricksBackgroundVideoInit script and use the BricksFrontend::get_element_background_video_wrapper() method to render it.”

Thank you!

Hi @liatmgat,

Thank you for reaching out!

Could you give me more context on what exactly you’re trying to accomplish? I’m not sure if you’re trying to develop your own custom elements or just add background video to a Bricks element.

I should be able to help you better with that extra information.

Regards,
Bruno

Thank you Bruno for answering!
I’m just trying to add a background video to a Bricks element.

Liat

You don’t need to add any custom code to functions.php in order to add background video to a Bricks element.

You can do it very simply through settings.

I recorded a video demonstrating how to do that. I also show how to add a video as a File URL rather than YouTube / Vimeo link.

Let me know if that helps or you have any other questions!

Regards,
Bruno

Thank you sooo much! I see the Background Video field now. It disappears when you add an image, that’s why I didn’t see the field there. Thank you!!

Adding a self hosted mp4 video doesn’t work at all for me. I’m using latest version of bricks.