Hi Team,
I would like to create Video Library and i tried all possible ways to connect database collation having video url section to grid/pro gallery but its not tacking any attribute for image source while connection to database.
I want to display those video’s added by users as a url in grid gallery.
My site is https://amrutabhavar854.wixsite.com/videolibrary
Please check and give me the solution
Hello Amru,
I would suggest using a normal wix gallery instead of the Pro Wix Gallery Application as it is easier to manipulate and customize in this case.
1 - Connect the gallery to the collection
2 - When the dataset that is connecting the gallery and collection is ready(.onReady()), then you should preform the adding of the video that the user input
3 - There is two ways to do this: You can either push the user-added video to the gallery with this kind of code:
let myVideo = {
"src":"wix:image://v1/68d3a9_1de7529c444b4c9eb38401f8efe0cad2.jpg/flowers.jpg/#originWidth=1970&originHeight=1120",
"description": "Description",
"title": "Title" };
let items = $w("#myGallery").items; items.push( myVideo );
$w("#myGallery").items = items;
Or you can add the video URL to the collection and refresh the dataset so that the gallery gets the new data that was added. How to insert into collection using code here: https://www.wix.com/code/reference/wix-data.html#insert
More Reading here: https://www.wix.com/code/reference/$w.Gallery.html#items
Try this out and let me know if you run into any problems.
Best, Majd
Is it possible to add a video link from an external source (e.g. Vimeo) to a gallery? It seems like it is not working for a dataset since you have to upload the video files first, but under Manage Content (Galleries) you can add a link for an external video source. Is it not possible to have external image and video sources in a dataset and connect it to a gallery?