TOP 1.1.0 to 1.2.0 Migration Guide

This guide covers significant changes made for TOP in the 1.2.0-rc.1 release:

Breaking Changes

Some breaking changes were made in version 1.2.0-rc.1. Anyone using version 1.1.0 and lower will need to make minor updates. The breaking changes are the following:

Cue State Changed Event Result

This only applies to you if you were listening to the cueStateChanged event

Prior to 1.2.0-rc.1, when a cueStateChanged event is fired, the name of the state which a cue is changing from is oldState:

var player = TOP.createAndInitPlayer({
    events : {
        cueStateChanged: function(result) {
            console.log('[cueStateChanged] changing from state:', result.oldState);
        }
    }
});

In 1.2.0-rc.1, oldState has been normalized to previousState to conform to the naming convention used in all other state changed events:

var player = TOP.createAndInitPlayer({
    events : {
        cueStateChanged: function(result) {
            console.log('[cueStateChanged] changing from state:', result.previousState);
        }
    }
});

Suggested Changes

Included in 1.2.0, we have deprecated the usage of listenFor() methods on event collections. Instead, the listen() method now supports both a function argument as well as an event map.

You can simply swap usage of listenFor(map) -> listen(map)