How to add a YouTube video to your Bubble.io app using dynamic data
In this Bubble.io tutorial video we demonstrate how to add a YouTube video to your Bubble.io by storing the video ID in your database and filling in the Video element source with dynamic data.
Unlock dynamic video power: Learn to add YouTube videos with dynamic data in Bubble!
Master marketplace app design: Create stunning hero sections and embed videos like a pro.
Elevate your Bubble skills: Transform your app with custom repeating group designs and dynamic video integration.
Adding a YouTube Video to Your Bubble.io App Using Dynamic Data
Here's a really quick guide for how to add a video using dynamic data to your Bubble app. So I have my marketplace app here that I'm building. I've got a slideshow. Check out our earlier videos to see how that works. And I'm going to add a big video down here to demonstrate my product.
Setting Up the Page Layout
Let me just have a look at my page layout. Pop open the reveal in elements tree. Okay, so I've got a hero section that's got columns right. So let's add in a group down here. And let's make the group into a column and set its max width to the same value that I've set my hero section to 1240. Okay, and then I add in a video element. And I'm going to make my video element 100%. Yeah, 55 that looks very good.
Configuring Dynamic Video Content
Okay, so how do I tell Bubble what video I want to show and how do I make it dynamic? So Bubble asks for a video ID. Now with YouTube, I believe that is this portion here. So I need to go into my database into my product, whatever data type you're using, create a new field called this video ID. And it's going to be text because it's storing text. Great. And then if I go into my app data, find my product video ID field is now that going to copy and paste.
Connecting the Video to the Page
Okay. And now I can add this as current page because my current page is my product. And then video ID. And to preview this, I'm going to have to preview my index page and click on my this just a repeating group for my products. You will have seen I've just got one product. So this links through to my sneakers. And okay, there we go.
Styling the Video Element
Not looking so good. Let's just style that a bit. Let's work through. So my group, I need to align that centered. Let's check that that's done it as the group is acting as a bit of a container. There we go. And then 55 fix. Let's just try that. So there is a little bit of a tricky thing going here because YouTube is basically acts as an iframe like an embed code is what Bubble was generating here.
Adjusting Video Dimensions
So I do actually think I've to give that a fixed value. So I'm going to kind of eyeball it, give it like a 750 value. But if you really want to work out, you would, you need to calculate using aspect ratios. Okay, there we go. That's almost perfectly done apart from I've got a slight black bar at the top.
Conclusion
So there have it that is in less than four minutes, how to add a video to a page using a YouTube video using dynamic data. Okay.
Get the Complete Bundle for Just $99
Access 3 courses, 390+ tutorials, and a vibrant community to support every step of your app-building journey.
Start building with total confidence
No more delays. With 30+ hours of expert content, you’ll have the insights needed to build effectively.
Find every solution in one place
No more searching across platforms for tutorials. Our bundle has everything you need, with 390+ videos covering every feature and technique.
Dive deep into every detail
Get beyond the basics with comprehensive, in-depth courses & no code tutorials that empower you to create a feature-rich, professional app.
Save over 70%!
Valued at $80
Valued at $85
Valued at $30
Valued at $110
Valued at $45
Can't find what you're looking for?
Search our 300+ Bubble tutorial videos. Start learning no code today!
Have questions?
We have answers!
Find answers to common questions about our membership plans, programs, and more.
We're here to help you launch your no code SaaS. Reach out to the team and we'll double check our vast library for useful content. We'll advise you on how we'd tackle the same problem and there's a good chance we'll record the video to help the wider community.
As a Planet No Code member, you'll receive a discount on our Bubble coaching sessions. Monthly members receive a 10% discount, while Annual members receive a 17.5% discount. To redeem your discount, simply log into your account and book a coaching session through our platform.
Our 8-week intensive mentorship program is designed to provide personalized guidance and support to help you accelerate your startup journey. You'll be matched with a startup expert who will work with you one-on-one to set goals, overcome challenges, and make rapid progress.
To apply for the Mastery Program, simply click the "Request Invitation" button on our pricing page and fill out the application form. Our team will review your application and schedule a call with you to discuss your goals and determine if the program is a good fit for your needs.
We accept all major credit cards, including Visa, Mastercard, American Express, and Discover.
While we don't offer a free trial, we do provide a 14-day money-back guarantee. If you're not completely satisfied with your membership within the first 14 days, simply contact our support team, and we'll issue a full refund.