Problem/Motivation

When logged out there is a javascript error in /js/plugins/background_media/build.js that prevents the script adding the inline height CSS property to .background-local-video. No height means the absolute positioning of the video fails and consequently the video isn't visible.

(Looks like this is also an issue with scroll_effects too.)

Steps to reproduce

Add a background video to your section. Log out and view the page. The video won't display because there is no height set on the .background-local-video div. Inspect console and you'll see an "Uncaught TypeError: can't access property "behaviors", Drupal is undefined" error.

Tested in latest Chrome build and Firefox Developer Edition.

Proposed resolution

Extending my theme to include the following works, but should this be done at the module level?

libraries-extend:
  bootstrap_styles/plugin.background_media.build:
    - core/jquery
    - core/drupal

Remaining tasks

User interface changes

API changes

Data model changes

Comments

QuietSpecialist created an issue. See original summary.

QuietSpecialist’s picture

Issue summary: View changes
QuietSpecialist’s picture

Issue summary: View changes
QuietSpecialist’s picture

Issue summary: View changes
scottriggle’s picture

Same issue with me.

cassioalmeida’s picture

Status: Active » Closed (works as designed)

Hi everyone, thanks for the contribution.

The only way that I was able to reproduce the issue was by creating a section without any block/content, only with the background video.
If you add any block/content you should see the background fixed/centered. Also, the height must be based on content height and some padding, not the background.

I hope that makes sense. I'll mark it as work as designed, please let me know if you have any other cases.

Regards,

Cassio

andre.bonon’s picture

Hi, @QuietSpecialist, I was not able to reproduce the "Uncaught TypeError: can't access property "behaviors", Drupal is undefined" error in a fresh Drupal 9 installation + Bootstrap Barrio subtheme.
Modules installed:
- drupal/layout_builder_blocks
- drupal/bootstrap_styles
- drupal/bootstrap_layout_builder

I've added a new section and a custom block inside it. I selected a background video and saved. Also I hide the h2 element of the custom block.

Results:
- no errors found on last chrome build.
- background video not visible due to the height missing. Which is expected since I've not added any content to it.

As @cassioalmeida mentioned, this is working as design.

If this issue still happening, please feel free to reopen this issue and add more information of how to reproduce it.
For instance, the drupal core version, theme installed, layout builder configuration and so on.

QuietSpecialist’s picture

Thanks for looking into.

scottriggle’s picture

@QuietSpecialist, did you ever resolve this? It's still happening for me and I place what you suggested into my info file.