Skip to content

Expose loadBundle and loadBundleFromFile in player-api-load.ts to the public API #365

@ruochenjia

Description

@ruochenjia

Currently the only way to load a bundle from a ArrayBuffer object is through the use of blob URL. However this can cause memory leaks especially for large game files. Blob URLs created by URL.createObjectURL are duplicated from the original ArrayBuffer and stored in memory until URL.revokeObjectURL is invoked.

The workaround I used at this moment:

const url = URL.createObjectURL(new Blob([arrayBuffer], { type: "application/octet-stream", endings: "native" }));

Dos(frame, {
	onEvent: (e) => {
		if (e === "emu-ready")
			URL.revokeObjectURL(url);
	},
	url: url,
	theme: "light",
	...
});

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions