While working with the createVideoAsync and fetch we have notice recently the both functions have become slower to the point Figma crashes (the file) because it ran out of memory trying to load the video though the plugin and it started to happen in the last couple of months.
Video Files that are less than 50 mb mostly work but are taking longer than normal to fetch load. Loading images works fine. And loading the same videos manually by dragging them into Figma works fine too.
The code we use to load that is base on the documentation
const component = figma.createComponent()
const response = await fetch(url);
const buffer = await response.arrayBuffer();
return figma
.createVideoAsync(videoData)
.then(async (video: Video) => {
component.fills = [
{ type: 'VIDEO', videoHash: video.hash, scaleMode: 'FILL' },
];
})
.catch((error) => {
console.warn(error);
});