Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/littlstar/lsplayer-iframe-sdk
Littlstar iframe SDK
https://github.com/littlstar/lsplayer-iframe-sdk
Last synced: about 1 month ago
JSON representation
Littlstar iframe SDK
- Host: GitHub
- URL: https://github.com/littlstar/lsplayer-iframe-sdk
- Owner: littlstar
- License: mit
- Created: 2015-07-10T14:14:27.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-19T17:57:33.000Z (over 9 years ago)
- Last Synced: 2023-05-29T11:01:18.673Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://developer.littlstar.com/lsplayer-iframe-sdk/doc
- Size: 491 KB
- Stars: 2
- Watchers: 22
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LSPlayer iFrame SDK
## Getting started
When you embed a Littlstar iframe into your website you can include the
optional Javascript SDK for interacting with the player and inspecting
its state. The consumer must implement the `OnLSPlayerFrameReady` function
in the global scope and ensure that every `iframe` on the page has a class
of `'lsplayer-frame'`. Attaching to window is preferred. The player and state
objects provide mechanisms for interacting with the iframe API and
inspecting its state. If this function is not defined then an error will
be thrown. You can inspect the error with your browser's development
toolkit console. This function is called when the iframe player is ready
to be interacted with. If there are multiple iframes on the page then
the function will be called for each providing a `player` and `state`
object unique to that player frame.## Including the SDK on your web page
You can include the Javascript on your web page by embedding the
following HTML in the head of your document.```html
```
## Example
```js
function OnLSPlayerFrameReady (player, state) {
console.log("Player %d is ready", player.id);player
.seek(5)
.projection('tiny planet')
.rotate('y', {value: 0.002, every 100})
.play();player.on('timeupdate', function () {
console.log("current time = %d", state.currentTime);
});
}
```## License
MIT