Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexbinary/wcjs-time-callback
Node.js module to attach callbacks to specific time in a WebChimera playback.
https://github.com/alexbinary/wcjs-time-callback
Last synced: 1 day ago
JSON representation
Node.js module to attach callbacks to specific time in a WebChimera playback.
- Host: GitHub
- URL: https://github.com/alexbinary/wcjs-time-callback
- Owner: alexbinary
- License: mit
- Created: 2016-01-20T19:57:44.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-01T18:07:21.000Z (almost 9 years ago)
- Last Synced: 2024-11-04T21:48:06.583Z (12 days ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wcjs-time-callback
> Node.js module to attach callbacks to specific times in a WebChimera playback.
This module makes smart use of the events provided by WebChimera and combine them with native javascript timeouts to trigger callbacks at very specific times.
## Install
```
npm install wcjs-time-callback
```## Usage
```javascript
const vlc = require('wcjs-renderer').init(canvas);const timing = require('wcjs-time-callback').for(vlc);
timing.onTime(12500, function() {
console.log('hello'); // will trigger at exactly 12 sec and 500 ms,
// every time playback reaches that time.
});timing.onTime(14200, function() {
console.log('hi');
}, {
singleShot: true, // will trigger at 14 sec and 200ms
// but only the first time playback reaches that time
});```
## License
The MIT License (MIT) - Copyright (c) 2016 Alexandre Bintz
See [LICENSE](LICENSE) file for full text.