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
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 |
|
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 |
|
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 |
spotName is the name of the spot. |
Examples |
|
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 |
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 |
|
Players | Android Player version 8.1.0.0 or later |
Trigger an event playlist
Starts an event playlist on the player.
Parameters |
value is the Event ID of the playlist eventType can have the following values:
|
Examples |
|
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.xmlfile. 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()'>:
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 |
value can include the following values:
|
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 |
errorType specifies the type of error as a string. errorMessage describes the error as a string. |
Example |
|
Players | Android Player version 12.0.3 or later |