CMS Development

Firelight
Member

JS Control of Hubspot Video

SOLVE

Is there any known way to play/pause a Hubspot Video Widget with Javascript? I've tried all sorts of things with the hsVideoApi object and can't make any progress.

 

Thank you!

0 Upvotes
1 Accepted solution
Anton
Solution
Thought Leader | Partner
Thought Leader | Partner

JS Control of Hubspot Video

SOLVE

Hi @Firelight

personally I'd use something like plyr.io and develop a more flexible video module.


If you'd like to stick to the default video module - it's gonna be not easy since the video is an iframe. This means you'd need to access the iframe elements from outside the iframe - which is doable but not that easy and can lead to quite a lot debugging 🙂 

 

 

hope this helps, 

 

best, 

Anton

Anton Bujanowski Signature

View solution in original post

0 Upvotes
6 Replies 6
Anton
Thought Leader | Partner
Thought Leader | Partner

JS Control of Hubspot Video

SOLVE

Hi @Firelight

since you've mentioned that you're using Fancybox... - have you looked into their docs?

Also - could you provide a preview link? Would be extremly benefitial

 

 

best, 

Anton

Anton Bujanowski Signature
0 Upvotes
Firelight
Member

JS Control of Hubspot Video

SOLVE

@Anton , here is the preview link: https://www.bdsdesignbuildremodel.com/project-gallery-preview-with-video/home-theater-remodel-winnet...

 

I've figured out how to use Fancybox's events where I can put in code to play/pause but I don't know what JS to use to play or pause the embedded Hubspot video. That's the part I can't figure out.

0 Upvotes
GiantFocal
Top Contributor | Partner
Top Contributor | Partner

JS Control of Hubspot Video

SOLVE

Hi @Firelight

 

Is the video displayed inline or inside a popup?


Best regards,

Abraham Ernesto

Best regards,
Ernesto @ GiantFocal
Found this answer helpful?
Marking it as the solution helps both the community and me - thanks in advance!
0 Upvotes
Firelight
Member

JS Control of Hubspot Video

SOLVE

It's inside of a Fancybox popup.

0 Upvotes
Anton
Solution
Thought Leader | Partner
Thought Leader | Partner

JS Control of Hubspot Video

SOLVE

Hi @Firelight

personally I'd use something like plyr.io and develop a more flexible video module.


If you'd like to stick to the default video module - it's gonna be not easy since the video is an iframe. This means you'd need to access the iframe elements from outside the iframe - which is doable but not that easy and can lead to quite a lot debugging 🙂 

 

 

hope this helps, 

 

best, 

Anton

Anton Bujanowski Signature
0 Upvotes
Firelight
Member

JS Control of Hubspot Video

SOLVE

I'm more than happy to work on the necessary code to interact with the iframe but I just can't find any documentation. Do you know any methods that can play/pause the video?

0 Upvotes