A lightweight SDK that allows for easy integration of eko projects into an Android app
Add the Gradle dependency to your application's build.gradle file
implementation 'com.eko:android-native-sdk:0.0.+'
This is the view in which the eko player will reside. It will also forward any events from the player to the rest of the app.
Clears all the all EkoPlayer's Webview data, including: cache, cookies and javasctript storage. NOTE: Since Webview data in Android is shared at the app level, calling this method will clear the data for all of the app's Webviews.
App name is for analytics purposes. Will default to the bundle id if not set.
The EkoPlayerView can be initialized programmatically or included via the layout XML.
Will load and display an eko project. The EkoPlayer will display the loading animation while it prepares the project for playback if cover
is set in the options.
Param | Type | Description |
---|---|---|
projectId | String |
The id of a project to display |
options | EkoOptions |
Options for project delivery. See EkoOptions for more details. |
Will load and display an eko project. The EkoPlayer will display the loading animation while it prepares the project for playback with default options.
Param | Type | Description |
---|---|---|
projectId | String |
The id of a project to display |
Will attempt to begin playing an eko project.
Will attempt to pause an eko project.
Will call any player function defined on the developer site and return the response via callback function.
Param | Type | Description |
---|---|---|
method | String |
The player method to call. |
args | List<Any>? |
Any arguments that should be passed into the method (must be serializable to json) |
Set a listener that listens to events configured in the options object when load
was called. Also listens to any errors that might happen.
Set a listener to handle share intents. If set to null
, the default Android share screen will be shown.
Set a listener to handle link outs. If set to null
, link outs will automatically open in the browser.
Listener interface for receiving events and errors from an eko project.
The eko player triggers a number of events. The app can listen to these events by providing the event name in the load call. This function will be called whenever an event passed in to load()
is triggered.
Param | Type | Description |
---|---|---|
event | String |
The name of the event fired. |
args | JSONArray? |
Any arguments that might have been passed along when the event was fired. |
Called whenever an error occurs. This could happen in the loading process (if an invalid project id was given or we fail to open the link to the project), or if an event is passed in with malformed data (missing an event name, etc).
Param | Type | Description |
---|---|---|
error | Error |
An error with a description of the issue. |
Listener interface for link out events.
There can be link outs from within an eko project. This function will be called whenever a link out is supposed to occur. The listener is responsible for opening the url.
Param | Type | Description |
---|---|---|
url | String |
The url to open. |
Listener interface for share intents.
There can be share intents from within an eko project via share buttons or ekoshell. This function will be called whenever a share intent happened.
Param | Type | Description |
---|---|---|
url | String |
The canonical url of the project. |
A list of embed params that will affect the delivery.
A list of events that should be forwarded to the app
A View to cover the loading of the eko project. Set to null
to disable.
Will be initialized by the EkoPlayer.
Triggered when the player has buffered enough media to begin playback. Only added if showCover=true
and autoplay=false
Only added if showCover=true
and autoplay=true