The Slideshow
class is used to set multiple PresenceData
and "slide" through them every x milliseconds (minimum: 5000).
See the createSlideshow
method in the Presence
class on how to create a Slideshow
.
currentSlide
Returns a PresenceData
object of what the presence/current slide is displaying.
const currentSlide = slideshow.currentSlide
console.log(currentSlide.details) // Will console log the details of the PresenceData
addSlide(String, PresenceData, Number)
Add a new slide to the Slideshow
according to provided data.
First parameter requires a String
that will be used as a unique identifier for the slide.
Second parameter requires a PresenceData
interface to get all information that you want to display in the slide.
Third parameter requires a Number
which is the amount of time in milliseconds (minimum: 5000) that this slide will show.
getSlides()
Returns all slides saved in the Slideshow
as an Array
of SlideshowSlide
.
updateSlide(String, PresenceData, Number)
Updates the slide of the given id
according to provided data.
First parameter requires a String
that is the unique identifier of the slide you want to update.
Second parameter requires a PresenceData
interface to get all information that you want to display in the slide.
Third parameter requires a Number
which is the amount of time in milliseconds (minimum: 5000) that this slide will show.
hasSlide(String)
Returns a Boolean
stating whether the slide is added to the Slideshow
.
deleteSlide(String)
Deletes the slide with the given id
from the Slideshow
.
First parameter requires a String
that is the unique identifier of the slide you want to delete.
deleteAllSlides()
Deletes all slides from the Slideshow
.
A SlideshowSlide
is the internal representation of each slide in a Slideshow
.
id
Returns a String
of the id of the slide.
data
Returns a PresenceData
object of the PresenceData
saved in the slide.
updateData(PresenceData)
Sets the slides data according to provided data.
You must provide a PresenceData
interface to get all information that you ultimately want to display in your profile.
updateInterval(Number)
Sets the interval of the slide according to provided data.
You must provide a Number
which is the amount of time in milliseconds (minimum: 5000) that this slide will show.