Code Monkey home page Code Monkey logo

Comments (20)

ethanaobrien avatar ethanaobrien commented on May 12, 2024

Hello, on line 14653 is the code for the adUrl embedding. You might be able to put it in there.
search for the code if (typeof _0xc6823.adUrl === 'string') {

To make it to where the user can only click it after the video ends, you can probably edit the setTimeout feature or edit the setTimeout to show the x button. search for adUrl

from emulatorjs.

xxxnewbiexxx avatar xxxnewbiexxx commented on May 12, 2024

Hi @ethanaobrien , thanks for your reply. I will make a few tests and let you know ;-)

from emulatorjs.

xxxnewbiexxx avatar xxxnewbiexxx commented on May 12, 2024

Hello, on line 14653 is the code for the adUrl embedding. You might be able to put it in there. search for the code if (typeof _0xc6823.adUrl === 'string') {

To make it to where the user can only click it after the video ends, you can probably edit the setTimeout feature or edit the setTimeout to show the x button. search for adUrl

Hi @ethanaobrien , I tried to implement the Ad URL straight into the emulator.js like below:

Line 14653:

if (typeof _0xc6823.adUrl === 'https://mysite.com/ad.html') {

and

Line 14656:

'src': https://mysite.com/ad.html,

But it didn't work :-(

It only works if I add this line:

EJS_AdUrl = 'https://mysite.com/ad.html'

Like the code below:

<script type="text/javascript">
    EJS_player = '#game';
    EJS_gameUrl = 'files/snes/Donkey-Kong-Country.zip'; // Url to Game rom
    EJS_core = 'snes';
    EJS_mouse = false; // SNES Mouse
    EJS_multitap = false; // SNES Multitap
    EJS_pathtodata = 'data/'; //path to all of the wasm and js files. MUST all be in the same directory!!
    //EJS_AdUrl = 'https://mysite.com/ad.html' //path to AD page
</script>
<script src="data/loader.js"></script>

Is it possible to add the Ad URL straight into the emulator.js file?

Thank you!

from emulatorjs.

ethanaobrien avatar ethanaobrien commented on May 12, 2024

if (typeof _0xc6823.adUrl === 'https://mysite.com/ad.html') { is not proper javascript (unless you have a type named https://mysite.com/ad.html) it must be kept as if (typeof _0xc6823.adUrl === 'string') {

To specify it in the emulator.js file, search for the code //_0x2ba0e6.adUrl = 'https://www.youtube.com/embed/8vkh9UO3PnA', remove the // from the beginning and change the youtube link to the link of your ad page

from emulatorjs.

xxxnewbiexxx avatar xxxnewbiexxx commented on May 12, 2024

Thanks for your quick reply @ethanaobrien !

It's not working for me as you can see in the test page below :-(

Test page - https://coolstuffblast.com/games/test.html

Emulator.js file was modified as per your instructions above.

from emulatorjs.

ethanaobrien avatar ethanaobrien commented on May 12, 2024

Screenshot 2021-12-08 8 51 16 PM
Seems to work fine, just takes a sec to load (as ads always do)

from emulatorjs.

xxxnewbiexxx avatar xxxnewbiexxx commented on May 12, 2024

Hi @ethanaobrien , that's really strange ... I have cleared my Google Chrome cache, Cloudflare cache, I even tried anonymous browser and it was not working lol ... I had to flush my DNS via CMD to see it was working :-)

Thank you for your help!

The banner ads was an easy implementation via emulator.js , just trying to figure it out how to implement the video pre-roll now.

Is there any easy way to call an ad url from emulator.js to load before the emulator loads using the whole game frame 640x480 pixels?

Thanks in advance for all your help and support!

from emulatorjs.

ethanaobrien avatar ethanaobrien commented on May 12, 2024

No, this isn't possible in javascript to check if the ad is loaded. Sorry

from emulatorjs.

xxxnewbiexxx avatar xxxnewbiexxx commented on May 12, 2024

Hi @ethanaobrien , thanks for your reply.

It doesn´t need to check if the ad is loaded, just need to call and load the ad url in the whole game iframe as soon as it loads the emulator. The video pre-roll script will have the close button and the time set up to work it by itself.

The result would be similar to this one - https://neptunjs.xyz/snes.html

But it would load the video pre-roll ad before ;-)

from emulatorjs.

ethanaobrien avatar ethanaobrien commented on May 12, 2024

Sorry for the late reply, got busy then I just kept forgetting to respond.

It doesn´t need to check if the ad is loaded, just need to call and load the ad url in the whole game iframe as soon as it loads the emulator. The video pre-roll script will have the close button and the time set up to work it by itself.

This is what it does, the moment the emulator loads the iframe is created and starts loading

from emulatorjs.

xxxnewbiexxx avatar xxxnewbiexxx commented on May 12, 2024

Hi @ethanaobrien , thanks for your reply.

In the new emulator, I couldn't find the code: //_0x2ba0e6.adUrl = 'https://www.youtube.com/embed/8vkh9UO3PnA' in the emulator.js file.

How to implement the Ad URL inside the new emulator.js file?

Thanks in advance for all your help and support!

from emulatorjs.

ethanaobrien avatar ethanaobrien commented on May 12, 2024

Bottom of the emu-main.js file. Search for this.adUrl =

from emulatorjs.

ethanaobrien avatar ethanaobrien commented on May 12, 2024

@xxxnewbiexxx Did you ever get this working? Can I close this or?

from emulatorjs.

xxxnewbiexxx avatar xxxnewbiexxx commented on May 12, 2024

Hi @ethanaobrien, just the banner is working at the moment, still working on the video pre-roll implementation ...

from emulatorjs.

ethanaobrien avatar ethanaobrien commented on May 12, 2024

Im going to assume you've got this under control

I'm closing since this isn't technically an issue, but a question

from emulatorjs.

xxxnewbiexxx avatar xxxnewbiexxx commented on May 12, 2024

Hi @ethanaobrien , have you done any change to the code that skip modifications on emu-main.js ?

I tried to implement the ad URL inside emu-main. js file changing this line:

this.adUrl = null;

to this:

this.adUrl = 'https://mysite.com/adurl.html';

but it's not working :-(

Thanks in advance for all your help and support!

from emulatorjs.

ethanaobrien avatar ethanaobrien commented on May 12, 2024

from emulatorjs.

xxxnewbiexxx avatar xxxnewbiexxx commented on May 12, 2024

Thanks for your reply @ethanaobrien ! How can I define it in the loader.js file?

I tried this:

'undefined' != typeof EJS_AdUrl && (config.adUrl = 'https://mysite.com/adurl.html');

but it didn't work ...

from emulatorjs.

ethanaobrien avatar ethanaobrien commented on May 12, 2024

from emulatorjs.

xxxnewbiexxx avatar xxxnewbiexxx commented on May 12, 2024

Set the config ad url to your site instead of the window variable

How to set this @ethanaobrien ? Could you please help ?

from emulatorjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.