Hi there. I’m trying to let users display a list of videos in a single repeating group. The problem is that the videos are technically 3 different data types, (YouTube API, Vimeo API, & direct upload to Bubble).
The goal is for whenever a user uploads one video to any one of these three websites, that their playlist on Bubble would be updated too. This way, they don’t have to manually upload the same video to three different websites.
Is it too late to make them one data type? It might make your life easier now and down the road. Within that data type you could add a column that holds the type of video it is (youtube, vimeo, etc.)
If that doesn’t fit, maybe a playlist data type with fields pointing back to your three existing data types.
It’s not too late, but if I took that approach would someone still have to create the individual record manually? I suppose I could schedule a workflow, but it wouldn’t be as instant.
Orrrr, maybe you’re saying I could add, for example, a “YouTube” field to a record and make the field a list? That might work. My only qualm with that is not being able to associate Bubble app data with specific videos, e.g. analytics for a single video.
Getting a solid data structure in place early on will save you hours of work later. Any time I am struggling with making something work, it usually points back to a problem in the data design. I’ll bet one of the great Bubble coaches on the forum will chime in with some thoughts or videos on how to get that right.
@willtaylordesign - from an application support standpoint, it’s always better to not duplicate things So, as @mebeingken mentions, if you can go with either Youtube/Vimeo or Bubble-Ziggeo, then best to just stick with one.
For a use case like yours (where you have a repeating group and want to display a list of videos from Youtube or Vimeo), my recommendation would be to create a new table called “Video_Record”. Each time a user adds a new video, you create a new “Video_Record”
On that table, I would have the fields for:
video_id (text) - ex. dQw4w9WgXcQ
source (text) - ex. youtube
Then, within your repeating group, you would create the video element twice, with each hidden by default: one with the source set to Youtube, one to Vimeo. Then, apply a bit of conditional logic so that when the source = youtube, then the Youtube video play is visible. And vice versa for Vimeo.
From a user experience standpoint, I would recommend going with just one type (my bias is towards Youtube).
By taking the table-based approach (ie. not saving a list of Video IDs to a field on the user), you can also use this for capturing your own logic about those videos (ex. flag the video as “my_favorites” using a boolean (yes / no) flag.
Question… When you say,
"Each time a user adds a new video, you create a new “Video_Record”
it sounds like we’re still talking about a manual input for the user… What I’d like to be able to do is, when a user uploads a video to their account on YouTube.com, the corresponding API in Bubble would display that video in a repeating group. That way, the user would not have to manually update multiple sites, but just that one, (in this case being YouTube).
The only ways I can think to do something like this involve either creating data entries via a scheduled workflow (which isn’t instant and therefore unideal), or not storing it locally at all and just calling the data via API each time the page is loaded by setting a repeating group’s type to “get data from API” > etc. But, of course, I can’t set its type to be both a YouTube API and a Vimeo API.
Currently I have it set where users create the entries manually in a single data table. I’m also using a video.js player plugin to (hopefully) keep load time down by having only one player on the page. I did need to distinguish the links for something else though and used conditional logic on the input side of things by hiding a boolean input set to = “yes” when the text input contained “youtube.”
If you have your users authenticate with Youtube (ie. fairly easy to set this up using one of the existing plugins), you can set up your repeating group to be an API call to Youtube that retrieves the user’s uploaded videos. Then, you set that as the source for the videos.
In that case, you’re just pulling things in real time. Then if you want to “add” those to special collections in Bubble, you could create your own database records, referencing the video’s ID.
Example of how to set it up below. (Note you still need to set up the plugin and user authentication steps. Just illustrating the concept).
Within the repeating group, add a button (let’s call it “Favorite”)
When Button Favorite is clicked, it launches a workflow, where the first action is a “Create a new thing” action that creates a new Video_Record.
If you want to get a bit fancy, you could employ a bit of conditional logic to have the button perform different functions (ex. remove from favorites when the current cell’s ID matches with an ID in their “Favorites”