Most appropriate sub-area of p5.js?
p5.js version
v2.3.1
Web browser and version
firefox 154.0
Operating system
Linux Fedora release 44
Steps to reproduce this
Steps:
- Create a
File representing a video or audio file.
- Pass the file to
p5.File._load(), which creates an object URL and exposes it through file.data.
- Pass
file.data to createImg(), then call img.remove(). Observe that URL.revokeObjectURL() is never called for the object URL created by _load().
Snippet:
test('does not revoke the object URL when the created image is removed', async () => {
const blob = new Blob(['fake video'], { type: 'video/mp4' });
const inputFile = new window.File([blob], 'test.mp4', {
type: 'video/mp4'
});
const objectURL = 'blob:test-url';
vi.spyOn(URL, 'createObjectURL').mockReturnValue(objectURL);
const revokeObjectURL = vi.spyOn(URL, 'revokeObjectURL');
let file;
File._load(inputFile, loadedFile => {
file = loadedFile;
});
const img = mockP5Prototype.createImg(file.data, '');
img.remove();
expect(revokeObjectURL).not.toHaveBeenCalled();
});
Most appropriate sub-area of p5.js?
p5.js version
v2.3.1
Web browser and version
firefox 154.0
Operating system
Linux Fedora release 44
Steps to reproduce this
Steps:
Filerepresenting a video or audio file.p5.File._load(), which creates an object URL and exposes it throughfile.data.file.datatocreateImg(), then callimg.remove(). Observe thatURL.revokeObjectURL()is never called for the object URL created by_load().Snippet: