Listings

Listings is the service which handles scheduling of events, like an EPG in TV-speak

With LViS initialised, you can now use methods of the Listings object to find the current or next M/IC Event.

Let's check if there are any current M/IC Events, and if so use the first one. If there isn't any current M/IC Event, we'll use the getNext() method to identify the next upcoming M/IC Event.

If either a current or future M/IC Event is detected we'll set our current working M/IC Event.

Example

// Assume LViS is initialised
// shorthand
var L = LViS.Listings;
var handleEventReady = function () {
console.log('Event is ready!');
};
// Process Event Listings
var processListings = function () {
var current = L.getCurrent(),
next = L.getNext();
if (current !== null) {
event = current;
} else if (next !== null) {
event = next;
}
event.bind(LViS.Event.ON_READY, handleEventReady);
LViS.setEvent(event);
};
L.bind(L.ON_UPDATE, processListings);
// force listings processing
processListings();