define('application/helpers/parentalHelper', [
'antie/runtimecontext',
'application/managers/session'
], function (
RuntimeContext,
SessionManager
) {
'use strict';
var sessionManager = SessionManager.getInstance();
return {
/**
* Handle behaviour when user escapes the Parental Control Entry pop-up.
*
* @param {boolean} backToChannelList - Got to Channel list on pop-up escape.
* @public
*/
parentaleEscapeCallback: function parentaleEscapeCallback (backToChannelList) {
this._mediaChangeInProgress = false;
this._parentalEscaped = true;
if (backToChannelList) {
this.routeToPage('channellist');
return;
}
if (this._type === 'VOD_MOVIE') {
this._onBack();
return;
}
if (!sessionManager.getUserPin() && this._program.isLocked()) {
this._playChannel(this._lastChannelId);
} else {
this._resetPlayer();
this._playChannel(this._program.getChannelId());
}
},
/**
* Handle behaviour on error in parental pin entry pop-up.
*
* @param {Object} error - Error object.
* @public
*/
parentaleErrorCallback: function hadnleErrorParentaPinInput (error) {
if (error.message) {
// Handle potential errors
}
}
};
});