Skip to content

Repository files navigation

npmGitHub versionlicense

Gamedistribution.com HTML5 SDK

This is the documentation of the "GameDistribution.com HTML5 SDK" project.

Gamedistribution.com is the biggest broker of high quality, cross-platform games. We connect the best game developers to the biggest publishers.

Running into any issues? Check out the F.A.Q. within the Wiki of the github repository before mailing to here

Implementation within games

The SDK should be integrated within HTML5 games by loading it through our CDN. Specific information of the SDK features and usages can be found at the wiki.

Implementation self-hosted games.

In the case where a developer wants to self-host their game; the SDK should be implemented within the game as aforementioned. The only difference is that they will have to upload a zipped index.html-file containing an iframe with the following query variable: GD_SDK_REFERRER_URL. The value of this variable should be the parentUrl. A perfect example can be found at ./index_iframe.html.

Debugging

Games, which include the SDK, can be easily debugged by calling the following from a browser developer console:

gdsdk.openConsole();

The gdsdk namespace is set when creating the SDK instance. We can't change the name of this namespace as it is still used within games using the old SDK implementation.

Repository

The SDK is maintained on a public github repository. https://github.com/gamedistribution/GD-HTML5

Deployment

Deployment of the SDK to production environments is done through TeamCity.

Installation for development

Install the following programs:

Pull in the rest of the requirements using npm:

npm install

Setup a local node server, watch changes and update your browser view automatically:

grunt

Make a production build:

grunt build

Make a production build of the promotion script. This script is loaded through advertisement slots to support for cross promotions:

grunt promo

Events

SDK EVENTS

The SDK events should be used by developers to start or pause their game or handling critical errors. Unless the errors are ad related, then they could hook into the AD_ERROR event, however; the SDK should gracefully fail, so this should not be needed.

EventDescription
SDK_READYWhen the SDK is ready.
SDK_ERRORWhen the SDK has hit a critical error.
SDK_GAME_STARTWhen the game should start.
SDK_GAME_PAUSEWhen the game should pause.
SDK_GDPR_TRACKINGWhen the publishers' client has requested to not track his/ her data. Hook into this event to find out if you can record client tracking data.
SDK_GDPR_TARGETINGWhen the publishers' client has requested to not get personalised advertisements. Hook into this event to find out if you can display personalised advertisements in case you use another ad solution.
SDK_GDPR_THIRD_PARTYWhen the publishers' client has requested to not load third party services. Hook into this event to find out if you can third party services like Facebook, AddThis, and such alike.

IMA SDK EVENTS

The SDK events are custom ads for handling any thing related to the IMA SDK itself.

EventDescription
AD_SDK_MANAGER_READYWhen the adsManager instance is ready with ads.
AD_SDK_CANCELEDWhen the ad is cancelled or stopped because its done running an ad.

AD EVENTS

The Gamedistribution.com SDK uses the IMA SDK for loading ads. All events of this SDK are also available to the developer. https://developers.google.com/interactive-media-ads/docs/sdks/html5/

EventDescription
AD_ERRORWhen the ad it self has an error.
AD_BREAK_READYFired when an ad rule or a VMAP ad break would have played if autoPlayAdBreaks is false.
AD_METADATAFired when an ads list is loaded.
ALL_ADS_COMPLETEDFired when the ads manager is done playing all the ads.
CLICKFired when the ad is clicked.
COMPLETEFired when the ad completes playing.
CONTENT_PAUSE_REQUESTEDFired when content should be paused. This usually happens right before an ad is about to cover the content.
CONTENT_RESUME_REQUESTEDFired when content should be resumed. This usually happens when an ad finishes or collapses.
DURATION_CHANGEFired when the ad's duration changes.
FIRST_QUARTILEFired when the ad playhead crosses first quartile.
IMPRESSIONFired when the impression URL has been pinged.
INTERACTIONFired when an ad triggers the interaction callback. Ad interactions contain an interaction ID string in the ad data.
LINEAR_CHANGEDFired when the displayed ad changes from linear to nonlinear, or vice versa.
LOADEDFired when ad data is available.
LOGFired when a non-fatal error is encountered. The user need not take any action since the SDK will continue with the same or next ad playback depending on the error situation.
MIDPOINTFired when the ad playhead crosses midpoint.
PAUSEDFired when the ad is paused.
RESUMEDFired when the ad is resumed.
SKIPPABLE_STATE_CHANGEDFired when the displayed ads skippable state is changed.
SKIPPEDFired when the ad is skipped by the user.
STARTEDFired when the ad starts playing.
THIRD_QUARTILEFired when the ad playhead crosses third quartile.
USER_CLOSEFired when the ad is closed by the user.
VOLUME_CHANGEDFired when the ad volume has changed.
VOLUME_MUTEDFired when the ad volume has been muted.

About

The repository containing the GameDistribution SDK for HTML5 games. This allows you to display advertisements and other solutions available to games published within the GameDistribution network.

Topics

Resources

Stars

34 stars

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages