Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A lightweight SDK that allows for easy integration of eko videos into webpages.
A lightweight SDK that allows for easy integration of eko videos into webpages
Initialize an instance of the EkoPlayer
to play an eko video.
Will return true if playing eko projects is supported in your current web browser.
Example
if (!EkoPlayer.isSupported()) {
alert('Eko is not supported on current environment');
}
Retrieves delivery information about the project. See our project schema documentation for more information about what is delivered.
Param | Type | Description |
---|---|---|
projectId | String | The id of the project to retrieve information for. |
Example
EkoPlayer.getProjectInfo('AWLLK1')
.then(projectInfo => {
const { title, description, thumbnail } = projectInfo;
console.log(`Got project info: ${title} - ${description}`);
})
.catch(e => console.error('Failed to fetch project info:', e));
Creates an instance of an EkoPlayer.
Param | Type | Description |
---|---|---|
el | Element, String | The container element to be used by the player, or a DOM selector string for the container element. |
Will load and display an eko project. The EkoPlayerView will display the loading animation while it prepares the project for playback. Returns a promise that will fail if the project id is invalid.
Param | Type | Description |
---|---|---|
projectId | String | The id of a project to load and display. |
options | Object | Options for project delivery. |
options.params | Object | A dictionary of embed params that will affect the delivery. Default includes {autoplay: true} . |
options.events | String[] | A list of events that should be forwarded. |
options.cover | Element, string, function | An element or the query selector string for a loading cover. When loading happens a “eko-player-loading” class will be added to the element. When loading finishes, the “eko-player-loading” class will be removed. If a function is passed, it will be invoked with a single string argument (state) whenever the state changes. The possible state values are "loading" (cover should be shown) and "loaded" (cover should be hidden). If no cover is provided, the default eko loading cover will be shown. |
options.frameTitle | String | The title for the iframe. |
options.pageParams | String[] | Any query params from the page url that should be forwarded to the iframe. Can supply regex and strings. By default, the following query params will automatically be forwarded: autoplay, debug, utm_*, headnodeid. |
Example
let ekoPlayer = new EkoPlayer('#myContainer');
ekoPlayer.load('AWLLK1', {
params: {
autoplay: false,
clearcheckpoints: true,
debug: true
},
events: ['nodestart', 'nodeend', 'playing', 'pause'],
cover: '#myCoverId',
frameTitle: 'My Eko Player',
pageParams: ['myCustomQueryParam']
});
Will play/resume eko video project.
Will pause eko video project.
Will call any player function defined on the eko developer site. Can also be used to set properties.
Param | Type | Description |
---|---|---|
method | String | The player method to call. |
args | Any | Any arguments that should be passed into the method (must be serializable to json) |
Example
ekoPlayer.invoke('play'); // Plays the eko project
ekoPlayer.invoke('audio.play', 'ping'); // Plays the "ping" sound effect via the audio plugin
ekoPlayer.invoke('seek', 'myNodeId', 10); // Seeks 10s into myNodeId
The args array is serialized using the structured clone algorithm. This means that functions cannot be sent as args.
The eko player triggers a number of events. The app can listen to these events by providing the event name in the load call. The callbackFn will be invoked with the arguments passed by the triggered event.
Triggered when the player has buffered enough media to begin playback.
Triggered when playback has begun.
If you wish to handle opening urls or social sharing yourself, simply add the following events
to the options in the load call:
urls.intent
share.intent
Example
let ekoPlayer = new EkoPlayer('#myContainer');
// Handle opening URLs in parent frame
ekoPlayer.on('urls.intent', ({ url }) => {
window.open(url, '_blank');
});
// Must pass the 'urls.intent' event at load() time
// in order to be able to listen to this event
ekoPlayer.load('AWLLK1', {
events: ['urls.intent']
});
FAQs
A lightweight SDK that allows for easy integration of eko videos into webpages.
The npm package eko-js-sdk receives a total of 0 weekly downloads. As such, eko-js-sdk popularity was classified as not popular.
We found that eko-js-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.