Ok, try this. Change the queryArrayTest() to async and then remove the anonymous function around the loop to get the urls. So it looks like this:
‘use strict’;
import wixData from ‘wix-data’;
import { mediaManager } from ‘wix-media-backend’;
export async function queryArrayTest() {
var videoArray = []
wixData.query(“AllGuestUploads-Video”)
.eq(“eventId”, “bbfd431b-f957-40bc-89e9-d05c19e6edc2”)
.eq(“includeInHighlight”, true)
.ascending(“chapterNumber”, “orderInCategory”)
.find()
.then((results) => {
let fullUploadData = results.items
console.log("fullUploadData", fullUploadData)
// Create new array for the videoField //
videoArray = fullUploadData.map(({ videoField }) => videoField)
console.log("videoArray", videoArray),
// GET DOWNLOAD URLS OF VIDEOS //
let urlVideoArray = [];
for (const fileName of videoArray) {
let video = await mediaManager.getDownloadUrl(fileName);
urlVideoArray.push(video)
}
console.log("urlVideoArray", urlVideoArray)
});
}