Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Is there a built-in feature to automatically load and start the emulator from a preset file URL? #28

Open
nnillat opened this issue May 19, 2023 · 2 comments

Comments

@nnillat
Copy link

nnillat commented May 19, 2023

Instead of having to upload a game, I'd like to make it automatically load and start playing the game from a preset file URL.

I know you can add roms to romlist.js, but that's not exactly what I need. I want it to load the game URL automatically into the emulator and never have the option to choose a game (whether that's via upload or romlist.js).

I'm wondering if this is a built-in feature, and if it isn't, how could I modify it to work like this? I'm worried about changing anything because there's so much that it'll probably break something.

Thanks in advance!

@nbarkhina
Copy link
Owner

It's not a built in feature but you can modify it pretty easily to get that. There's a function in script.js called initModule() where you can add the call to load the rom automatically -

    async initModule(){
        console.log('module initialized');
        myClass.rivetsData.moduleInitializing = false;
        myClass.load_url('url_to_your_rom');
    }

Keep in mind one issue you will run into is that there won't be any audio because browsers only allow sound to play after the user interacts with the page. That's the reason most pages require you to click a button or some other element before it starts playing sound.

@nnillat
Copy link
Author

nnillat commented May 19, 2023

That worked. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants