tweet-player
v0.0.3
Published
Player for tweet data
Downloads
3
Readme
TweetPlayer
Install
npm install tweet-player
Usage
play
import TweetPlayer from 'tweet-player';
const tweets = [
{
/// raw tweets json data
/// See sample.json
},
];
const interval = 500; /// default is 1000ms
player = new TweetPlayer(tweets);
player.play((tweets, isEnd, seeker) => {
tweets.forEach((tweet) => {
console.log(tweet.text);
});
}, interval);
seekTo
play from the time specified
player.seekTo(1000, (tweets) => {
// your code here
});
pause
pause player
player.play(() => {
// callback
});
// will pause after 3000ms
setTimeout(() => {
player.pause()
// and restart after 3000ms from paused
setTimeout(() => {
player.play(() => {
/// callback
});
}, 3000);
}, 3000);