CMS Development

Uzo101
Participant

Video autopause when visibility is hidden but doesn't automatically resume. Why?

I am trying to embed a hubspot video on a CMS page and I have an issue with the video auto-pausing when the tab changes, and when the video doesn't automatically resume play when I return to the video tab. Is there any walk around to this?

0 Upvotes
2 Replies 2
FrancoQ
Participant

Video autopause when visibility is hidden but doesn't automatically resume. Why?

So hubspot autopauses the video once the user switches the tab.
you can add a custom module to your theme with these,
This is the fields.json you can use

[

{

"name" : "add_video_link",

"label" : "Link",

"required" : false,

"locked" : false,

"supported_types" : [ "FILE" ],

"type" : "link",

"default" : {

"url" : {

"content_id" : null,

"type" : "EXTERNAL",

"href" : ""

},

"open_in_new_tab" : false,

"no_follow" : false

}

}

]


And this html

<div class="video-module">

<video muted loop autoplay>

<source src="{{ module.add_video_link.url.href }}" type="video/mp4">

</video>

</div>
0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Video autopause when visibility is hidden but doesn't automatically resume. Why?

Hey, @Uzo101 👋 Thanks for your question.

 

This pausing behaviour is expected as it is part of how browsers handle resource management. There isn't a setting or switch to override this. If you have a developer or developer resources, you could look at leveraging the visibilitychange event — Document: visibilitychange event

 

I hope this helps get you moving forward! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes