The static API can be used to create and connect instances of the add-on with the video player.
It is available from the tv.smartclip.smartclientcore
package.
Sets up a new add-on instance for the given video player.
Publish last activity.
Especially on Android TV, the app should signal to the SDK when a user interacts with app via manual input. This can be done like so:
SmartClientCore.updateLastActivity();
Configures the smartClientCore instance with the given configuration, as specified in Global Configuration. Returns AdSlotAPI or throws PluginError:
Code | Description |
---|---|
60 | Invalid Setup - The specified pluginSetup does not match with the GlobalConfig definition. |
61 | Player API not available - The PlayerFacade has not been connected before starting the setup process. |
62 | Ad Reinsertion Penalty - AdReinsertion initialization failed, either due to a invalid configuration or issues that must be answered by the AdReinsertion vendor. |
63 | Ad Reinsertion Initialization Timeout - AdReinsertion initialization took too long, either caused by the timeout limitation or issues that must be answered by the AdReinsertion vendor. |
val videoViewFacade = VideoViewFacade(videoPlayer)
val globalConfig = GlobalConfig()
coreInstanceInterface = SmartClientCore.connect(videoViewFacade)?.apply {
try {
adSlotAPI = setup(globalConfig)
} catch (failure: SetupException) {
when (failure.code) {
60 -> Log.i("[publisherModule]", "config not valid")
61 -> Log.i("[publisherModule]", "Player API not available. Did you call `smartclientcore.connect(withYourPlayerFacade)` before?'")
else -> Log.i("[publisherModule]", "Unknown setup error. ${failure.message}")
}
}
}
Sample code :: How to catch setup errors.
Requests details about the most recent error that has occurred.
Returns the version number for the supported Facade interface.
Declaration of ad types as ENUMs that can be used with requesting an ad slot.
Declaration of events as ENUMs that occur during playback of a single ad or mutliple ads delivery. See smartClientCore - Ad Events for more details.
List of event names as defined in the EVENT enum.