--- title: "Use GFSpotBase functions" slug: "functions" updated: 2026-08-07T10:37:15Z published: 2026-08-07T10:37:15Z canonical: "docs.grassfish.com/functions" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.grassfish.com/llms.txt > Use this file to discover all available pages before exploring further. # Use GFSpotBase functions The GFSpotBase class reserves two variables within the global scope of JavaScript. --- `var GFSpotBase` This is the class itself. All methods are invoked statically via this category. `var grassfishGlobalPlayerToJSCallbackFunction` This is a central method that serves as a call-back for communication with the player. - Only two parameters are transferred to the player: method key and remaining arguments. - Before being transferred to the player, the remaining arguments are joined by means of a separator: **| + _-* |** - Don’t use this separator in the parameter values. > [!NOTE] > Note > > Don’t use or manipulate this method directly. For each supported callback, there is a respective wrapper method to use. --- ## Report that the spot is ready Gives players the signal that the spot is ready to be played. | Parameters | None | | --- | --- | | Examples | `GFSpotBase.sendInitComplete();` | | Players | Windows and Linux Player version 10.0 or later Android Player version 8.1.0.2 or later | Note From GFSpotBase version 2 the spot must independently invoke sendInitComplete when it is ready to be displayed. Otherwise, the player doesn't bring it to the foreground. ## Terminate the spot Closes the current spot. | Parameters | None | | --- | --- | | Examples | `GFSpotBase.quit();` | | Players | Windows Player version 7.7 or later Linux Player version 8.0 or later Android Player version 8.1.0.0 or later | ## Jump to the next spot Jumps to another spot within the current playlist if available. If several spots with the same name are available in the playlist, it jumps to the first spot that follows the current spot. | Parameters | `function(spotName, jumpBack)` **spotName** is the name of the spot. | | --- | --- | | Examples | `GFSpotBase.jumpToSpot("Spot ABC");` `GFSpotBase.jumpToSpot("News", true);` | | Players | Windows Player version 10.0.10 or later Linux Player version 10.1.3 or later Android Player version 10.1.0 or later | ## Jump to a specific spot Jumps to another spot within the current playlist if available. - This method requires the unique spot instance ID to identify the exact spot even if a spot occurs in the playlist more than once. - Use the **jumpBack** to return to the invoking spot after completion of the jumped to spot. - You can get the spot instance IDs from the player using **getAllSpots**. | Parameters | `function(siId, jumpBack)` **siId** is the unique spot instance ID of the spot. **jumpBack** specifies whether one would like to return to the invoker spot after playing the target spot. | | --- | --- | | Examples | `GFSpotBase.jumpToSpotBySiId("3242", true);` | | Players | Android Player version 8.1.0.0 or later | ## Trigger an event playlist Starts an event playlist on the player. | Parameters | `function(eventType, value)` **value** is the Event ID of the playlist **eventType** can have the following values: - **Start**: Starts an event playlist that is played once. - **StartLoop**: Starts an event playlist that continues to play in a loop. - **StopLoop**: Terminates a loop event playlist. | | --- | --- | | Examples | `GFSpotBase.sendEventCommand("Start","EventA");` `GFSpotBase.sendEventCommand("StartLoop","EventB");` | | Players | Windows Player version 7.7 or later | ## Activate preloading For a seamless transition between spots, the loading process must be complete before the spot is displayed on the player. This ensures the next spot plays seamlessly after the previous one—provided the playlist in IXM One is configured accordingly. - The spot transmits this information to the server during upload via a variable in the `settings.xml` file. To implement this functionality, create the file in the ZIP archive. - If you enable preloading, ensure that the animations start as soon as the player issues the command using `receivePlayCommand(value);` . Animations must only be started using this method or they will start too early. - The player informs the HTML application whether it supports preloading via the URL parameter `usePreload=true`. If this parameter is not set, the animations must start immediately after the website is accessed. Use the `init()` method after the `<body onload='init()'>`: ```javascript function init() { resetAnimations(); //your own implementation to reset all animations GFSpotBase.receivePlayCommand = function(value) { log("Got Play command: " + value); if(value == "Play") startAnimations(); //your own implementation to start all animations }; try { //use this to check if preloading is supported on the player if(GFSpotBase.getHasPreload()) { log("Preloading enabled, waiting for PlaySpot command..."); } else { log("Preloading disabled, starting animations now..."); startAnimations(); } } catch (error) { if(error) log("Url parsing error " + error.message); } } ``` | Function | Is invoked by the player, if preloading has been activated in the spot and the player brings the spot to the foreground. | | --- | --- | | Parameters | `function(value)` **value** can include the following values: - **Play**: Is executed, if the player brings the spot to the foreground. - **Stop**: Is currently not used. | | Players | Windows Player version 7.7 or later Android Player version 8.1.0.0 or later | ## Notify the player of errors Notifies the player about an error without terminating execution. | Parameters | `function(notifyError, errorMessage)` **errorType** specifies the type of error as a string. **errorMessage** describes the error as a string. | | --- | --- | | Example | `notifyError('MediaLoadError',  'Failed to load media asset from the provided URL.');` | | Players | Android Player version 12.0.3 or later |