How to keep text overlaid on video banner in mobile mode?

Hi everyone, thank you in advance for looking at this.

I am trying to add a video banner which takes a video from “my files” on Shopify and repeats. This would be like the Dawn Image Banner Section (except a video instead of an image).

I downloaded a custom liquid code from Ecom geeks (Ecom Geeks | Facebook) which works very well on desktop mode.

But the moment I switch to mobile, the Text Header and Description which is supposed to be overlaid over the video suddenly shifts below the video. I want the Text Header and Description to be overlaid on the video.

Please help!

Screenshots below:

In this first image, I am showing both the custom video banner (top) and image banner (below) in Desktop viewing mode. I have no issues in Desktop mode, everything is working great.

In this second image, which is in Mobile viewing mode, you can see the text is no longer overlaid over the video and shifts below it. Unlike the text header over the image banner which continues to be overlaid over the image.

Here is the code provided by Ecom Geeks

{%- if section.blocks.size > 0 -%}

{%- for block in section.blocks -%}

{%- assign img_url = block.settings.image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}

 

{% if block.type == 'video' %}

 

{%- if block.settings.video_link != blank -%}

{% endif %}

 

{% if block.settings.title != blank %}

# 

{{ block.settings.title | escape }}

{% endif %}

 

{%- style -%}

.videoBackground .imageBoxInfoDescription p {

color: {{ block.settings.color_text }}!important;

}

{%- endstyle -%}

 

{% if block.settings.text != blank %}

{{ block.settings.text }}

{% endif %}

 

{% if block.settings.button_link != blank and block.settings.button_label != blank %}

{{ block.settings.button_label | escape }}

{% endif %}

{% else %}

 

 

{% if block.settings.title != blank %}

# 

{{ block.settings.title | escape }}

{% endif %}

 

{%- style -%}

.videoBackground .imageBoxInfoDescription p {

color: {{ block.settings.color_text }}!important;

}

{%- endstyle -%}

 

{% if block.settings.text != blank %}

{{ block.settings.text }}

{% endif %}

 

{% if block.settings.button_link != blank and block.settings.button_label != blank %}

{{ block.settings.button_label | escape }}

{% endif %}

{% endif %}

{%- endfor -%}

 

{% else %}

This section doesn’t currently include any content. Add content to this section using the sidebar.

    

{%- endif -%}

 

 

{% schema %}

{

"name": {

"en": "Video Background"

},

"class": "videoBackground",

"max_blocks": 1,

"blocks": [

{

"type": "video",

"name": "Video",

"settings": [

{

"type": "url",

"id": "video_link",

"label": {

"en": "Video link"

}

},

{

"type": "image_picker",

"id": "video_image",

"label": {

"en": "Cover image"

}

},

{

"type": "header",

"content": {

"en": "Text"

}

},

{

"type": "text",

"id": "title",

"label": {

"en": "Heading"

},

"default": "Video slide"

},

{

"type": "richtext",

"id": "text",

"label": {

"en": "Description"

},

"default": {

"en": "

Use this text to share information about your brand with your customers. Describe a product, share announcements, or welcome customers to your store.

"

}

},

{

"type": "color",

"id": "color_text",

"label": {

"en": "Text color"

},

"default": "#ffffff"

},

{

"type": "text",

"id": "button_label",

"label": {

"en": "Button label"

}

},

{

"type": "url",

"id": "button_link",

"label": {

"en": "Button link"

}

},

{

"type": "color",

"id": "color_btn_bg",

"label": {

"en": "Background button color"

},

"default": "#ffffff"

},

{

"type": "color",

"id": "color_btn_text",

"label": {

"en": "Button text color"

},

"default": "#ffffff"

}

]

},

{

"type": "image",

"name": "Image",

"settings": [

{

"type": "color",

"id": "color_bg",

"label": {

"en": "Background color (optional)"

},

"default": "#16165b"

},

{

"type": "image_picker",

"id": "image_bg",

"label": {

"en": "or use an image (required)"

}

},

{

"type": "range",

"id": "overlay_opacity",

"label": {

"en": "Overlay opacity"

},

"min": 0,

"max": 99,

"step": 1,

"unit": {

"en": "%"

},

"default": 0

},

{

"type": "header",

"content": {

"en": "Text"

}

},

{

"type": "text",

"id": "title",

"default": "Image slide",

"label": {

"en": "Heading"

}

},

{

"type": "richtext",

"id": "text",

"label": {

"en": "Description"

},

"default": {

"en": "

Use this text to share information about your brand with your customers. Describe a product, share announcements, or welcome customers to your store.

"

}

},

{

"type": "color",

"id": "color_text",

"label": {

"en": "Text color"

},

"default": "#ffffff"

},

{

"type": "text",

"id": "button_label",

"label": {

"en": "Button label"

}

},

{

"type": "url",

"id": "button_link",

"label": {

"en": "Button link"

}

},

{

"type": "color",

"id": "color_btn_bg",

"label": {

"en": "Background button color"

},

"default": "#ffffff"

},

{

"type": "color",

"id": "color_btn_text",

"label": {

"en": "Button text color"

},

"default": "#ffffff"

}

]

}

],

"presets": [

{

"name": {

"en": "Video Background"

},

"category": {

"en": "Main"

},

"blocks": [

{

"type": "video"

}

]

}

]

}

{% endschema %}

Hi @edwinsiu ,

Please send your site and if your site is password protected, please send me the password. I will check it.

Hi @edwinsiu ,

Go to Assets > base.css and paste this at the bottom of the file:

@media screen and (max-width: 767px) {
	.videoBackground .videoBox {
		padding: 100px 20px 80px !important;
	}
	.videoBackground .fullscreen-video-wrap {
		position: absolute !important;
		z-index: 1 !important;
	}
	.videoBackground .videoBoxInfo {
		padding: 10px !important;
	}
}
1 Like

Brilliant! Thank you LitExtension

1 Like

You saved me thousands of hours of nsearching, thank you very much!