Sandbox-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- 1825 discussions
Author: smaisonneuve
Date: 2015-06-09 15:36:42 +0000 (Tue, 09 Jun 2015)
New Revision: 1664
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1664
Log:
[Refactor] Turning Tuner into es6 class
Modified:
oipf/lib/js/impl/model/Tuner.js
Modified: oipf/lib/js/impl/model/Tuner.js
===================================================================
--- oipf/lib/js/impl/model/Tuner.js 2015-06-09 15:35:28 UTC (rev 1663)
+++ oipf/lib/js/impl/model/Tuner.js 2015-06-09 15:36:42 UTC (rev 1664)
@@ -13,7 +13,9 @@
*/
class Tuner {
- constructor() {
+ constructor(name, idTypes, defaultProperties) {
+ oipf.utils.initProperties.call(this, defaultProperties);
+
/*
* Description: A unique identifier of the tuner.
*
@@ -26,7 +28,7 @@
*
* Visibility Type: readonly String
*/
- this.name = null;
+ this.name = name;
/*
* Description: Returns a collection of the types supported by the tuner. The types are according to the ID types in section
@@ -34,7 +36,7 @@
*
* Visibility Type: readonly IntegerCollection
*/
- this.idTypes = null;
+ this.idTypes = idTypes;
/*
* Description:
@@ -93,10 +95,4 @@
*/
this.powerOnExternal = null;
}
-
- init(name, idTypes, defaultProperties) {
- oipf.utils.initProperties.call(this, defaultProperties);
- this.idTypes = idTypes;
- this.name = name;
- }
}
1
0
Author: smaisonneuve
Date: 2015-06-09 15:35:28 +0000 (Tue, 09 Jun 2015)
New Revision: 1663
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1663
Log:
[Refactor] Turning StartupInformation into es6 class
Modified:
oipf/lib/js/impl/model/StartupInformation.js
Modified: oipf/lib/js/impl/model/StartupInformation.js
===================================================================
--- oipf/lib/js/impl/model/StartupInformation.js 2015-06-09 15:34:02 UTC (rev 1662)
+++ oipf/lib/js/impl/model/StartupInformation.js 2015-06-09 15:35:28 UTC (rev 1663)
@@ -1,35 +1,31 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var StartupInformation = Class.extend({
-
- /*
- * Description:
- * The mechanism used to obtain the url property.
- * Any of the STARTUP_URL_* values defined in section 7.3.3.1 are valid.
- *
- * Visibility Type : readonly String
- */
- urlSource: null,
-
- /*
- * Description:
- * The URL used at startup of the OITF.
- * If the urlSource property is STARTUP_URL_NONE then
- * the value of this property SHALL be NULL.
- * If the urlSource property is STARTUP_URL_PRECONFIGURED then
- * the value of this property SHALL be undefined.
- *
- * Visibility Type : readonly String
- */
- url: null,
-
- init: function(urlSource, url) {
+class StartupInformation {
+
+ constructor(urlSource, url) {
+ /*
+ * Description:
+ * The mechanism used to obtain the url property.
+ * Any of the STARTUP_URL_* values defined in section 7.3.3.1 are valid.
+ *
+ * Visibility Type : readonly String
+ */
this.urlSource = urlSource;
+
+ /*
+ * Description:
+ * The URL used at startup of the OITF.
+ * If the urlSource property is STARTUP_URL_NONE then
+ * the value of this property SHALL be NULL.
+ * If the urlSource property is STARTUP_URL_PRECONFIGURED then
+ * the value of this property SHALL be undefined.
+ *
+ * Visibility Type : readonly String
+ */
this.url = url;
}
-
-});
+}
1
0
Author: ygrego
Date: 2015-06-09 15:34:02 +0000 (Tue, 09 Jun 2015)
New Revision: 1662
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1662
Log:
Refactoring of the class DateUtils in order to add space symbol in method constructor.
Modified:
oipf/lib/js/utils/DateUtils.js
Modified: oipf/lib/js/utils/DateUtils.js
===================================================================
--- oipf/lib/js/utils/DateUtils.js 2015-06-09 15:33:37 UTC (rev 1661)
+++ oipf/lib/js/utils/DateUtils.js 2015-06-09 15:34:02 UTC (rev 1662)
@@ -10,7 +10,7 @@
this.date = new Date();
this._yesterday = new Date(this.date.getFullYear(),
this.date.getUTCMonth(),
- this.date.getUTCDate()-1);
+ this.date.getUTCDate() - 1);
}
millisecondsToSeconds(timeInMilliseconds) {
1
0
Author: smaisonneuve
Date: 2015-06-09 15:33:37 +0000 (Tue, 09 Jun 2015)
New Revision: 1661
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1661
Log:
[Build] Fixing syntax in gulpfile
Modified:
oipf/lib/gulpfile.js
Modified: oipf/lib/gulpfile.js
===================================================================
--- oipf/lib/gulpfile.js 2015-06-09 15:32:54 UTC (rev 1660)
+++ oipf/lib/gulpfile.js 2015-06-09 15:33:37 UTC (rev 1661)
@@ -1,5 +1,5 @@
var gulp = require("gulp");
-var gulpSequence = require('gulp-sequence');
+var gulpSequence = require("gulp-sequence");
var concat = require("gulp-concat");
var sourcemaps = require("gulp-sourcemaps");
var babel = require("gulp-babel");
1
0
Author: smaisonneuve
Date: 2015-06-09 15:32:54 +0000 (Tue, 09 Jun 2015)
New Revision: 1660
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1660
Log:
[Refactor] Moving Tuner and TunerCollection into es6 classes
Modified:
oipf/lib/gulpfile.js
oipf/lib/js/impl/model/Tuner.js
oipf/lib/js/impl/model/TunerCollection.js
Modified: oipf/lib/gulpfile.js
===================================================================
--- oipf/lib/gulpfile.js 2015-06-09 15:31:49 UTC (rev 1659)
+++ oipf/lib/gulpfile.js 2015-06-09 15:32:54 UTC (rev 1660)
@@ -42,7 +42,7 @@
"minification.propertyLiterals",
"utility.inlineEnvironmentVariables"
],
- compact: true
+ compact: false
}))
.on("error", errorHandler)
.pipe(concat(conf.buildFile))
Modified: oipf/lib/js/impl/model/Tuner.js
===================================================================
--- oipf/lib/js/impl/model/Tuner.js 2015-06-09 15:31:49 UTC (rev 1659)
+++ oipf/lib/js/impl/model/Tuner.js 2015-06-09 15:32:54 UTC (rev 1660)
@@ -8,90 +8,95 @@
* attribute of the <video_broadcast> element.
* NOTE: An OITF may contain a physical tuner that has its capabilities split into multiple Tuner objects to fit the
* restrictions on the <video_broadcast> element outlined above and in section 9.3.1.
-*
+*
* Note: The standbyState property has been removed from this class.
*/
-var Tuner = Class.extend({
-
- /*
- * Description: A unique identifier of the tuner.
- *
- * Visibility Type: readonly Integer
- */
- id: null,
-
- /*
- * Description: The name of the tuner as designated in OITF.
- *
- * Visibility Type: readonly String
- */
- name: null,
-
- /*
- * Description: Returns a collection of the types supported by the tuner. The types are according to the ID types in section 7.13.11.1 under Channel object.
- *
- * Visibility Type: readonly IntegerCollection
- */
- idTypes: null,
-
- /*
- * Description:
- * The property enables ( true ) and disables ( false ) the tuner. Reading the property provides the current
- * state, enabled or disabled. Attempting to disable the tuner while the resource is in use has no effect and the tuner SHALL continue to be enabled.
- * While disabled:
- * • any external power feed (if applicable) SHALL be turned off;
- * • the value of the signalInfo property is not defined;
- * • the value of the lnbInfo property is not defined;
- * • the tuner SHALL NOT be available for use by any JavaScript object (e.g. the video/broadcast object) or by the underlying OITF system (e.g. to perform a * scheduled recording). Note the property enableTuner is available in order to re-enable the tuner and get access to the tuner again.
- *
- * The set value of the property SHALL persist after OITF restarts.
- *
- * Type: Boolean
- */
- enableTuner: null,
-
- /*
- * Description: The property returns a SignalInfo object with signal information for example signal strength.
- *
- * Visibility Type: readonly SignalInfo
- */
- signalInfo: null,
-
- /*
- * Description: The property returns a LNBInfo object with information regarding the LNB associated with the tuner.
- *
- * Visibility Type: readonly LNBInfo
- */
- lnbInfo: null,
+class Tuner {
- /*
- * Description: Indicates the physical interface associated with the tuner.
- *
- * Visibility Type: readonly Integer
- */
- frontEndPosition: null,
-
- /*
- * Description:
- * The property turns on (true) and off (false) the power applied to the external interface of the tuner unless the
- * tuner is disabled. Reading the property provides the current value, on or off. Attempting to modify the
- * property while the resource is in use has no effect. The value of the property SHALL persist after OITF
- * restarts.
- * For DVB-S/S2 power is supplied to the LNB(s) and if present the DiSEqC switch.
- * For DVB-T/T2 a supply +5V is supplied to the antenna with built in amplifier. Note that applying power may
- * have adverse effects to the external equipment if it has its own power supply. It is a strong recommendation
- * to indicate to the end user a possible adverse effect before using this method.
- * For DVB-C/C2 there is no effect.
- * Reading the property provides the current value.
- *
- * Type: Boolean
- */
- powerOnExternal: null,
-
- init: function(name, idTypes, defaultProperties) {
+ constructor() {
+ /*
+ * Description: A unique identifier of the tuner.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.id = null;
+
+ /*
+ * Description: The name of the tuner as designated in OITF.
+ *
+ * Visibility Type: readonly String
+ */
+ this.name = null;
+
+ /*
+ * Description: Returns a collection of the types supported by the tuner. The types are according to the ID types in section
+ * 7.13.11.1 under Channel object.
+ *
+ * Visibility Type: readonly IntegerCollection
+ */
+ this.idTypes = null;
+
+ /*
+ * Description:
+ * The property enables ( true ) and disables ( false ) the tuner. Reading the property provides the current
+ * state, enabled or disabled. Attempting to disable the tuner while the resource is in use has no effect and the tuner SHALL
+ * continue to be enabled.
+ * While disabled:
+ * • any external power feed (if applicable) SHALL be turned off;
+ * • the value of the signalInfo property is not defined;
+ * • the value of the lnbInfo property is not defined;
+ * • the tuner SHALL NOT be available for use by any JavaScript object (e.g. the video/broadcast object) or by the underlying OITF
+ * system (e.g. to perform a * scheduled recording). Note the property enableTuner is available in order to re-enable
+ * the tuner and get access to the tuner again.
+ *
+ * The set value of the property SHALL persist after OITF restarts.
+ *
+ * Type: Boolean
+ */
+ this.enableTuner = null;
+
+ /*
+ * Description: The property returns a SignalInfo object with signal information for example signal strength.
+ *
+ * Visibility Type: readonly SignalInfo
+ */
+ this.signalInfo = null;
+
+ /*
+ * Description: The property returns a LNBInfo object with information regarding the LNB associated with the tuner.
+ *
+ * Visibility Type: readonly LNBInfo
+ */
+ this.lnbInfo = null;
+
+ /*
+ * Description: Indicates the physical interface associated with the tuner.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.frontEndPosition = null;
+
+ /*
+ * Description:
+ * The property turns on (true) and off (false) the power applied to the external interface of the tuner unless the
+ * tuner is disabled. Reading the property provides the current value, on or off. Attempting to modify the
+ * property while the resource is in use has no effect. The value of the property SHALL persist after OITF
+ * restarts.
+ * For DVB-S/S2 power is supplied to the LNB(s) and if present the DiSEqC switch.
+ * For DVB-T/T2 a supply +5V is supplied to the antenna with built in amplifier. Note that applying power may
+ * have adverse effects to the external equipment if it has its own power supply. It is a strong recommendation
+ * to indicate to the end user a possible adverse effect before using this method.
+ * For DVB-C/C2 there is no effect.
+ * Reading the property provides the current value.
+ *
+ * Type: Boolean
+ */
+ this.powerOnExternal = null;
+ }
+
+ init(name, idTypes, defaultProperties) {
oipf.utils.initProperties.call(this, defaultProperties);
this.idTypes = idTypes;
this.name = name;
}
-
-});
\ No newline at end of file
+}
Modified: oipf/lib/js/impl/model/TunerCollection.js
===================================================================
--- oipf/lib/js/impl/model/TunerCollection.js 2015-06-09 15:31:49 UTC (rev 1659)
+++ oipf/lib/js/impl/model/TunerCollection.js 2015-06-09 15:32:54 UTC (rev 1660)
@@ -3,10 +3,10 @@
* The TunerCollection class represents a collection of Tuner objects. See Annex K for the definition of the collection template.
*
*/
-var TunerCollection = Collection.extend({
-
- init: function() {
- this.super.init.apply(this, arguments);
+class TunerCollection extends Collection {
+
+ constructor(...args) {
+ super(...args);
}
-});
\ No newline at end of file
+}
1
0
Author: ygrego
Date: 2015-06-09 15:31:49 +0000 (Tue, 09 Jun 2015)
New Revision: 1659
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1659
Log:
Refactoring of the class DateUtils in an ES6 class.
Modified:
oipf/lib/js/utils/DateUtils.js
Modified: oipf/lib/js/utils/DateUtils.js
===================================================================
--- oipf/lib/js/utils/DateUtils.js 2015-06-09 15:28:47 UTC (rev 1658)
+++ oipf/lib/js/utils/DateUtils.js 2015-06-09 15:31:49 UTC (rev 1659)
@@ -1,36 +1,36 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var DateUtils = Class.extend({
-
- init: function() {
+class DateUtils {
+
+ constructor() {
this.date = new Date();
this._yesterday = new Date(this.date.getFullYear(),
- this.date.getUTCMonth(),
+ this.date.getUTCMonth(),
this.date.getUTCDate()-1);
- },
-
- millisecondsToSeconds: function(timeInMilliseconds) {
+ }
+
+ millisecondsToSeconds(timeInMilliseconds) {
return timeInMilliseconds / 1000;
- },
-
- nowInSeconds: function() {
+ }
+
+ nowInSeconds() {
return this.millisecondsToSeconds(Date.now());
- },
-
- secondsToMilliseconds: function(timeInSeconds) {
+ }
+
+ secondsToMilliseconds(timeInSeconds) {
return timeInSeconds * 1000;
- },
-
- secondsToMinutes: function(timeInSeconds) {
+ }
+
+ secondsToMinutes(timeInSeconds) {
return timeInSeconds / 60;
- },
-
- yesterday: function() {
+ }
+
+ yesterday() {
return this._yesterday;
}
-
-});
+
+}
1
0
Author: ygrego
Date: 2015-06-09 15:28:47 +0000 (Tue, 09 Jun 2015)
New Revision: 1658
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1658
Log:
Deletion of an unused class + Refactoring of ChannelService class in the ES6 syntax.
Removed:
oipf/lib/js/utils/Calculation.js
Modified:
oipf/lib/js/utils/ChannelService.js
Deleted: oipf/lib/js/utils/Calculation.js
===================================================================
--- oipf/lib/js/utils/Calculation.js 2015-06-09 15:25:25 UTC (rev 1657)
+++ oipf/lib/js/utils/Calculation.js 2015-06-09 15:28:47 UTC (rev 1658)
@@ -1,11 +0,0 @@
-var Calculation = Class.extend({
-
- init: function() {
- },
-
- genId: function(boundary, adjustment){
-
- return Math.floor((Math.random() * boundary) + adjustment);
- }
-
-});
\ No newline at end of file
Modified: oipf/lib/js/utils/ChannelService.js
===================================================================
--- oipf/lib/js/utils/ChannelService.js 2015-06-09 15:25:25 UTC (rev 1657)
+++ oipf/lib/js/utils/ChannelService.js 2015-06-09 15:28:47 UTC (rev 1658)
@@ -1,20 +1,16 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var ChannelService = Class.extend({
-
- channelObject: {
+class ChannelService {
- },
-
- init: function(currentChannel, channelNumber, channelOrigin, channelList) {
+ constructor(currentChannel, channelNumber, channelOrigin, channelList) {
this.channelNumber = channelNumber;
this.channelOrigin = channelOrigin;
this.channelListArray = channelList;
-
+
this.getNumber = oipf.utils.generateFourDigit.bind(null);
this.channelList = new ChannelList();
@@ -22,54 +18,54 @@
this.favouriteLists = new FavouriteListCollection();
this.currentFavouriteList = new FavouriteList();
this.setCurrentChannel(currentChannel);
- },
-
- createChannelList: function() {
+ }
+
+ createChannelList() {
if (this.channelNumber > 0) {
-
+
for (var i = 0, li = this.channelListArray.length; i < li; i++) {
var channel = this.channelListArray[i];
var newOipfChannel = new Channel(channel);
this.channelList && this.channelList.push(newOipfChannel);
-
+
}
}
- },
-
- setCurrentChannel: function(name) {
+ }
+
+ setCurrentChannel(name) {
this.currentChannel = this.getChannelByName(this.channelList, name);
-
+
if (!this.currentChannel && this.channelList) {
var channel = this.channelList[0];
-
+
if (channel) {
this.currentChannel = channel;
- }
- }
- },
-
- getChannelByName: function(channelCollection, channelName) {
+ }
+ }
+ }
+
+ getChannelByName(channelCollection, channelName) {
for (var i = 0, li = channelCollection.length; i < li; i++) {
if (channelCollection[i].name == channelName) {
return channelCollection[i];
}
}
- },
-
- prevChannel: function(channelCollection, channel) {
+ }
+
+ prevChannel(channelCollection, channel) {
return channelUtils.findChannel(channelCollection, channel, -1);
- },
-
- nextChannel: function(channelCollection, channel) {
+ }
+
+ nextChannel(channelCollection, channel) {
return channelUtils.findChannel(channelCollection, channel, 1);
- },
-
- getADvbTChannel: function(name) {
- return new Channel(ID_DVB_T,
+ }
+
+ getADvbTChannel(name) {
+ return new Channel(ID_DVB_T,
this.getNumber(),
this.getNumber(),
this.getNumber(),
name);
- }
-
-});
+ }
+
+}
1
0
Author: jruchaud
Date: 2015-06-09 15:25:25 +0000 (Tue, 09 Jun 2015)
New Revision: 1657
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1657
Log:
Use class
Modified:
oipf/lib/js/impl/model/MetadataSearch.js
oipf/lib/js/impl/model/ModelFactory.js
oipf/lib/js/impl/model/NetworkInterface.js
oipf/lib/js/impl/model/NetworkInterfaceCollection.js
oipf/lib/js/impl/model/ParentalRating.js
oipf/lib/js/impl/model/ParentalRatingCollection.js
oipf/lib/js/impl/model/ParentalRatingScheme.js
oipf/lib/js/impl/model/ParentalRatingSchemeCollection.js
Modified: oipf/lib/js/impl/model/MetadataSearch.js
===================================================================
--- oipf/lib/js/impl/model/MetadataSearch.js 2015-06-09 15:19:17 UTC (rev 1656)
+++ oipf/lib/js/impl/model/MetadataSearch.js 2015-06-09 15:25:25 UTC (rev 1657)
@@ -9,7 +9,7 @@
* 1. Definition of the query. The application creates a MetadataSearch object, and either creates its associated
* Query object, or sets a query using the findProgrammesFromStream() method, and sets any applicable
* constraints and result ordering.
-*
+*
* 2. Acquisition of results. The OITF acquires some or all of the items that match the specified query and constraints, and
* caches the requested subset of the results. This is typically triggered by a call to getResults().
*
@@ -17,7 +17,7 @@
* The MetadataSearch and SearchResults classes work together to manage an individual search. For every search,
* the MetadataSearch object and its corresponding SearchResults object SHALL be in one of three states as
* described in table below:
-*
+*
* ---------------------------------------------------------------------------------------------------------------------------------------------------------------
* State | Description
* ---------- ----------------------------------------------------------------------------------------------------------------------------------------------------
@@ -29,7 +29,7 @@
* | SearchResults object SHALL return zero. Any search results that have been cached by
* | the terminal SHALL be discarded when the Idle state is entered.
* | Calling the SearchResults.getResults() method SHALL cause a state transition to
-* | the Searching state.
+* | the Searching state.
* ---------- ---------------------------------------------------------------------------------------------------------------------------------------------------
* Searching | Results are being retrieved and are not yet available to applications.
* |
@@ -94,65 +94,57 @@
* MAY gather all search results and cache them (or cache a set of pointers into the full database), or gather only the subset
* of search results determined by the getResults() parameters, or take an alternative approach not described here.
*/
-var MetadataSearch = Class.extend({
-
- _searchManager: null,
-
- _currentQuery: null,
-
- _constraints: null,
-
- _ordering: null,
-
- /*
- * Description:
- * The subset of search results that has been requested by the application.
- *
- * Visibility Type: readonly SearchResults
- */
- result: null,
-
- /*
- * Description :
- * The target(s) of the search. Valid values are:
- *
- * -----------------------------------------------------------------
- * Value | Description
- * ------ ----------------------------------------------------------
- * 1 | Metadata relating to scheduled content SHALL be searched.
- * 2 | Metadata relating to on-demand content SHALL be searched.
- *
- * These values SHALL be treated as a bitfield, allowing searches to be carried out across multiple search
- * targets.
- *
- * Visibility: readonly
- */
- searchTarget: null,
-
- init: function(searchTarget, searchManager) {
- this._searchManager = searchManager;
+class MetadataSearch {
+
+ constructor(searchTarget, searchManager) {
+
+ this._currentQuery = null;
+
+ /*
+ * Description:
+ * The subset of search results that has been requested by the application.
+ *
+ * Visibility Type: readonly SearchResults
+ */
this.result = new SearchResults(this);
+
+ /*
+ * Description :
+ * The target(s) of the search. Valid values are:
+ *
+ * -----------------------------------------------------------------
+ * Value | Description
+ * ------ ----------------------------------------------------------
+ * 1 | Metadata relating to scheduled content SHALL be searched.
+ * 2 | Metadata relating to on-demand content SHALL be searched.
+ *
+ * These values SHALL be treated as a bitfield, allowing searches to be carried out across multiple search
+ * targets.
+ *
+ * Visibility: readonly
+ */
this.searchTarget = searchTarget;
+
+ this._searchManager = searchManager;
this._constraints = {
channels: [],
ratings: []
};
this._ordering = [];
-
+
this._fireEventModified = this._searchManager
._fireEventModified.bind(this._searchManager);
+ }
- },
-
/*
- * Description:
+ * Description:
* Set a query and constraints for retrieving metadata for programmes from a given channel
* and given start time from metadata contained in the stream as defined in section 4.1.3 of
* [OIPF_META2]. Setting the search parameters using this method will implicitly remove any
* existing constraints, ordering or queries created by prior calls to methods on this object.
* This method does not cause the search to be performed; applications must call
* getResults() to retrieve the results.
- *
+ *
* Arguments:
* - channel: The channel for which programme information should be found.
*
@@ -169,132 +161,126 @@
* getResults() even if a call to getResults() requests more results.
* If this argument is not specified, no restrictions are imposed on the number of
* results which may be returned by calls to getResults().
- *
+ *
*/
- findProgrammesFromStream: function(channel, startTime, count) {
+ findProgrammesFromStream(channel, startTime, count) {
var parameters = arguments;
if (parameters.length > 3) {
throw new TypeError("Excessive number of arguments.");
}
-
+
if (parameters.length < 1) {
throw new TypeError("Insufficient number of arguments.");
}
-
+
if (!(channel instanceof Channel) ||
(startTime && !Number.isInteger(startTime)) ||
(count && !Number.isInteger(count))) {
- throw new TypeError
- ("This function cannot be called with these arguments.");
+ throw new TypeError("This function cannot be called with these arguments.");
}
-
+
this._abortIfNecessary();
-
+
console.log("[INFO]: findProgrammesFromStream [IN]");
this.addChannelConstraint(channel);
this._currentQuery = new Query("startTime", 0, startTime, count);
console.log("[INFO]: findProgrammesFromStream [Out]");
- },
-
+ }
+
/*
- * Description:
- * Set the query terms to be used for this search,
+ * Description:
+ * Set the query terms to be used for this search,
* discarding any previously-set query terms.
- * Setting the search parameters using this method will implicitly remove
- * any existing constraints, ordering or queries created
+ * Setting the search parameters using this method will implicitly remove
+ * any existing constraints, ordering or queries created
* by prior calls to methods on this object.
- *
+ *
* Arguments:
- * -query: The query terms to be used.
- *
+ * -query: The query terms to be used.
+ *
*/
- setQuery: function(query) {
+ setQuery(query) {
var parameters = arguments;
-
+
if (parameters.length > 1) {
throw new TypeError("Excessive number of arguments.");
}
-
+
if (parameters.length < 1) {
throw new TypeError("Insufficient number of arguments.");
}
-
+
if (!(query instanceof Query)) {
-
- throw new TypeError
- ("This function cannot be called with this argument.");
-
+ throw new TypeError("This function cannot be called with this argument.");
}
-
+
this._abortIfNecessary();
this._currentQuery = query;
- },
-
+ }
+
/*
* Description:
- * Constrain the search to only include results from
- * the specified channel(s).
- * If a channelconstraint has already been set, subsequent calls to
- * addChannelConstraint() SHALL add the specified channel(s) to the list of
+ * Constrain the search to only include results from
+ * the specified channel(s).
+ * If a channelconstraint has already been set, subsequent calls to
+ * addChannelConstraint() SHALL add the specified channel(s) to the list of
* channels from which results should be returned.
* For CoD searches, adding a channel constraint SHALL have no effect.
- *
+ *
* Arguments:
- * -channels: The channel(s) from which results SHALL be returned.
- * If the value of this argument is null, any existing channel
- * constraint SHALL be removed.
- *
+ * -channels: The channel(s) from which results SHALL be returned.
+ * If the value of this argument is null, any existing channel
+ * constraint SHALL be removed.
+ *
*/
- addChannelConstraint: function(channels) {
+ addChannelConstraint(channels) {
var parameters = arguments;
-
+
if (parameters.length > 1) {
throw new TypeError("Excessive number of arguments.");
}
-
+
if (parameters.length < 1) {
throw new TypeError("Insufficient number of arguments.");
}
-
+
if (!channels) {
this._constraints.channels.length = 0;
-
+
} else if (!(channels instanceof ChannelList) &&
!(channels instanceof Channel)) {
- throw new TypeError
- ("This function cannot be called with this argument.");
-
+ throw new TypeError("This function cannot be called with this argument.");
+
}
-
+
this._abortIfNecessary();
-
+
if (this._constraints.channels) {
this._constraints.channels =
this._constraints.channels.concat(channels);
-
+
}
-
- },
-
+ }
+
/*
* Description:
- * Description Constrain the search to only include results whose
+ * Description Constrain the search to only include results whose
* parental rating value is below the specified threshold.
- *
+ *
* Arguments:
- * -scheme: The parental rating scheme upon which the constraint
- * SHALL be based. If the value of this argument is null,
+ * -scheme: The parental rating scheme upon which the constraint
+ * SHALL be based. If the value of this argument is null,
* any existing parental rating constraints SHALL be cleared.
- *
- * -threshold: The threshold above which results SHALL NOT be returned.
- * If the value of this argument is null,
+ *
+ * -threshold: The threshold above which results SHALL NOT be returned.
+ * If the value of this argument is null,
* any existing constraint for the specified parental
- * rating scheme SHALL be cleared.
+ * rating scheme SHALL be cleared.
*/
- addRatingConstraint: function(scheme, threshold) {
+ addRatingConstraint(scheme, threshold) {
this._abortIfNecessary();
-
+
if (scheme && threshold) {
var rating = {
scheme: scheme,
@@ -303,93 +289,87 @@
this._constraints.ratings &&
this._constraints.ratings.push(rating);
-
+
} else if (this._constraints.ratings) {
this._constraints.ratings.length = 0;
}
-
- },
-
+ }
+
/*
* Description:
- * Description Constrain the search to only include results whose
+ * Description Constrain the search to only include results whose
* parental rating value is below the specified threshold.
*/
- addCurrentRatingConstraint: function() {
-
- },
-
+ addCurrentRatingConstraint() {
+
+ }
+
/*
* Description:
- * Create a metadata query for a specific value in a specific
- * field within the metadata. Simple queries MAY be combined to
+ * Create a metadata query for a specific value in a specific
+ * field within the metadata. Simple queries MAY be combined to
* create more complex queries. Applications SHALL follow the
- * JavaScript type conversion rules to convert non-string values
+ * JavaScript type conversion rules to convert non-string values
* into their string representation, if necessary.
*/
- createQuery: function(field, comparison, value) {
+ createQuery(field, comparison, value) {
var parameters = arguments;
if (parameters.length > 3) {
- throw new TypeError
- ("Excessive number of arguments.");
+ throw new TypeError("Excessive number of arguments.");
}
-
- if (!(typeof field === "string") ||
+
+ if (!(typeof field === "string") ||
!Number.isInteger(comparison) ||
(!Number.isInteger(value) && !(typeof value === "string"))) {
-
- throw new TypeError
- ("This function cannot be called with these arguments.");
-
+
+ throw new TypeError("This function cannot be called with these arguments.");
+
}
return new Query(field, comparison, value);
- },
-
+ }
+
/*
* Description:
- * Set the order in which results SHOULD be returned in future.
- * Any existing search results SHALL not be re-ordered. Subsequent calls
+ * Set the order in which results SHOULD be returned in future.
+ * Any existing search results SHALL not be re-ordered. Subsequent calls
* to orderBy() will apply further levels of ordering within the order
* defined by previous calls.
* For example:
* orderBy("ServiceName", true);
* orderBy("PublishedStart", true);
- * will cause results to be ordered by service name and then by start time
+ * will cause results to be ordered by service name and then by start time
* for results with the same channel number.
- *
+ *
* Arguments:
* -field: The name of the field by which results SHOULD be sorted.
- * A value of null indicates that any currently-set order SHALL be cleared
+ * A value of null indicates that any currently-set order SHALL be cleared
* and the default sort order should be used.
- *
- * -ascending: Flag indicating whether the results SHOULD
+ *
+ * -ascending: Flag indicating whether the results SHOULD
* be returned in ascending or descending order.
*/
- orderBy: function(field, ascending) {
+ orderBy(field, ascending) {
var parameters = arguments;
- if (parameters.length != 2) {
- throw new TypeError
- ("Excessive number of arguments.");
- }
-
- if ((!(typeof field === "string") &&
- field &&
- Number.isInteger(field)) ||
+ if (parameters.length !== 2) {
+ throw new TypeError("Excessive number of arguments.");
+ }
+
+ if (!(typeof field === "string") &&
+ field &&
+ Number.isInteger(field) ||
!(typeof ascending === "boolean")) {
throw new TypeError("This function cannot be called with these arguments.");
}
-
+
if (this._ordering) {
this._ordering.push({
field: field,
ascending: ascending
});
}
+ }
- },
-
- _removeConstraints: function() {
-
+ _removeConstraints() {
var keys = Object.keys(this._constraints);
for (var i = 0, l = keys.length; i < l; i++) {
var constraint = this._constraints[keys[i]];
@@ -397,21 +377,21 @@
constraint.length = 0;
}
}
- },
-
- _removeQuery: function() {
+ }
+
+ _removeQuery() {
this._currentQuery = null;
- },
-
- _removeOrdering: function() {
+ }
+
+ _removeOrdering() {
this._ordering = null;
- },
-
- _abortIfNecessary: function() {
- if (this.result._timerManager.timer) {
- this.result.abort();
- this._fireEventModified(this);
- }
}
-});
\ No newline at end of file
+ _abortIfNecessary() {
+ if (this.result._timerManager.timer) {
+ this.result.abort();
+ this._fireEventModified(this);
+ }
+ }
+
+}
Modified: oipf/lib/js/impl/model/ModelFactory.js
===================================================================
--- oipf/lib/js/impl/model/ModelFactory.js 2015-06-09 15:19:17 UTC (rev 1656)
+++ oipf/lib/js/impl/model/ModelFactory.js 2015-06-09 15:25:25 UTC (rev 1657)
@@ -1,93 +1,85 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
+class ModelFactory {
-var ModelFactory = Class.extend({
-
- init: function(metadataObject) {
+ constructor(metadataObject) {
this.metadataObject = metadataObject;
this.metadataManager = null;
this.xmlTvData = null;
// this.createXmlTvData();
// this.createMetadataManager();
this.capabilitiesProperties = new CapabilitiesProperties();
- },
-
- createXmlTvData: function() {
+ }
+
+ createXmlTvData() {
console.log("Method createXmlTvData");
- return this.getProperty("xmlTvData") ||
- this.setProperty("xmlTvData",
+ return this.getProperty("xmlTvData") ||
+ this.setProperty("xmlTvData",
new XmlTvData(this.metadataObject));
-
- },
-
- getXmlTvData: function() {
+ }
+
+ getXmlTvData() {
console.log("Method createXmlTvData");
return this.getProperty("xmlTvData");
- },
-
+ }
+
/*
* FIXME: Yannis - 06/05/2015 - Get a method to find an available number for
* randomIndex.
*/
- getAProgrammeFromXmlTvData: function() {
+ getAProgrammeFromXmlTvData() {
console.log("Method createXmlTvData");
- var randomIndex = oipf.utils.getRandomNumberBetweenMinMax(0,
+ var randomIndex = oipf.utils.getRandomNumberBetweenMinMax(0,
this.xmlTvData.programmes.length);
-
+
if (this.xmlTvData && this.xmlTvData.programmes[randomIndex]) {
return this.xmlTvData.programmes[15];
}
-
- },
-
- createScheduledRecording: function() {
+ }
+
+ createScheduledRecording() {
console.log("Method createScheduledRecording");
return new ScheduledRecording(this.getAPrgrammeFromXmlTvData());
- },
-
- createRecording: function() {
+ }
+
+ createRecording() {
console.log("Method createRecording");
return new Recording(this.createScheduledRecording());
- },
-
- createMetadataManager: function() {
+ }
+
+ createMetadataManager() {
console.log("Method createMetadataManager");
-
+
if (this.getProperty("metadataManager")) {
return this.getProperty("metadataManager");
}
-
+
this.setProperty("metadataManager", new MetadataManager());
this.getProperty("metadataManager").addMetadata(this.getXmlTvData());
-
+
return this.getProperty("metadataManager");
- },
-
- getXmlParser: function() {
+ }
+
+ getXmlParser() {
return new XmlParser();
- },
-
- getMetadataManager: function() {
+ }
+
+ getMetadataManager() {
console.log("Method getMetadataManager");
return this.getProperty("metadataManager");
- },
-
- getProperty: function(propertyName) {
+ }
+
+ getProperty(propertyName) {
console.log("Method getProperty");
return this[propertyName];
- },
-
- setProperty: function(propertyName, value) {
+ }
+
+ setProperty(propertyName, value) {
console.log("Method setProperty");
this[propertyName] = value;
- },
-
- getCapabilitiesProperties: function() {
+ }
+
+ getCapabilitiesProperties() {
return this.capabilitiesProperties;
}
-
-});
+
+}
Modified: oipf/lib/js/impl/model/NetworkInterface.js
===================================================================
--- oipf/lib/js/impl/model/NetworkInterface.js 2015-06-09 15:19:17 UTC (rev 1656)
+++ oipf/lib/js/impl/model/NetworkInterface.js 2015-06-09 15:25:25 UTC (rev 1657)
@@ -1,52 +1,41 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
+class NetworkInterface {
-var NetworkInterface = Class.extend({
- /*
- * Description:
- * The IP address of the network interface, in dotted-quad notation for IPv4
- * or colon-hexadecimal notation for IPv6. This property SHALL take
- * the value undefined if no IP address has been assigned. The IP address
- * may be link local, private or global, depending on which address block it
- * belongs to, as reserved by IANA.
- *
- * Visibility Type: readonly String
- */
- ipAddress: null,
-
- /*
- * Description:
- * The colon-separated MAC address of the network interface.
- *
- * Visibility Type: readonly String
- */
- macAddress: null,
-
- /*
- * Description:
- * Flag indicating whether the network interface is currently connected.
- *
- * Visibility Type: readonly Boolean
- */
- connected: null,
+ constructor(ipAddress, macAddress, connected, enabled) {
+ /*
+ * Description:
+ * The IP address of the network interface, in dotted-quad notation for IPv4
+ * or colon-hexadecimal notation for IPv6. This property SHALL take
+ * the value undefined if no IP address has been assigned. The IP address
+ * may be link local, private or global, depending on which address block it
+ * belongs to, as reserved by IANA.
+ *
+ * Visibility Type: readonly String
+ */
+ this.ipAddress = ipAddress;
- /*
- * Description:
- * Flag indicating whether the network interface is enabled.
- * Setting this property SHALL enable or disable the network interface.
- *
- * Type: Boolean
- */
- enabled: null,
+ /*
+ * Description:
+ * The colon-separated MAC address of the network interface.
+ *
+ * Visibility Type: readonly String
+ */
+ this.macAddress = macAddress;
- init: function(ipAddress, macAddress, connected, enabled) {
- this.ipAddress= ipAddress;
- this.macAddress= macAddress;
- this.connected= connected;
- this.enabled= enabled;
- }
-});
+ /*
+ * Description:
+ * Flag indicating whether the network interface is currently connected.
+ *
+ * Visibility Type: readonly Boolean
+ */
+ this.connected = connected;
+ /*
+ * Description:
+ * Flag indicating whether the network interface is enabled.
+ * Setting this property SHALL enable or disable the network interface.
+ *
+ * Type: Boolean
+ */
+ this.enabled = enabled;
+ }
+}
Modified: oipf/lib/js/impl/model/NetworkInterfaceCollection.js
===================================================================
--- oipf/lib/js/impl/model/NetworkInterfaceCollection.js 2015-06-09 15:19:17 UTC (rev 1656)
+++ oipf/lib/js/impl/model/NetworkInterfaceCollection.js 2015-06-09 15:25:25 UTC (rev 1657)
@@ -1,12 +1,5 @@
-/*
- * The NetworkInterfaceCollection class represents a collection of
- * NetworkInterface objects. See Annex K for the definition
- * of the collection template.
- */
-
-var NetworkInterfaceCollection = Collection.extend({
- init: function() {
- this.super.init.apply(this, arguments);
-
+class NetworkInterfaceCollection extends Collection {
+ constructor(...args) {
+ super(...args);
}
-});
+}
Modified: oipf/lib/js/impl/model/ParentalRating.js
===================================================================
--- oipf/lib/js/impl/model/ParentalRating.js 2015-06-09 15:19:17 UTC (rev 1656)
+++ oipf/lib/js/impl/model/ParentalRating.js 2015-06-09 15:25:25 UTC (rev 1657)
@@ -1,58 +1,53 @@
-/*
+/*
* A ParentalRating object describes a parental rating value for a programme or
* channel. The ParentalRating object identifies both the rating scheme in use,
* and the parental rating value within that scheme. In case of a BCG the values
- * of the properties in this object will be read from the ParentalGuidance
+ * of the properties in this object will be read from the ParentalGuidance
* element that is the child of a programme’s BCG description.
*/
-var ParentalRating = Class.extend({
-
- /*
- * Visibility Type: readonly String
- */
- name: null,
-
- /*
- * Description:
- * Unique name identifying the parental rating guidance scheme to which this
- * parental rating value refers.
- *
- * Valid strings include:
- * - the URI of one of the MPEG-7 classification schemes representing a
- * parental rating scheme as defined by the “ uri ” attribute of one of the
- * parental rating <ClassificationScheme> elements in [MPEG-7].
- *
- * - the string value “ urn:oipf:GermanyFSKCS ” to represent the GermanyFSK
- * rating scheme as defined in [OIPF_META2].
- *
- * - the string value “ dvb-si ”: this means that the scheme of a minimum
- * recommended age encoded as per [EN 300 468], is used to represent the
- * parental rating values.
- *
- * Visibility Type: readonly String
- */
- scheme: null,
-
- /*
- * Visibility Type: readonly Integer
- */
- value: null,
-
- /*
- * Visibility Type: readonly Integer
- */
- labels: null,
-
- /*
- * Visibility Type: readonly String
- */
- region: null,
-
- init : function(name, scheme, value, labels, region) {
+class ParentalRating {
+
+ constructor(name, scheme, value, labels, region) {
+ /*
+ * Visibility Type: readonly String
+ */
this.name = name;
+
+ /*
+ * Description:
+ * Unique name identifying the parental rating guidance scheme to which this
+ * parental rating value refers.
+ *
+ * Valid strings include:
+ * - the URI of one of the MPEG-7 classification schemes representing a
+ * parental rating scheme as defined by the “ uri ” attribute of one of the
+ * parental rating <ClassificationScheme> elements in [MPEG-7].
+ *
+ * - the string value “ urn:oipf:GermanyFSKCS ” to represent the GermanyFSK
+ * rating scheme as defined in [OIPF_META2].
+ *
+ * - the string value “ dvb-si ”: this means that the scheme of a minimum
+ * recommended age encoded as per [EN 300 468], is used to represent the
+ * parental rating values.
+ *
+ * Visibility Type: readonly String
+ */
this.scheme = scheme;
+
+ /*
+ * Visibility Type: readonly Integer
+ */
this.value = value;
+
+ /*
+ * Visibility Type: readonly Integer
+ */
this.labels = labels;
+
+ /*
+ * Visibility Type: readonly String
+ */
this.region = region;
}
-});
+
+}
Modified: oipf/lib/js/impl/model/ParentalRatingCollection.js
===================================================================
--- oipf/lib/js/impl/model/ParentalRatingCollection.js 2015-06-09 15:19:17 UTC (rev 1656)
+++ oipf/lib/js/impl/model/ParentalRatingCollection.js 2015-06-09 15:25:25 UTC (rev 1657)
@@ -1,49 +1,46 @@
-/*
+/*
* typedef Collection<ParentalRating> ParentalRatingCollection
* A ParentalRatingCollection represents a collection of parental rating values.
- * See Annex K for the definition of the collection template. In addition to
+ * See Annex K for the definition of the collection template. In addition to
* the methods and properties defined for generic collections,
* the ParentalRatingCollection class supports the additional properties and
* methods defined below.
*/
+class ParentalRatingCollection extends Collection {
-var ParentalRatingCollection = Collection.extend({
-
- init: function() {
- this.super.init.apply(this, arguments);
- },
-
+ constructor(...args) {
+ super(...args);
+ }
+
/*
* Description:
- * Creates a ParentalRating object instance for a given parental rating
- * scheme and parental rating value, and adds it to
+ * Creates a ParentalRating object instance for a given parental rating
+ * scheme and parental rating value, and adds it to
* the ParentalRatingCollection for a programme or channel.
- *
+ *
* Arguments:
* - scheme A unique string identifying the parental rating scheme to which
- * this value refers. See property scheme in section 7.9.4.1 for more
+ * this value refers. See property scheme in section 7.9.4.1 for more
* information about possible values.
- *
+ *
* -name: A string representation of the parental rating value. See property
- * name in section 7.9.4.1 for more information about possible values.
+ * name in section 7.9.4.1 for more information about possible values.
* Values are not case sensitive.
- *
+ *
* -value: The parental rating value represented as an Integer. See property
* value in section 7.9.4.1 for more information about possible values.
- *
- * -labels: A set of content rating labels that may provide additional
+ *
+ * -labels: A set of content rating labels that may provide additional
* information about the rating. See property labels in section 7.9.4.1 for
* more information about possible values.- region: The region to which the
- * parental rating value applies as an alpha-2 region code as defined in
- * ISO 3166-1. The value of this argument must be null or undefined if no
+ * parental rating value applies as an alpha-2 region code as defined in
+ * ISO 3166-1. The value of this argument must be null or undefined if no
* specific region has been identified. Values are not case sensitive.
*/
- addParentalRating: function(scheme, name, value, labels, region) {
- var newParentalRating =
+ addParentalRating(scheme, name, value, labels, region) {
+ var newParentalRating =
new ParentalRating(scheme, name, value, labels, region);
-
+
this.push(newParentalRating);
}
-});
-
-
+}
Modified: oipf/lib/js/impl/model/ParentalRatingScheme.js
===================================================================
--- oipf/lib/js/impl/model/ParentalRatingScheme.js 2015-06-09 15:19:17 UTC (rev 1656)
+++ oipf/lib/js/impl/model/ParentalRatingScheme.js 2015-06-09 15:25:25 UTC (rev 1657)
@@ -1,99 +1,93 @@
-/*
+/*
* typedef Collection<String> ParentalRatingScheme
* A ParentalRatingScheme describes a single parental rating scheme that may be
- * in use for rating content, e.g. the MPAA or BBFC rating schemes. It is a
- * collection of strings representing rating values, which next to
- * the properties and methods defined below SHALL support the array notation
- * to access the rating values in this collection. For the natively OITF
- * supported parental rating systems the values SHALL be ordered by the OITF
- * to allow the rating values to be compared in the manner as defined for
- * property threshold for the respective parental rating system.
- * Using a threshold as defined in this API may not necessarily be the proper
- * way in which parental rating filtering is applied on the OITF,
- * e.g. the US FCC requirements take precedence for device to be imported
- * to the US. The parental rating schemes supported by a receiver MAY vary
- * between deployments. See Annex K for the definition of the collection
+ * in use for rating content, e.g. the MPAA or BBFC rating schemes. It is a
+ * collection of strings representing rating values, which next to
+ * the properties and methods defined below SHALL support the array notation
+ * to access the rating values in this collection. For the natively OITF
+ * supported parental rating systems the values SHALL be ordered by the OITF
+ * to allow the rating values to be compared in the manner as defined for
+ * property threshold for the respective parental rating system.
+ * Using a threshold as defined in this API may not necessarily be the proper
+ * way in which parental rating filtering is applied on the OITF,
+ * e.g. the US FCC requirements take precedence for device to be imported
+ * to the US. The parental rating schemes supported by a receiver MAY vary
+ * between deployments. See Annex K for the definition of the collection
* template. In addition to the methods and properties defined for generic
- * collections, the ParentalRatingScheme class supports the additional
+ * collections, the ParentalRatingScheme class supports the additional
* properties and methods defined below.
*/
-var ParentalRatingScheme = Collection.extend({
-
- name: null,
-
- threshold: null,
-
+class ParentalRatingScheme extends Collection {
+
/*
- *
- * FIXME:
+ * FIXME:
* - Yannis 15/05/2015 Initialization of property threshold must be bone,
* when name unequal to "dvb-si" but i don't know with what values.
*/
- init: function(name, values) {
+ constructor(name, values) {
this._iconUri = [];
this.name = name;
+ this.threshold = null;
this._additionnalProcessing(name, values);
-
- },
+ }
/*
* Description:
* Return the index of the rating represented by attribute ratingValue
* inside the parental rating scheme string collection, or -1 if the rating
* value cannot be found in the collection.
- *
+ *
* Argument:
- * - ratingValue: The string representation of a parental rating value.
- * See property name in section 7.9.1.1 for more information about possible
+ * - ratingValue: The string representation of a parental rating value.
+ * See property name in section 7.9.1.1 for more information about possible
* values. Values are not case sensitive.
*/
- indexOf: function(ratingValue) {
-
+ indexOf(ratingValue) {
+
for (var i = 0, li = this.length; i < li; i++) {
var rating = this[i];
-
+
if (ratingValue == rating) {
return i;
}
}
-
+
return -1;
- },
-
+ }
+
/*
* Description:
* Return the URI of the icon representing the rating at index in the rating
- * scheme, or undefined if no item is present at that position. If no icon
+ * scheme, or undefined if no item is present at that position. If no icon
* is available, this method SHALL return null.
- *
+ *
* Argument:
* - index: The index of the parental rating scheme.
*/
- iconUri: function(index) {
+ iconUri(index) {
return this._iconUri[index];
- },
-
- _additionnalProcessing: function(name, values) {
+ }
+
+ _additionnalProcessing(name, values) {
switch (name) {
- case "dvb-si":
+ case "dvb-si":
break;
-
- default:
- var ratingValues = values.split(",");
- ratingValues && this._addSeveralRatingValues(ratingValues);
+
+ default:
+ var ratingValues = values.split(",");
+ ratingValues && this._addSeveralRatingValues(ratingValues);
}
- },
-
- _addRatingValue: function(ratingValue) {
+ }
+
+ _addRatingValue(ratingValue) {
this.push(ratingValue);
- },
-
- _addSeveralRatingValues: function(ratingValues) {
+ }
+
+ _addSeveralRatingValues(ratingValues) {
for (var i = 0, li = ratingValues.length; i < li; i++) {
var currentRatingValue = ratingValues[i];
this.addRatingValue(currentRatingValue);
}
}
-
-});
+}
Modified: oipf/lib/js/impl/model/ParentalRatingSchemeCollection.js
===================================================================
--- oipf/lib/js/impl/model/ParentalRatingSchemeCollection.js 2015-06-09 15:19:17 UTC (rev 1656)
+++ oipf/lib/js/impl/model/ParentalRatingSchemeCollection.js 2015-06-09 15:25:25 UTC (rev 1657)
@@ -1,74 +1,76 @@
-/*
+/*
* typedef Collection<ParentalRatingScheme> ParentalRatingSchemeCollection
- * A ParentalRatingSchemeCollection represents a collection of parental rating
- * schemes, e.g. as returned by property parentalRatingSchemes of the
- * "application/oipfParentalControlManager" object as defined in section 7.9.1.
- * Next to the properties and methods defined below a
- * ParentalRatingSchemeCollection object SHALL support the array notation to
+ * A ParentalRatingSchemeCollection represents a collection of parental rating
+ * schemes, e.g. as returned by property parentalRatingSchemes of the
+ * "application/oipfParentalControlManager" object as defined in section 7.9.1.
+ * Next to the properties and methods defined below a
+ * ParentalRatingSchemeCollection object SHALL support the array notation to
* access the parental rating scheme objects in this collection. See Annex K for
- * the definition of the collection template. In addition to the methods and
- * properties defined for generic collections,
- * the ParentalRatingSchemeCollection class supports the additional properties
+ * the definition of the collection template. In addition to the methods and
+ * properties defined for generic collections,
+ * the ParentalRatingSchemeCollection class supports the additional properties
* and methods defined below.
*/
+class ParentalRatingSchemeCollection extends Collection {
-var ParentalRatingSchemeCollection = Collection.extend({
/*
* Description:
- * Create a new ParentalRatingScheme object and adds it to
- * the ParentalRatingSchemeCollection . Applications MAY use this method to
- * register additional parental rating schemes with the platform.
- * When registered, the new parental rating scheme SHALL (temporarily) be
- * accessible through the parentalRatingSchemes property of the
- * "application/oipfParentalControlmanager" object as defined in section
- * 7.9.1. The application SHALL make sure that the values are ordered in
- * such a way to allow the rating values to be compared in the manner as
- * defined for the threshold property for the respective parental rating
- * system. This method returns a reference to the ParentalRatingScheme
- * object representing the added scheme. If the value of the name parameter
+ * Create a new ParentalRatingScheme object and adds it to
+ * the ParentalRatingSchemeCollection . Applications MAY use this method to
+ * register additional parental rating schemes with the platform.
+ * When registered, the new parental rating scheme SHALL (temporarily) be
+ * accessible through the parentalRatingSchemes property of the
+ * "application/oipfParentalControlmanager" object as defined in section
+ * 7.9.1. The application SHALL make sure that the values are ordered in
+ * such a way to allow the rating values to be compared in the manner as
+ * defined for the threshold property for the respective parental rating
+ * system. This method returns a reference to the ParentalRatingScheme
+ * object representing the added scheme. If the value of the name parameter
* corresponds to an already-registered rating scheme, this method returns a
- * reference to the existing ParentalRatingScheme object. If the newly
- * defined rating scheme was not known to the OITF, the scheme MAY be
- * stored persistently, and the OITF may offer a UI to set the parental
- * rating blocking criteria for the newly added parental rating scheme.
- * If the OITF has successfully stored (persistently or not persistently)
+ * reference to the existing ParentalRatingScheme object. If the newly
+ * defined rating scheme was not known to the OITF, the scheme MAY be
+ * stored persistently, and the OITF may offer a UI to set the parental
+ * rating blocking criteria for the newly added parental rating scheme.
+ * If the OITF has successfully stored (persistently or not persistently)
* the additional parental rating scheme, the method SHALL return a non-null
* ParentalRatingScheme object.
- *
+ *
* Arguments:
- * - name:
- * A unique string identifying the parental rating scheme to which
- * this value refers. See property name in section 7.9.1.1 for more
+ * - name:
+ * A unique string identifying the parental rating scheme to which
+ * this value refers. See property name in section 7.9.1.1 for more
* information about possible values.
- *
- * - values:
- * A comma-separated list of the possible values in the rating scheme, in
- * ascending order of severity. In case the rating scheme is one of the
- * [MPEG-7] rating classification schemes, this means that the list of
- * parental rating values contains the values as specified by the <Name>
- * elements of the <Term> elements in the order of appearance as they are
+ *
+ * - values:
+ * A comma-separated list of the possible values in the rating scheme, in
+ * ascending order of severity. In case the rating scheme is one of the
+ * [MPEG-7] rating classification schemes, this means that the list of
+ * parental rating values contains the values as specified by the <Name>
+ * elements of the <Term> elements in the order of appearance as they are
* defined for the classification scheme, with the exception of the Internet
- * Content Rating Association (ICRA) based ratings, for which the reverse
- * order has to be applied. The values must be ordered in such a way to allow the rating values to be compared in the manner as defined for property threshold for the respective parental rating system.
+ * Content Rating Association (ICRA) based ratings, for which the reverse
+ * order has to be applied. The values must be ordered in such a way to allow
+ * the rating values to be compared in the manner as defined for property threshold for
+ * the respective parental rating system.
*/
- addParentalRatingScheme: function(name, values) {
+ addParentalRatingScheme(name, values) {
var parentalRatingScheme = new ParentalRatingScheme(name, values);
this.push(parentalRatingScheme);
- },
-
+ }
+
/*
* Description:
- * This method returns a reference to the ParentalRatingScheme object that
- * is associated with the given scheme as specified through parameter
- * "name". If the value of name does not correspond to the name property of
- * any of the ParentalRatingScheme objects in
+ * This method returns a reference to the ParentalRatingScheme object that
+ * is associated with the given scheme as specified through parameter
+ * "name". If the value of name does not correspond to the name property of
+ * any of the ParentalRatingScheme objects in
* the ParentalRatingSchemeCollection, the method SHALL return undefined.
- *
+ *
* Arguments:
* - name:
* The unique name identifying a parental rating scheme.
*/
- getParentalRatingScheme: function(name) {
+ getParentalRatingScheme(name) {
for (var i = 0, li = this.length; i < li; i++) {
var currentParentalRatingScheme = this[i];
if (currentParentalRatingScheme.name == name) {
@@ -77,6 +79,4 @@
}
return undefined;
}
-});
-
-
+}
1
0
Author: ygrego
Date: 2015-06-09 15:19:17 +0000 (Tue, 09 Jun 2015)
New Revision: 1656
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1656
Log:
Transformation of each class in ES6 class.
Modified:
oipf/lib/js/impl/OipfObjectFactory.js
oipf/lib/js/impl/ParentalControlManagerObject.js
oipf/lib/js/impl/RecordingSchedulerObject.js
oipf/lib/js/impl/RemoteControlFunctionObject.js
oipf/lib/js/impl/RemoteManagementObject.js
oipf/lib/js/impl/SearchManagerObject.js
oipf/lib/js/impl/StatusViewObject.js
oipf/lib/js/impl/VideoBroadcastObject.js
oipf/lib/js/impl/VideoMpegObject.js
Modified: oipf/lib/js/impl/OipfObjectFactory.js
===================================================================
--- oipf/lib/js/impl/OipfObjectFactory.js 2015-06-09 15:07:19 UTC (rev 1655)
+++ oipf/lib/js/impl/OipfObjectFactory.js 2015-06-09 15:19:17 UTC (rev 1656)
@@ -1,37 +1,60 @@
-
-
/*!
* \class OipfObjectFactory
* \brief Provide access to components of a terminal supporting OIFP specification.
- */
-var OipfObjectFactory = Class.extend({
-
- _createDocument: function(filename, callbackName) {
- var self = this;
- if (window.XMLHttpRequest) {
- this.xmlHttpRequest = new XMLHttpRequest();
- this.xmlHttpRequest.open("GET", filename);
- this.xmlHttpRequest.send();
- this.xmlHttpRequest.onload = function() {
- if(this.status == 200 && this.responseXML != null) {
- var xmlToJson = new XmlToJson(this.responseXML);
- var jsonData = xmlToJson.getJson();
-
- self[callbackName].call(self, jsonData);
- console.log("A new doument has been created.");
- } else {
- console.log("An error occured during the document creation.");
- }
- };
- }
- },
-
- init: function() {
+ */
+class OipfObjectFactory {
+
+ constructor() {
console.log("[INFO] constructor of OipfObjectFactory class called.");
var modelFactory = new ModelFactory();
var dateUtils = new DateUtils();
- this._oipfConfiguration = new OipfConfiguration();
- this.applicationManagerObject =
+ this._oipfConfiguration = new OipfConfiguration();
+
+ /*The ChannelConfig class provides the entry point for applications to get information about the list of channels
+ * available. It can be obtained in two ways:
+ * -By calling the method getChannelConfig() of the video/broadcast embedded object as defined in
+ * section 7.13.1.3.
+ * -By calling the method createChannelConfig() of the object factory API as defined in section 7.1.1.
+ * The availability of the properties and methods are dependent on the capabilities description as specified in section 9.3.
+ * The following table provides a list of the capabilities and the associated properties and methods. If the capability is false
+ * the properties and methods SHALL NOT be available to the application. Properties and methods not listed in the
+ * following table SHALL be available to all applications as long as the OITF has indicated support for tuner control (i.e.
+ * <video_broadcast>true</video_broadcast> as defined in section 9.3.1) in their capability.
+ * ------------------------------------------------------------------------
+ * Capability | Properties | Methods
+ * --------------------------------- --------------- ----------------------
+ * Element <extendedAVControl> | onChannelScan | startScan()
+ * is set to “ true ” as defined in | | stopScan()
+ * section 9.3.6. | |
+ * --------------------------------- --------------- ----------------------
+ * Element <video_broadcast | |createChannelList()
+ * type="ID_IPTV_SDS"> is set as | |
+ * defined in section 9.3.6. | |
+ * ------------------------------------------------------------------------
+ */
+ this.channelConfig = null;
+
+ /*
+ * Description: Access to the functionality of the application/oipfRemoteManagement embedded object SHALL adhere to the
+ * security requirements as defined in section 10.
+ */
+ this.remoteManagementObject = null;
+
+
+ /*
+ * Description: OITFs SHALL implement the application/oipfSearchManager embedded object. This object provides a
+ * mechanism for applications to create and manage metadata searches.
+ */
+ this.searchManagerObject = null;
+
+ /*
+ * Description: An OITF SHALL support a non-visual embedded object of type “ application/oipfApplicationManager ”, with
+ * the following JavaScript API, to enable applications to access the privileged functionality related to application lifecycle
+ * and management that is provided by the application model defined in this section.
+ * If one of the methods on the application/oipfApplicationManager is called by a webpage that is not a
+ * privileged DAE application, the OITF SHALL throw an error as defined in section 10.1.1.
+ */
+ this.applicationManagerObject =
new ApplicationManagerObject(
this._oipfConfiguration.applicationVisualizationMode);
this.capabilitiesObject = new CapabilitiesObject(modelFactory);
@@ -53,80 +76,29 @@
//this.gatewayInfoObject= new GatewayInfoObject();
//this.remoteManagementObject = new RemoteManagementObject();
//this.remoteControlFunctionObject = new RemoteControlFunctionObject();
- },
-
- /*
- * Description: An OITF SHALL support a non-visual embedded object of type “ application/oipfApplicationManager ”, with
- * the following JavaScript API, to enable applications to access the privileged functionality related to application lifecycle
- * and management that is provided by the application model defined in this section.
- * If one of the methods on the application/oipfApplicationManager is called by a webpage that is not a
- * privileged DAE application, the OITF SHALL throw an error as defined in section 10.1.1.
- */
- applicationManagerObject: null,
-
- capabilitiesObject: null,
-
- codManagerObject: null,
-
- /*The ChannelConfig class provides the entry point for applications to get information about the list of channels
- * available. It can be obtained in two ways:
- * -By calling the method getChannelConfig() of the video/broadcast embedded object as defined in
- * section 7.13.1.3.
- * -By calling the method createChannelConfig() of the object factory API as defined in section 7.1.1.
- * The availability of the properties and methods are dependent on the capabilities description as specified in section 9.3.
- * The following table provides a list of the capabilities and the associated properties and methods. If the capability is false
- * the properties and methods SHALL NOT be available to the application. Properties and methods not listed in the
- * following table SHALL be available to all applications as long as the OITF has indicated support for tuner control (i.e.
- * <video_broadcast>true</video_broadcast> as defined in section 9.3.1) in their capability.
- * ------------------------------------------------------------------------
- * Capability | Properties | Methods
- * --------------------------------- --------------- ----------------------
- * Element <extendedAVControl> | onChannelScan | startScan()
- * is set to “ true ” as defined in | | stopScan()
- * section 9.3.6. | |
- * --------------------------------- --------------- ----------------------
- * Element <video_broadcast | |createChannelList()
- * type="ID_IPTV_SDS"> is set as | |
- * defined in section 9.3.6. | |
- * ------------------------------------------------------------------------
- */
- channelConfig: null,
-
- /*
- * Description: Access to the functionality of the application/oipfRemoteManagement embedded object SHALL adhere to the
- * security requirements as defined in section 10.
- */
- remoteManagementObject: null,
-
- remoteControlFunctionObject: null,
-
- imsObject : null,
-
- mdtfObject: null,
-
- notifSocketObject: null,
-
- parentalControlManagerObject: null,
-
- recordingSchedulerObject: null,
-
- configurationObject: null,
-
- downloadManagerObject: null,
-
- downloadTriggerObject: null,
-
- drmAgentObject: null,
-
- gatewayInfoObject: null,
-
- /*
- * Description: OITFs SHALL implement the application/oipfSearchManager embedded object. This object provides a
- * mechanism for applications to create and manage metadata searches.
- */
- searchManagerObject: null,
-
- /*
+ }
+
+ _createDocument(filename, callbackName) {
+ var self = this;
+ if (window.XMLHttpRequest) {
+ this.xmlHttpRequest = new XMLHttpRequest();
+ this.xmlHttpRequest.open("GET", filename);
+ this.xmlHttpRequest.send();
+ this.xmlHttpRequest.onload = function() {
+ if(this.status == 200 && this.responseXML != null) {
+ var xmlToJson = new XmlToJson(this.responseXML);
+ var jsonData = xmlToJson.getJson();
+
+ self[callbackName].call(self, jsonData);
+ console.log("A new doument has been created.");
+ } else {
+ console.log("An error occured during the document creation.");
+ }
+ };
+ }
+ }
+
+ /*
* Description:
* This method SHALL return true if and only if an object of the specified type is supported by
* the OITF, otherwise it SHALL return false.
@@ -146,17 +118,17 @@
* application/oipfCommunicationServices, application/oipfMDTF,
* application/oipfParentalControlManager, application/oipfRecordingScheduler,
* application/oipfRemoteControlFunction, application/oipfRemoteManagement
- *
+ *
*/
- isObjectSupported: function(mimeType) {
-
+ isObjectSupported(mimeType) {
+
var mimeType_method = {
"channelConfig" : true,
"application/notifsocket" : false,
"application/oipfApplicationManager" : true,
"application/oipfCapabilities" : true,
"application/oipfCodManager" : false,
- "application/oipfCommunicationServices" : false,
+ "application/oipfCommunicationServices" : false,
"application/oipfConfiguration" : true,
"application/oipfDownloadManager" : false,
"application/oipfDownloadTrigger" : false,
@@ -172,12 +144,12 @@
"video/broadcast" : true,
"video/mpeg" : false
};
-
+
return mimeType_method[mimeType];
- },
-
+ }
+
/*!
- * Description:
+ * Description:
* If the object type is supported, each of these methods shall return an instance of the
* corresponding embedded object.
* Since objects do not claim scarce resources when they are instantiated, instantiation shall
@@ -188,7 +160,7 @@
* to the specified object. The value of the type attribute of the HTMLObjectElement SHALL
* match the mimetype of the instantiated object, for example " video/broadcast " in case of
* method oipfObjectFactory.createVideoBroadcastObject() .
- *
+ *
* Arguments:
* -requiredCapabilities :
* An optional argument indicating the formats to be supported by
@@ -203,7 +175,7 @@
* so instantiation shall never fail if the object type is supported. The
* allocationMethod property SHALL be set to DYNAMIC_ALLOCATION .
*/
- createVideoBroadcastObject: function() {
+ createVideoBroadcastObject() {
console.log("[INFO] createVideoBroadcastObject() of OipfObjectFactory class called.");
if (this.isObjectSupported("video/broadcast")) {
@@ -211,9 +183,9 @@
} else {
throw new TypeError("This object type is not supported.");
}
-
- },
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -225,17 +197,17 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createSearchManagerObject: function() {
+ createSearchManagerObject() {
if (this.isObjectSupported(SEARCH_MANAGER_DAE_MIME_TYPE)) {
console.log("[INFO] createSearchManagerObject() of OipfObjectFactory class called.");
return this.searchManagerObject;
} else {
throw new TypeError("This object type is not supported.");
}
- },
-
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -247,17 +219,17 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createApplicationManagerObject: function() {
+ createApplicationManagerObject() {
if (this.isObjectSupported(APPLICATION_MANAGER_DAE_MIME_TYPE)) {
console.log("[INFO] createApplicationManagerObject() of OipfObjectFactory class called.");
return this.applicationManagerObject;
} else {
throw new TypeError("This object type is not supported.");
}
- },
-
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -269,17 +241,17 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createCapabilitiesObject: function() {
+ createCapabilitiesObject() {
if (this.isObjectSupported(CAPABILITIES_DAE_MIME_TYPE)) {
console.log("[INFO] createCapabilitiesObject() of OipfObjectFactory class called.");
return this.capabilitiesObject;
} else {
throw new TypeError("This object type is not supported.");
- }
- },
-
+ }
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -291,17 +263,17 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createChannelConfig: function() {
+ createChannelConfig() {
if (this.isObjectSupported(CHANNEL_CONFIG_TYPE)) {
console.log("[INFO] createChannelConfigObject() of OipfObjectFactory class called.");
return this.channelConfig;
} else {
throw new TypeError("This object type is not supported.");
- }
- },
-
+ }
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -313,17 +285,17 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createCodManagerObject: function() {
+ createCodManagerObject() {
if (this.isObjectSupported(COD_MANAGER_DAE_MIME_TYPE)) {
console.log("[INFO] createCodManagerObject() of OipfObjectFactory class called.");
return this.codManagerObject;
} else {
throw new TypeError("This object type is not supported.");
}
- },
-
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -335,17 +307,17 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createConfigurationObject: function() {
+ createConfigurationObject() {
if (this.isObjectSupported(CONFIGURATION_DAE_MIME_TYPE)) {
console.log("[INFO] createConfigurationObject() of OipfObjectFactory class called.");
return this.configurationObject;
} else {
throw new TypeError("This object type is not supported.");
- }
- },
-
+ }
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -357,17 +329,17 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createDownloadManagerObject: function() {
+ createDownloadManagerObject() {
if (this.isObjectSupported(DOWNLOAD_MANAGER_DAE_MIME_TYPE)) {
console.log("[INFO] createDownloadManagerObject() of OipfObjectFactory class called.");
return this.downloadManagerObject;
} else {
throw new TypeError("This object type is not supported.");
}
- },
-
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -379,17 +351,17 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createDownloadTriggerObject: function() {
+ createDownloadTriggerObject() {
if (this.isObjectSupported(DOWNLOAD_TRIGGER_DAE_MIME_TYPE)) {
console.log("[INFO] createDownloadTriggerObject() of OipfObjectFactory class called.");
return this.downloadTriggerObject;
} else {
throw new TypeError("This object type is not supported.");
}
- },
-
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -401,17 +373,17 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createDrmAgentObject: function() {
+ createDrmAgentObject() {
if (this.isObjectSupported(DRM_AGENT_DAE_MIME_TYPE)) {
console.log("[INFO] createDrmAgentObject() of OipfObjectFactory class called.");
return this.drmAgentObject;
} else {
throw new TypeError("This object type is not supported.");
}
- },
-
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -423,17 +395,17 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createGatewayInfoObject: function() {
+ createGatewayInfoObject() {
if (this.isObjectSupported(GATEWAY_INFO_DAE_MIME_TYPE)) {
console.log("[INFO] createGatewayInfoObject() of OipfObjectFactory class called.");
return this.gatewayInfoObject;
} else {
throw new TypeError("This object type is not supported.");
}
- },
-
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -445,17 +417,17 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createIMSObject: function() {
+ createIMSObject() {
if (this.isObjectSupported(COMMUNICATION_SERVICES_DAE_MIME_TYPE)) {
console.log("[INFO] createIMSObject() of OipfObjectFactory class called.");
return this.imsObject;
} else {
throw new TypeError("This object type is not supported.");
}
- },
-
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -467,17 +439,17 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createMDTFObject: function() {
+ createMDTFObject() {
if (this.isObjectSupported(MDTF_DAE_MIME_TYPE)) {
console.log("[INFO] createMDTFObject() of OipfObjectFactory class called.");
return this.mdtfObject;
} else {
throw new TypeError("This object type is not supported.");
}
- },
-
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -489,17 +461,17 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createNotifSocketObject: function() {
+ createNotifSocketObject() {
if (this.isObjectSupported(NOTIF_SOCKET_DAE_MIME_TYPE)) {
console.log("[INFO] createNotifSocketObject() of OipfObjectFactory class called.");
return this.notifSocketObject;
} else {
throw new TypeError("This object type is not supported.");
}
- },
-
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -511,17 +483,17 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createParentalControlManagerObject: function() {
- if (this.isObjectSupported(PARENTAL_CONTROL_MANAGER_DAE_MIME_TYPE)) {
+ createParentalControlManagerObject() {
+ if (this.isObjectSupported(PARENTAL_CONTROL_MANAGER_DAE_MIME_TYPE)) {
console.log("[INFO] createParentalControlManangerObject() of OipfObjectFactory class called.");
return this.parentalControlManagerObject;
} else {
throw new TypeError("This object type is not supported.");
}
- },
-
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -533,17 +505,17 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createRecordingSchedulerObject: function() {
+ createRecordingSchedulerObject() {
if (this.isObjectSupported(RECORDING_SCHEDULER_DAE_MIME_TYPE)) {
console.log("[INFO] createRecordingSchedulerObject() of OipfObjectFactory class called.");
return this.recordingSchedulerObject;
} else {
throw new TypeError("This object type is not supported.");
}
- },
-
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -555,17 +527,17 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createRemoteControlFunctionObject: function() {
+ createRemoteControlFunctionObject() {
if (this.isObjectSupported(REMOTE_CONTROL_FUNCTION_DAE_MIME_TYPE)) {
console.log("[INFO] createRemoteControlFunctionObject() of OipfObjectFactory class called.");
return this.remoteControlFunctionObject;
} else {
throw new TypeError("This object type is not supported.");
}
- },
-
+ }
+
/*
* Description
* If the object type is supported, each of these methods SHALL return an instance of the
@@ -577,19 +549,19 @@
* not supported, the OITF SHALL throw an error with the name property set to the value
* " TypeError ".
* If the object is supported, the method SHALL return a JavaScript Object which
- * implements the interface for the specified object.
+ * implements the interface for the specified object.
*/
- createRemoteManagementObject: function() {
+ createRemoteManagementObject() {
if (this.isObjectSupported(REMOTE_MANAGEMENT_DAE_MIME_TYPE)) {
console.log("[INFO] createRemoteManagementObject() of OipfObjectFactory class called.");
return this.remoteManagementObject;
} else {
throw new TypeError("This object type is not supported.");
}
- },
-
+ }
+
/*!
- * Description:
+ * Description:
* If the object type is supported, each of these methods shall return an instance of the
* corresponding embedded object.
* Since objects do not claim scarce resources when they are instantiated, instantiation shall
@@ -600,7 +572,7 @@
* to the specified object. The value of the type attribute of the HTMLObjectElement SHALL
* match the mimetype of the instantiated object, for example " video/broadcast " in case of
* method oipfObjectFactory.createVideoBroadcastObject() .
- *
+ *
* Arguments:
* -requiredCapabilities :
* An optional argument indicating the formats to be supported by
@@ -615,17 +587,17 @@
* so instantiation shall never fail if the object type is supported. The
* allocationMethod property SHALL be set to DYNAMIC_ALLOCATION .
*/
- createStatusViewObject: function() {
+ createStatusViewObject() {
if (this.isObjectSupported(STATUS_VIEW_DAE_MIME_TYPE)) {
console.log("[INFO] createStatusViewObject() of OipfObjectFactory class called.");
return new StatusViewObject();
} else {
throw new TypeError("This object type is not supported.");
}
- },
-
+ }
+
/*!
- * Description:
+ * Description:
* If the object type is supported, each of these methods shall return an instance of the
* corresponding embedded object.
* Since objects do not claim scarce resources when they are instantiated, instantiation shall
@@ -636,7 +608,7 @@
* to the specified object. The value of the type attribute of the HTMLObjectElement SHALL
* match the mimetype of the instantiated object, for example " video/broadcast " in case of
* method oipfObjectFactory.createVideoBroadcastObject() .
- *
+ *
* Arguments:
* -requiredCapabilities :
* An optional argument indicating the formats to be supported by
@@ -651,30 +623,30 @@
* so instantiation shall never fail if the object type is supported. The
* allocationMethod property SHALL be set to DYNAMIC_ALLOCATION .
*/
- createVideoMpegObject: function() {
+ createVideoMpegObject() {
if (this.isObjectSupported("video/mpeg")) {
console.log("[INFO] createVideoMpegObject() of OipfObjectFactory class called.");
return new VideoMpegObject();
} else {
throw new TypeError("This object type is not supported.");
}
- },
-
- _setChannelConfig: function(channelListJson) {
- this._channelService =
+ }
+
+ _setChannelConfig(channelListJson) {
+ this._channelService =
new ChannelService(this._oipfConfiguration.currentChannel,
this._oipfConfiguration.channelNumber,
this._oipfConfiguration.channelOrigin,
channelListJson.channelList.channel
);
this.channelConfig = new ChannelConfig(this._channelService);
- },
-
- _setSearchManagerObject: function(programmesJson) {
+ }
+
+ _setSearchManagerObject(programmesJson) {
var oipfProgrammes = new ProgrammeHelper(this._channelService)
.initProgrammes(programmesJson.tv.programme);
var programmeService = new ProgrammeService(oipfProgrammes);
- this.searchManagerObject =
+ this.searchManagerObject =
new SearchManagerObject(programmeService);
}
-});
+}
Modified: oipf/lib/js/impl/ParentalControlManagerObject.js
===================================================================
--- oipf/lib/js/impl/ParentalControlManagerObject.js 2015-06-09 15:07:19 UTC (rev 1655)
+++ oipf/lib/js/impl/ParentalControlManagerObject.js 2015-06-09 15:19:17 UTC (rev 1656)
@@ -1,88 +1,89 @@
-var ParentalControlManagerObject = Class.extend({
-
+class ParentalControlManagerObject {
+
/*
- * Descrioption:
- * A reference to the collection of rating schemes known by the OITF.
- *
- * Visibilty Type:readonly ParentalRatingSchemeCollection
+ * FIXME:
+ * -Yannis 18/05/2015 The properties "_currentPIN" and "_invalidPINAttemps"
+ * don't have to be innitialized here.
*/
- parentalRatingSchemes: null,
+ constructor() {
- /*
- * Description:
- * The lockout status of the parental control PIN. If the incorrect PIN has
- * been entered too many times in the configured timeout period, parental
- * control PIN entry SHALL be locked out for a period of time determined by
- * the OITF.
- *
- * Visibility Type: readonly Boolean
- */
- isPINEntryLocked: null,
-
- //The parental control PIN set.
- _currentPIN: null,
-
- //Indicate the number of invalid PIN attemps.
- _invalidPINAttemptsMax: null,
-
- //Contain the number of invalid entry PIN attempts.
- _currentInvalidPINAttempts: null,
-
- //When the PIN entry attempt has been reached this PIN entry must be locked.
- _PINLockedTime: null,
-
- /*
- * Let to manage the locking of programmes and/or channels which are
- * initially unrated.
- */
- _blockUnrated:null,
-
- /*
- * Represent a status indicating if a temporarily authorization for
- * the comsumption of any blocked content have been set or not.
- *
- */
- _parentalControlStatus:null,
-
- /*
- * FIXME:
- * -Yannis 18/05/2015 The properties "_currentPIN" and "_invalidPINAttemps"
- * don't have to be innitialized here.
- */
- init: function() {
+ /*
+ * Descrioption:
+ * A reference to the collection of rating schemes known by the OITF.
+ *
+ * Visibilty Type:readonly ParentalRatingSchemeCollection
+ */
+ this.parentalRatingSchemes = null;
+
+ /*
+ * Description:
+ * The lockout status of the parental control PIN. If the incorrect PIN has
+ * been entered too many times in the configured timeout period, parental
+ * control PIN entry SHALL be locked out for a period of time determined by
+ * the OITF.
+ *
+ * Visibility Type: readonly Boolean
+ */
+ this.isPINEntryLocked = null;
+
+ //The parental control PIN set.
+ this._currentPIN = null;
+
+ //Indicate the number of invalid PIN attemps.
+ this._invalidPINAttemptsMax = null;
+
+ //Contain the number of invalid entry PIN attempts.
+ this._currentInvalidPINAttempts = null;
+
+ //When the PIN entry attempt has been reached this PIN entry must be locked.
+ this._PINLockedTime = null;
+
+ /*
+ * Let to manage the locking of programmes and/or channels which are
+ * initially unrated.
+ */
+ this._blockUnrated = null;
+
+ /*
+ * Represent a status indicating if a temporarily authorization for
+ * the comsumption of any blocked content have been set or not.
+ *
+ */
+ this._parentalControlStatus = null;
+
this._timerManager = new TimerManager();
this._timeout = this._timerManager.createTimer.bind(this._timerManager, 0);
-
+
this.isPINEntryLocked = false;
this._blockUnrated = false;
this._parentalControlStatus = false;
-
+
this._currentPIN = "1234";
this._invalidPINAttemptsMax = 4;
this._currentInvalidPINAttempts = 0;
this._PINLockedTime = 2000;
-
+
this._PIN_CORRECT = parentalControlManagerConstants.pin.CORRECT;
this._PIN_INCORRECT = parentalControlManagerConstants.pin.INCORRECT;
this._PIN_LOCKED = parentalControlManagerConstants.pin.LOCKED;
- },
-
+ }
+
/*
- * As defined in [OIPF_CSP2], the OITF shall prevent the consumption of a
- * programme when its parental rating doesn't meet the parental rating
- * criterion currently defined in the OITF. Calling this method with enable
- * set to false will temporarily allow the consumption of any blocked
- * programme. Setting the parental control status using this method SHALL
+ * As defined in [OIPF_CSP2], the OITF shall prevent the consumption of a
+ * programme when its parental rating doesn't meet the parental rating
+ * criterion currently defined in the OITF. Calling this method with enable
+ * set to false will temporarily allow the consumption of any blocked
+ * programme. Setting the parental control status using this method SHALL
* set the status until the consumption of any of all the blocked programmes
- * terminates (e.g. until the content item being played is changed),
- * or another call to the setParentalControlStatus() method is made.
+ * terminates (e.g. until the content item being played is changed),
+ * or another call to the setParentalControlStatus() method is made.
* Setting the parental control status using this method has the following
- * effect; for the Programme and Channel objects as defined in sections
- * 7.16.2 and 7.13.11, the blocked property of a programme or channel SHALL
- * be set to true for programmes whose parental rating does not meet the
- * applicable parental rating criterion, but the locked property SHALL be
- * set to false .This operation to temporarily disable parental rating
- * control SHALL be protected by the parental control PIN (i.e. through the
+ * effect; for the Programme and Channel objects as defined in sections
+ * 7.16.2 and 7.13.11, the blocked property of a programme or channel SHALL
+ * be set to true for programmes whose parental rating does not meet the
+ * applicable parental rating criterion, but the locked property SHALL be
+ * set to false .This operation to temporarily disable parental rating
+ * control SHALL be protected by the parental control PIN (i.e. through the
* pcPIN argument). The return value indicates the success of the operation,
* and SHALL take one of the following values:
* ------------------------------------------------------------------------
@@ -92,24 +93,24 @@
* ------ -----------------------------------------------------------------
* 1 | The PIN is incorrect.
* ------ -----------------------------------------------------------------
- * 2 | PIN entry is locked because an invalid PIN has been entered too
- * | many times. The number of invalid PIN attempts before PIN entry
+ * 2 | PIN entry is locked because an invalid PIN has been entered too
+ * | many times. The number of invalid PIN attempts before PIN entry
* | is locked is outside the scope of this specification.
* ------ -----------------------------------------------------------------
- *
- * Arguments:
+ *
+ * Arguments:
* - pcPIN: The parental control PIN.
- *
+ *
* - enable: Flag indicating whether parental control should be enabled.
- *
+ *
* Return: Integer
- *
- * FIXME:
- * - Yannis 19/05/2015 The unblocking of programme should be done here or
- * outside of this method, if the second case is true,
+ *
+ * FIXME:
+ * - Yannis 19/05/2015 The unblocking of programme should be done here or
+ * outside of this method, if the second case is true,
* how notify the programme? Who have to achieve this notification?
*/
- setParentalControlStatus: function(pcPIN, enable) {
+ setParentalControlStatus(pcPIN, enable) {
if (this._currentPIN == pcPIN) {
this._parentalControlStatus = enable;
return this._PIN_CORRECT;
@@ -120,10 +121,10 @@
this._lockPINEntry();
return this._PIN_LOCKED;
}
-
+
return this._PIN_INCORRECT;
- },
-
+ }
+
/*
* Description:
* Set the parental control PIN. This operation SHALL be protected by the
@@ -137,52 +138,52 @@
* ------ -----------------------------------------------------------------
* 1 | The PIN is incorrect.
* ------ -----------------------------------------------------------------
- * 2 | PIN entry is locked because an invalid PIN has been entered too
- * | many times. The number of invalid PIN attempts before PIN entry
+ * 2 | PIN entry is locked because an invalid PIN has been entered too
+ * | many times. The number of invalid PIN attempts before PIN entry
* | is locked is outside the scope of this specification.
* ------ -----------------------------------------------------------------
- *
- * Arguments:
+ *
+ * Arguments:
* - oldPcPIN: The current parental control PIN.
* - newPcPIN: The new value for the parental control PIN.
- *
+ *
* Return: Integer
*/
- setParentalControlPIN: function(oldPcPIN, newPcPIN) {
-
+ setParentalControlPIN(oldPcPIN, newPcPIN) {
+
if (this._currentPIN == oldPcPIN) {
this._currentPIN = newPcPIN;
return this._PIN_CORRECT;
}
this._currentInvalidPINAttempts++;
-
+
if (this._currentInvalidPINAttempts > this._invalidPINAttemptsMax) {
this._lockPINEntry();
return this._PIN_LOCKED;
}
-
+
return this._PIN_INCORRECT;
-
- },
-
+
+ }
+
/*
* Description:
* Unlock the object specified by target for viewing if pcPIN contains the
- * correct parental control PIN.
- *
- * The object type of target can be one of the following:
- * -video/broadcast object, in which case the content being
- * presented through this object SHALL be unlocked until a new channel is
- * selected.
- * -A/V Control object, in which case the content being presented
- * through this object. SHALL be unlocked until a new item of content is
- * played using this object.
- *
- * Otherwise an Invalid Object error SHALL be returned.
- *
- * The return value indicates the success of the operation, and
+ * correct parental control PIN.
+ *
+ * The object type of target can be one of the following:
+ * -video/broadcast object, in which case the content being
+ * presented through this object SHALL be unlocked until a new channel is
+ * selected.
+ * -A/V Control object, in which case the content being presented
+ * through this object. SHALL be unlocked until a new item of content is
+ * played using this object.
+ *
+ * Otherwise an Invalid Object error SHALL be returned.
+ *
+ * The return value indicates the success of the operation, and
* SHALL take the following values:
- *
+ *
* ------------------------------------------------------------------------
* Value | Description
* ------ -----------------------------------------------------------------
@@ -190,44 +191,44 @@
* ------ -----------------------------------------------------------------
* 1 | The PIN is incorrect.
* ------ -----------------------------------------------------------------
- * 2 | PIN entry is locked because an invalid PIN has been entered too
- * | many times. The number of invalid PIN attempts before PIN entry
+ * 2 | PIN entry is locked because an invalid PIN has been entered too
+ * | many times. The number of invalid PIN attempts before PIN entry
* | is locked is outside the scope of this specification.
* ------ -----------------------------------------------------------------
- *
- * Arguments:
+ *
+ * Arguments:
* - pcPIN: The parental control PIN.
- *
+ *
* - target: The object to be unlocked.
*/
- unlockWithParentalControlPIN: function(pcPIN, target) {
-
- },
-
- verifyParentalControlPIN: function(pcPIN) {
+ unlockWithParentalControlPIN(pcPIN, target) {
+
+ }
+
+ verifyParentalControlPIN(pcPIN) {
if (this._currentPIN == pcPIN) {
return this._PIN_CORRECT;
}
this._currentInvalidPINAttempts++;
-
+
if (this._currentInvalidPINAttempts > this._invalidPINAttemptsMax) {
this._lockPINEntry();
return this._PIN_LOCKED;
}
-
+
return this._PIN_INCORRECT;
-
- },
-
+
+ }
+
/*
* Description:
* Set whether programmes for which no parental rating has been retrieved
* from the metadata client nor defined by the service provider should be
* blocked automatically by the terminal.
- *
+ *
* This operation SHALL be protected
* by the parental control PIN (if PIN entry is enabled).The return value
- * indicates the success of the operation, and SHALL take one of
+ * indicates the success of the operation, and SHALL take one of
* the following values:
* ------------------------------------------------------------------------
* Value | Description
@@ -236,18 +237,18 @@
* ------ -----------------------------------------------------------------
* 1 | The PIN is incorrect.
* ------ -----------------------------------------------------------------
- * 2 | PIN entry is locked because an invalid PIN has been entered too
- * | many times. The number of invalid PIN attempts before PIN entry
+ * 2 | PIN entry is locked because an invalid PIN has been entered too
+ * | many times. The number of invalid PIN attempts before PIN entry
* | is locked is outside the scope of this specification.
* ------ -----------------------------------------------------------------
- *
- * Arguments:
+ *
+ * Arguments:
* - pcPIN: The parental control PIN.
- *
+ *
* - block: Flag indicating whether programmes SHALL be blocked.
- *
+ *
*/
- setBlockUnrated: function(pcPIN, block) {
+ setBlockUnrated(pcPIN, block) {
if (this._currentPIN == pcPIN) {
this._blockUnrated = block;
return this._PIN_CORRECT;
@@ -258,45 +259,45 @@
this._lockPINEntry();
return this._PIN_LOCKED;
}
-
+
return this._PIN_INCORRECT;
- },
-
+ }
+
/*
- * Description:
+ * Description:
* Returns a flag indicating whether or not the OITF has been configured by
* the user to block content for which a parental rating is absent.
*/
- getBlockUnrated: function() {
+ getBlockUnrated() {
return this._blockUnrated;
- },
+ }
/*
- * Description:
- * Returns a flag indicating the temporary parental control status set by
- * setParentalControlStatus() . Note that the returned status covers
- * parental control functionality related to all rating schemes, not only
+ * Description:
+ * Returns a flag indicating the temporary parental control status set by
+ * setParentalControlStatus() . Note that the returned status covers
+ * parental control functionality related to all rating schemes, not only
* the rating scheme upon which the method is called.
*/
- getParentalControlStatus: function() {
+ getParentalControlStatus() {
return this._parentalControlStatus;
- },
-
- _lockPINEntry: function() {
+ }
+
+ _lockPINEntry() {
this.isPINEntryLocked = true;
-
+
//After a periode of time, the PIN entry will be unlocked.
this._timeout(this._PINLockedTime)
.then(this._setIsPINEntryLocked.bind(this, false));
- },
-
- _setIsPINEntryLocked: function(enable) {
+ }
+
+ _setIsPINEntryLocked(enable) {
this.isPINEntryLocked = enable;
this._currentInvalidPINAttempts = 0;
- },
-
- _setCurrentInvalidPINAttempts: function(value) {
+ }
+
+ _setCurrentInvalidPINAttempts(value) {
this._currentInvalidPINAttempts = value;
}
-});
\ No newline at end of file
+}
Modified: oipf/lib/js/impl/RecordingSchedulerObject.js
===================================================================
--- oipf/lib/js/impl/RecordingSchedulerObject.js 2015-06-09 15:07:19 UTC (rev 1655)
+++ oipf/lib/js/impl/RecordingSchedulerObject.js 2015-06-09 15:19:17 UTC (rev 1656)
@@ -1,32 +1,32 @@
-var RecordingSchedulerObject = Class.extend({
-
- /*
- * Description:
- * Provides a list of scheduled and recorded programmes in the system.
- * This property may only provide access to a subset of the full list
- * of recordings, as determined by the value of the manageRecordings
- * attribute of the <recording> element in the client capability
- * description (see section 9.3.3).
- *
- * Visibility Type: readonly ScheduledRecordingCollection
- */
- recordings: null,
-
- /*
- * Description:
- * Get information about the status of the local storage device.
- * The DiscInfo class is defined in section 7.16.4.
- *
- * Visibility Type: readonly ScheduledRecordingCollection
- */
- discInfo: null,
+class RecordingSchedulerObject {
/*
- * FIXME:
+ * FIXME:
* Yannis - 29/014/2015 - Use of a utils class in future to manage 'Date'
* object.
*/
- init: function(subConfiguration, modelFactory, dateUtils) {
+ constructor(subConfiguration, modelFactory, dateUtils) {
+ /*
+ * Description:
+ * Provides a list of scheduled and recorded programmes in the system.
+ * This property may only provide access to a subset of the full list
+ * of recordings, as determined by the value of the manageRecordings
+ * attribute of the <recording> element in the client capability
+ * description (see section 9.3.3).
+ *
+ * Visibility Type: readonly ScheduledRecordingCollection
+ */
+ this.recordings = null;
+
+ /*
+ * Description:
+ * Get information about the status of the local storage device.
+ * The DiscInfo class is defined in section 7.16.4.
+ *
+ * Visibility Type: readonly ScheduledRecordingCollection
+ */
+ this.discInfo = null;
+
this._dateUtils = dateUtils;
this._modelFactory = modelFactory;
this.SCHEDULED = recordingConstants.state.SCHEDULED;
@@ -36,7 +36,7 @@
this.UPDATED = recordingConstants.state.UPDATED;
this.BEFORE_STARTED = recordingConstants.state.BEFORE_STARTED;
this._subConfiguration = subConfiguration;
- this._eventManager = new EventManager();
+ this._eventManager = new EventManager();
this._timerManager = new TimerManager();
this._timeout = this._timerManager.createTimer.bind(this._timerManager);
this._timerManagerRecording = new TimerRecordingManager();
@@ -52,72 +52,71 @@
this._recordings = {};
this.recordings = new ScheduledRecordingCollection();
this.discInfo = null;
-
- },
-
+ }
+
/*
* Description:
*
- * FIXME:
+ * FIXME:
* Yannis - 27/04/2015 - Do verification on parameter
- * Yannis - 27/04/2015 - Verify pvr capability in order to manage
+ * Yannis - 27/04/2015 - Verify pvr capability in order to manage
* recordings to store them into properties "recordings".
- * Yannis - 27/04/2015 - Verify parental control settings about recording
+ * Yannis - 27/04/2015 - Verify parental control settings about recording
* right.
*
*/
- record: function() {
+ record() {
var parameters = arguments;
if (parameters.length == 1) {
var scheduledRecording = new ScheduledRecording(parameters[0]);
} else if (parameters.length == 4) {
scheduledRecording = new ScheduledRecording(parameters[0],
- parameters[1],
- parameters[2],
+ parameters[1],
+ parameters[2],
parameters[3]);
} else {
return null;
}
-
+
scheduledRecording.startPadding = this._subConfiguration.pvrStartPadding;
scheduledRecording.endPadding = this._subConfiguration.pvrEndPadding;
-
+
if (this._recordingConflict(scheduledRecording)) {
return null;
}
-
+
this._fireEventScheduled(scheduledRecording);
-
+
var recording = this._createRecording(scheduledRecording);
this._recordings[recording.id] = recording;
this.recordings.push(recording);
-
+
this._planifyStartRecording(recording)
.then(this._planifyEndRecording.bind(this, recording));
return recording;
- },
-
+ }
+
/*
* Description:
*
- * FIXME:
+ * FIXME:
* Yannis - 27/04/2015 - Do verification on parameters.
- * Yannis - 27/04/2015 - Verify pvr capability in order to know
+ * Yannis - 27/04/2015 - Verify pvr capability in order to know
* if this properties "recordings" can be used.
- * Yannis - 27/04/2015 - Verify parental control settings about recording
+ * Yannis - 27/04/2015 - Verify parental control settings about recording
* right.
*/
- recordAt: function(startTime, duration, repeatDays, channelID) {
+ recordAt(startTime, duration, repeatDays, channelID) {
this.record(startTime, duration, repeatDays, channelID);
- },
-
+ }
+
/*
- *
+ *
* @param {ScheduledRecording} recording
* @returns {undefined}
*/
- remove: function(recording) {
+ remove(recording) {
if (recording) {
this._timerManagerRecording.clearTimer(recording.id);
this.recordings.splice(this.recordings.indexOf(recording), 1);
@@ -129,191 +128,191 @@
return;
}
console.log("The recording can't be remove.");
- },
-
+ }
+
/*
* Description:
- * Returns a subset of all the recordings that are scheduled but which have
- * not yet started. The subset SHALL include only scheduled recordings that
- * were scheduled using a service from the same FQDN as the domain of the
+ * Returns a subset of all the recordings that are scheduled but which have
+ * not yet started. The subset SHALL include only scheduled recordings that
+ * were scheduled using a service from the same FQDN as the domain of the
* service that calls the method.
- *
+ *
* @returns { ScheduledRecordingCollection}
*/
- getScheduledRecordings: function() {
+ getScheduledRecordings() {
if (this.recordings) {
return this.recordings;
}
- },
-
+ }
+
/*
* Description:
- * Returns the channel line-up of the OITF in the form of a ChannelConfig
- * object as defined in section 7.13.9. The ChannelConfig object returned
- * from this function SHALL be identical to the ChannelConfig object
+ * Returns the channel line-up of the OITF in the form of a ChannelConfig
+ * object as defined in section 7.13.9. The ChannelConfig object returned
+ * from this function SHALL be identical to the ChannelConfig object
* returned from the getChannelConfig() method on the video/broadcast object
* as defined in section 7.13.1.3.
- *
+ *
* @returns {ChannelConfig}
*/
- getChannelConfig: function() {
+ getChannelConfig() {
return oipfObjectFactory.createChannelConfig();
- },
-
- createProgrammeObject: function() {
-
- },
+ }
+ createProgrammeObject() {
+
+ }
+
/*
* Description:
- * Returns the Recording object for which the value of the Recording.id
+ * Returns the Recording object for which the value of the Recording.id
* property corresponds to the given id parameter. If such a Recording does
* not exist, the method returns null.
- *
+ *
* Arguments:
* - id: Identifier corresponding to the id property of a Recording object.
- *
+ *
* @returns {Recording}
*/
- getRecording: function(id) {
+ getRecording(id) {
return this._recordings[id] || null;
- },
-
+ }
+
/*
* Description:
* Stop an in-progress recording. The recording SHALL NOT be deleted.
- *
+ *
* Arguments:
* - recording: The recording to be stopped.
- *
+ *
* @returns {undefined}
*/
- stop: function(recording) {
+ stop(recording) {
console.log("Method stop called");
if (recording && recording.state == this.STARTED) {
this._timerManagerRecording.clearTimer(recording.id);
return;
}
console.log("The recording can't be stop.");
- },
-
+ }
+
/*
* Description:
- * Update the recordings property to show the current status of all
+ * Update the recordings property to show the current status of all
* recordings.
- *
+ *
* @returns {undefined}
*/
- refresh: function() {
-
- },
-
+ refresh() {
+
+ }
+
/*
* Description:
- * For scheduled recordings the properties startTime, duration and
- * repeatDays can be modified. For ongoing recordings only the duration
- * property may be modified. This method SHALL return true if the operation
- * succeeded, or false if for any reason it rescheduling is not possible
+ * For scheduled recordings the properties startTime, duration and
+ * repeatDays can be modified. For ongoing recordings only the duration
+ * property may be modified. This method SHALL return true if the operation
+ * succeeded, or false if for any reason it rescheduling is not possible
* (e.g. the updated recording overlaps with another scheduled recording and
- * there are insufficient system resources to do both). If the method
+ * there are insufficient system resources to do both). If the method
* returns false then no changes SHALL be made to the recording.
- *
+ *
* Arguments:
* - id: The id of the recording to update.
- * - startTime: The new start time of the recording, or undefined if the
+ * - startTime: The new start time of the recording, or undefined if the
* start time is not to be updated.
- * - duration: The new duration of the recording, or undefined if the
+ * - duration: The new duration of the recording, or undefined if the
* duration is not to be updated.
- * - repeatDays: The new set of days on which the recording is to be
+ * - repeatDays: The new set of days on which the recording is to be
* repeated, or undefined if this is not to be updated.
- *
+ *
* @returns {undefined}
*/
- update: function(id, startTime, duration, repeatDays) {
+ update(id, startTime, duration, repeatDays) {
var recording = this._recordings[id];
-
+
if (!recording) {
return false;
}
-
+
if (recording.state == this.STARTED) {
if (duration) {
return this._updateDuration(id, duration);
}
-
+
} else if (recording.state == this.SCHEDULED) {
startTime && recording._setStartTime(startTime);
duration && recording._setDuration(duration);
repeatDays && (recording.repeatDays = repeatDays);
-
+
}
-
+
return false;
- },
-
+ }
+
get onPVREvent() {
return this._getCallback("PVREvent");
- },
+ }
set onPVREvent(callback) {
this._setCallback("PVREvent", callback);
- },
-
- _getCallback : function(type) {
+ }
+
+ _getCallback (type) {
if(this._callbacks) {
return this._callbacks[type];
}
- },
-
- _setCallback: function(type, callback) {
+ }
+
+ _setCallback(type, callback) {
if(this._callbacks) {
this._callbacks[type] = callback;
}
- },
-
- addEventListener: function(type, listener) {
+ }
+
+ addEventListener(type, listener) {
this._eventManager.addEventListener(type, listener, this);
- },
-
- _fireEvent: function(state, recording) {
+ }
+
+ _fireEvent(state, recording) {
var event = createCustomEvent("PVREvent", [state, recording]);
this._eventManager.fireEvent(event, this);
- },
-
- _fireEventScheduled: function(recording) {
+ }
+
+ _fireEventScheduled(recording) {
this._fireEvent(this.SCHEDULED, recording);
- },
-
- _fireEventBeforeStarted: function(recording) {
+ }
+
+ _fireEventBeforeStarted(recording) {
this._fireEvent(this.BEFORE_STARTED, recording);
- },
-
- _fireEventStarted: function(recording) {
+ }
+
+ _fireEventStarted(recording) {
this._fireEvent(this.STARTED, recording);
- },
+ }
- _fireEventCompleted: function(recording) {
+ _fireEventCompleted(recording) {
this._fireEvent(this.COMPLETED, recording);
- },
-
- _fireEventUpdated: function(recording) {
+ }
+
+ _fireEventUpdated(recording) {
this._fireEvent(this.UPDATED, recording);
- },
-
- _fireEventRemoved: function(recording) {
+ }
+
+ _fireEventRemoved(recording) {
this._fireEvent(this.REMOVED, recording);
- },
-
- removeEventListener: function(type, listener) {
+ }
+
+ removeEventListener(type, listener) {
this._eventManager.removeEventListener(type, listener, this);
- },
-
- _recordingConflict: function(recording) {
-
+ }
+
+ _recordingConflict(recording) {
+
if (this._isProgrammeFinished(recording)) {
return true;
}
-
+
for (var i = 0, l = this.recordings.length; i < l; i++) {
var startPadding = this.recordings[i].startPadding;
@@ -321,135 +320,135 @@
var currentStartTime = this.recordings[i].startTime + startPadding;
var currentDuration = this.recordings[i].duration + endPadding;
var currentStopTime = currentStartTime + currentDuration;
-
+
var recordingStartTime = recording.startTime + recording.startPadding;
- var recordingStopTime = recordingStartTime + recording.duration
+ var recordingStopTime = recordingStartTime + recording.duration
+ recording.endPadding;
-
+
/*
* First, verify that two recordings won't schedules at same time.
* Second, verify that two recordings don't overlap.
*/
- if (currentStartTime == recordingStartTime ||
+ if (currentStartTime == recordingStartTime ||
(recordingStartTime >= currentStartTime &&
recordingStartTime <= currentStopTime) ||
(recordingStopTime >= currentStartTime &&
recordingStopTime <= currentStopTime)) {
-
+
return true;
}
}
return false;
- },
-
- _createRecording: function(recording) {
+ }
+
+ _createRecording(recording) {
return new Recording(recording);
- },
-
+ }
+
/*
- * FIXME:
- * Yannis - 29/04/2015 - Management of negative padding.
- * Yannis - 29/04/2015 - Modify recordingStartTime of concerned recording.
+ * FIXME:
+ * Yannis - 29/04/2015 - Management of negative padding.
+ * Yannis - 29/04/2015 - Modify recordingStartTime of concerned recording.
*/
- _planifyStartRecording: function(recording) {
+ _planifyStartRecording(recording) {
if(this._isProgrammeStarted(recording)) {
-
+
var timer = this._dispatchBeforeStartedEventAndStartedEvent(null, recording);
console.log("The recording start now because the programme already had started.");
-
+
} else {
-
+
var timeToStart = this._getDurationFromNowToSpecificTime(recording.startTime +
recording.startPadding);
-
- console.log("The recording will start in",
+
+ console.log("The recording will start in",
this._dateUtils.secondsToMinutes(timeToStart), "minutes.");
-
+
this._dispatchBeforeStartedEventAndStartedEvent(
this._dateUtils.secondsToMilliseconds(timeToStart),
recording);
-
+
}
-
+
this._timerManagerRecording
- .recordingTimers[recording.id] = {
+ .recordingTimers[recording.id] = {
"start": timer,
"end": null
};
-
+
return timer;
- },
-
+ }
+
/*
- * FIXME:
- * Yannis - 29/04/2015 - Managing of negative padding.
- * Yannis - 29/04/2015 - Modify recordingEndTime of concerned recording.
+ * FIXME:
+ * Yannis - 29/04/2015 - Managing of negative padding.
+ * Yannis - 29/04/2015 - Modify recordingEndTime of concerned recording.
*/
- _planifyEndRecording: function(recording) {
+ _planifyEndRecording(recording) {
var timeToEnd = this._getDurationFromNowToSpecificTime(recording.startTime +
recording.duration + recording.endPadding);
-
+
var timer = this._timeoutRecording(this._dateUtils.secondsToMilliseconds(timeToEnd))
.then(recording._setState.bind(recording, this.COMPLETED))
.then(this._fireEventCompleted.bind(this, recording));
-
+
console.log("The recording will end in",
this._dateUtils.secondsToMinutes(timeToEnd),
"minutes after its starting.");
this._timerManagerRecording
.recordingTimers[recording.id].end = timer;
-
+
return timer;
- },
-
- _isProgrammeStarted: function(recording) {
+ }
+
+ _isProgrammeStarted(recording) {
var startTime = recording.startTime;
var endTime = startTime + recording.duration;
-
+
var currentTime = this._dateUtils.nowInSeconds();
-
+
return (currentTime >= startTime && currentTime <= endTime);
- },
-
+ }
+
/*
* Description :
* Avoid schedule recording whose the programme already has been broadcasted.
- *
+ *
* Return: Boolean
*/
- _isProgrammeFinished: function(recording) {
+ _isProgrammeFinished(recording) {
var startTime = recording.startTime;
var endTime = startTime + recording.duration;
-
+
var currentTime = this._dateUtils.nowInSeconds();
-
+
return (endTime <= currentTime);
- },
-
- _getDurationFromNowToSpecificTime: function(time) {
+ }
+
+ _getDurationFromNowToSpecificTime(time) {
return time - this._dateUtils.nowInSeconds();
- },
-
- _updateDuration: function(id, duration) {
+ }
+
+ _updateDuration(id, duration) {
console.log("Try updating duration");
var recording = this._recordings[id];
-
+
if (!recording) {
return false;
}
-
+
var newStopTime = recording.startTime + duration + recording.endPadding;
-
+
if (newStopTime <= this._dateUtils.nowInSeconds()) {
return false;
}
-
+
var recordings = this.recordings.filter(function(recording) {
return recording.id != id;
});
-
-
+
+
for (var i = 0, l = recordings.length; i < l; i++) {
var startPadding = recordings[i].startPadding;
var endPadding = recordings[i].endPadding;
@@ -462,105 +461,105 @@
* Second, verify that two recordings don't overlap.
*/
if (newStopTime >= currentStartTime) {
-
+
return false;
}
}
recording._setDuration(duration);
-
+
this._timerManagerRecording.clearTimer(recording.id);
-
+
this._planifyEndRecording(recording);
-
+
return true;
-
- },
-
- _updateFields: function(id, startTime, duration, repeatDays) {
+
+ }
+
+ _updateFields(id, startTime, duration, repeatDays) {
console.log("Try updating duration");
var recording = this._recordings[id];
-
+
if (!recording || (!startTime && !duration && !repeatDays)) {
return false;
}
-
+
if (startTime) {
var recordingStartTime = startTime + recording.startPadding;
- var recordingStopTime = recordingStartTime + recording.duration
+ var recordingStopTime = recordingStartTime + recording.duration
+ recording.endPadding;
}
-
+
if (duration && startTime) {
- var recordingStopTime = recordingStartTime + duration
+ var recordingStopTime = recordingStartTime + duration
+ recording.endPadding;
} else if (duration && !startTime) {
- var recordingStopTime = recording.startTime + recording.duration
+ var recordingStopTime = recording.startTime + recording.duration
+ recording.endPadding;
}
-
+
if (recordingStartTime <= this._dateUtils.nowInSeconds() ||
recordingStopTime <= this._dateUtils.nowInSeconds()) {
return false;
}
-
+
var recordings = this.recordings.filter(function(recording) {
return recording.id != id;
});
-
+
for (var i = 0, l = recordings.length; i < l; i++) {
var startPadding = recordings[i].startPadding;
var endPadding = recordings[i].endPadding;
var currentStartTime = recordings[i].startTime + startPadding;
var currentDuration = recordings[i].duration + endPadding;
var currentStopTime = currentStartTime + currentDuration;
-
+
/*
* First, verify that two recordings won't schedules at same time.
* Second, verify that two recordings don't overlap.
*/
- if (recordingStartTime == currentStartTime ||
+ if (recordingStartTime == currentStartTime ||
(recordingStartTime >= currentStartTime &&
recordingStartTime <= currentStopTime) ||
(recordingStopTime >= currentStartTime &&
recordingStopTime <= currentStopTime)) {
-
+
return false;
}
}
-
+
repeatDays && recording._setRepeatDays(repeatDays);
-
+
if (startTime) {
this._timerManagerRecording.clearTimer(recording.id);
startTime && recording._setStartTime(startTime);
this._planifyStartRecording(recording)
.then(this._planifyEndRecording.bind(this, recording));
-
+
this._timeoutRecording()
.then(this._fireEventUpdated.bind(this, recording));
-
+
return true;
-
+
}
-
+
if (duration) {
this._timerManagerRecording.clearTimer(recording.id);
duration && recording._setDuration(duration);
-
+
this._planifyEndRecording(recording);
-
+
this._timeoutRecording()
.then(this._fireEventUpdated.bind(this, recording));
-
+
return true;
-
+
}
-
+
return false;
- },
-
- _dispatchBeforeStartedEventAndStartedEvent: function(timer, recording) {
+ }
+
+ _dispatchBeforeStartedEventAndStartedEvent(timer, recording) {
return this._timeoutRecording(timer)
.then(recording._setState.bind(recording,
this.BEFORE_STARTED))
@@ -569,5 +568,5 @@
this.STARTED))
.then(this._fireEventStarted.bind(this, recording));
}
-
-});
\ No newline at end of file
+
+}
Modified: oipf/lib/js/impl/RemoteControlFunctionObject.js
===================================================================
--- oipf/lib/js/impl/RemoteControlFunctionObject.js 2015-06-09 15:07:19 UTC (rev 1655)
+++ oipf/lib/js/impl/RemoteControlFunctionObject.js 2015-06-09 15:19:17 UTC (rev 1656)
@@ -1,7 +1,6 @@
-var RemoteControlFunctionObject = Class.extend({
+class RemoteControlFunctionObject {
- init : function(){
-
+ constructor() {
}
-});
\ No newline at end of file
+}
Modified: oipf/lib/js/impl/RemoteManagementObject.js
===================================================================
--- oipf/lib/js/impl/RemoteManagementObject.js 2015-06-09 15:07:19 UTC (rev 1655)
+++ oipf/lib/js/impl/RemoteManagementObject.js 2015-06-09 15:19:17 UTC (rev 1656)
@@ -1,11 +1,10 @@
/*
* Description: Access to the functionality of the application/oipfRemoteManagement embedded object SHALL adhere to the
* security requirements as defined in section 10.
- */
-var RemoteManagementObject = Class.extend({
+ */
+class RemoteManagementObject {
- init : function(){
-
+ constructor() {
}
-});
\ No newline at end of file
+}
Modified: oipf/lib/js/impl/SearchManagerObject.js
===================================================================
--- oipf/lib/js/impl/SearchManagerObject.js 2015-06-09 15:07:19 UTC (rev 1655)
+++ oipf/lib/js/impl/SearchManagerObject.js 2015-06-09 15:19:17 UTC (rev 1656)
@@ -2,8 +2,16 @@
* Description: OITFs SHALL implement the application/oipfSearchManager embedded object. This object provides a
* mechanism for applications to create and manage metadata searches.
*/
-var SearchManagerObject = Class.extend({
-
+class SearchManagerObject {
+
+ constructor(programmeService) {
+ this._programmeService = programmeService;
+ this._listeners = {};
+ this._callbacks = {};
+ this._eventManager = new EventManager();
+ this._metadata = this._programmeService.programmes;
+ }
+
/*
* Description:
* This function is the DOM 0 event handler for events indicating changes in metadata. This SHALL be raised
@@ -18,22 +26,22 @@
*
*
* The specified function is called with the arguments action, info and object. These arguments are defined as follows:
- *
+ *
* • Integer action – the type of update that has taken place. This field will take one of the following values:
* ---------------------------------------------------------------------------------------------------------------------------------------------------------------
* Value | Description
* ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
- * 1 | A new version of metadata is available (see section 4.1.2.1.2 of [OIPF_META2]) and applications SHOULD discard all references to
- * | Programme objects immediately and re-acquire them.
+ * 1 | A new version of metadata is available (see section 4.1.2.1.2 of [OIPF_META2]) and applications SHOULD discard all references to
+ * | Programme objects immediately and re-acquire them.
* ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
- * 2 | A change to the parental control flags for a content item has occurred (e.g. the user has unlocked the parental control features of the receiver,
- * | allowing a blocked item to be played).
+ * 2 | A change to the parental control flags for a content item has occurred (e.g. the user has unlocked the parental control features of the receiver,
+ * | allowing a blocked item to be played).
* ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
* 3 | A flag affecting the filtering criteria of a channel has changed. Applications MAY listen for events with this action code to update lists of favourite
* | channels, for instance.
* ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
*
- * • Integer info – extended information about the type of update that has taken place.
+ * • Integer info – extended information about the type of update that has taken place.
* If the action argument is set to the value 3, the value of this field SHALL be one or more of the following:
* -----------------------------------------------------------------
* Value | Description
@@ -57,11 +65,17 @@
* • Object object – the affected channel, programme, or CoD asset prior to the change. If more than
* one is affected, then this argument SHALL take the value null.
*/
- onMetadataUpdate: null,
-
+ get onMetadataUpdate() {
+ return this._getCallback("MetadataUpdate");
+ }
+
+ set onMetadataUpdate(callback) {
+ this._setCallback("MetadataUpdate", callback);
+ }
+
/*
* Description:
- * This function is the DOM 0 event handler for events relating to metadata searches. The specified function is called with the arguments search and state.
+ * This function is the DOM 0 event handler for events relating to metadata searches. The specified function is called with the arguments search and state.
* These arguments are defined as follows:
* • MetadataSearch search – the affected search
*
@@ -69,49 +83,40 @@
* ---------------------------------------------------------------------------------------------------------------------------------------------------------------
* Value | Description
* ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
- * 0 | Search has finished. This event SHALL be generated when a search has completed.
+ * 0 | Search has finished. This event SHALL be generated when a search has completed.
* ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
* 1 | This value is not used.
* ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
* 2 | This value is not used.
* ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
* 3 | The MetadataSearch object has returned to the idle state, either because of a call to SearchResults.abort() or because the parameters for the search
- * | have been modified (e.g. the query, constraints or search target).
+ * | have been modified (e.g. the query, constraints or search target).
* ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
* 4 | The search cannot be completed due to a lack of resources or any other reason (e.g. insufficient memory is available to cache all of the requested
* | results).
- * ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
- */
+ * ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
+ */
get onMetadataSearch() {
return this._getCallback("MetadataSearch");
- },
-
+ }
+
set onMetadataSearch(callback) {
this._setCallback("MetadataSearch", callback);
- },
-
- _getCallback : function(type) {
- if(this._callbacks) {
+ }
+
+ _getCallback(type) {
+ if (this._callbacks) {
return this._callbacks[type];
}
- },
-
- _setCallback: function(type, callback){
- if(this._callbacks) {
+ }
+
+ _setCallback(type, callback) {
+ if (this._callbacks) {
this._callbacks[type] = callback;
}
- },
-
- _metadata: null,
-
- init: function(programmeService) {
- this._programmeService = programmeService;
- this._listeners = {};
- this._callbacks = {};
- this._eventManager = new EventManager();
- this._metadata = this._programmeService.programmes;
- },
-
+ }
+
+
/*
* Description :
* Create a MetadataSearch object that can be used to search the metadata.
@@ -131,13 +136,13 @@
*
* Return MetadataSearch
*/
- createSearch: function(searchTarget) {
-
+ createSearch(searchTarget) {
+
if (searchTarget === 2 || searchTarget === 1) {
return new MetadataSearch(searchTarget, this);
}
- },
-
+ }
+
/*
* Description :
* Create a MetadataSearch object that can be used to search the metadata.
@@ -149,33 +154,34 @@
*
* Return MetadataSearch
*/
- getChannelConfig: function() {
+ getChannelConfig() {
return oipfObjectFactory.createChannelConfig();
- },
-
- addEventListener: function(type, listener) {
+ }
+
+ addEventListener(type, listener) {
this._eventManager.addEventListener(type, listener, this);
- },
-
- _fireEvent: function(state, search) {
- var event = createCustomEvent("MetadataSearch", [search, state]);
+ }
+
+ _fireEvent(state, search) {
+ var event =
+ this._eventManager.createCustomEvent("MetadataSearch", [search, state]);
this._eventManager.fireEvent(event, this);
- },
-
- _fireEventFinished: function(search) {
+ }
+
+ _fireEventFinished(search) {
this._fireEvent(metadataSearchConstants.state.FINISHED, search);
- },
-
- _fireEventModified: function(search) {
+ }
+
+ _fireEventModified(search) {
this._fireEvent(metadataSearchConstants.state.MODIFIED, search);
- },
+ }
- _fireEventUncompleted: function(search) {
+ _fireEventUncompleted(search) {
this._fireEvent(metadataSearchConstants.state.UNCOMPLETED, search);
- },
-
- removeEventListener: function(type, listener) {
+ }
+
+ removeEventListener(type, listener) {
this._eventManager.removeEventListener(type, listener, this);
}
-});
+}
Modified: oipf/lib/js/impl/StatusViewObject.js
===================================================================
--- oipf/lib/js/impl/StatusViewObject.js 2015-06-09 15:07:19 UTC (rev 1655)
+++ oipf/lib/js/impl/StatusViewObject.js 2015-06-09 15:19:17 UTC (rev 1656)
@@ -1,7 +1,6 @@
-var StatusViewObject = Class.extend({
+class StatusViewObject {
- init: function() {
-
+ constructor() {
}
-});
\ No newline at end of file
+}
Modified: oipf/lib/js/impl/VideoBroadcastObject.js
===================================================================
--- oipf/lib/js/impl/VideoBroadcastObject.js 2015-06-09 15:07:19 UTC (rev 1655)
+++ oipf/lib/js/impl/VideoBroadcastObject.js 2015-06-09 15:19:17 UTC (rev 1656)
@@ -1,5 +1,5 @@
/*
- * Description:
+ * Description:
* If the object type is supported, this method shall return an instance of the
* corresponding embedded object.
* Since objects do not claim scarce resources when they are instantiated, instantiation shall
@@ -10,7 +10,7 @@
* to the specified object. The value of the type attribute of the HTMLObjectElement SHALL
* match the mimetype of the instantiated object, for example " video/broadcast " in case of
* method oipfObjectFactory.createVideoBroadcastObject() .
- *
+ *
* Arguments:
* -requiredCapabilities :
* An optional argument indicating the formats to be supported by
@@ -25,137 +25,139 @@
* so instantiation shall never fail if the object type is supported. The
* allocationMethod property SHALL be set to DYNAMIC_ALLOCATION .
*/
-var VideoBroadcastObject = Class.extend({
-
- _UNREALIZED: 0,
-
- _CONNECTING: 1,
-
- _PRESENTING: 2,
-
- _STOPPED: 3,
-
- /*
- * Description:
- * The width of the area used for rendering the video object. This property is only writable if property
- * fullScreen has value false . Changing the width property corresponds to changing the width property
- * through the HTMLObjectElement interface, and must have the same effect as changing the width through
- * the DOM Level 2 Style interfaces (i.e. CSS2Properties interface style.width ), at least for values
- * specified in pixels.
- */
- width: null,
- /*
- * Description:
- * The height of the area used for rendering the video object. This property is only writable if property
- * fullScreen has value false . Changing the height property corresponds to changing the height property
- * through the HTMLObjectElement interface, and must have the same effect as changing the height through
- * the DOM Level 2 Style interfaces (i.e. CSS2Properties interface style.height ), at least for values
- * specified in pixels.
- */
- heigth: null,
-
- /*
- * Description:
- * Returns true if this video object is in full-screen mode, false otherwise. The default value is false .
- * Visibilité Type: readonly Boolean
- */
- fullScreen: null,
-
- /*
- * Description:
- * Setting the value of the data property SHALL have no effect on the video/broadcast object. If this property
- * is read, the value returned SHALL always be the empty string.
- * Type: String
- */
- data: null,
-
- /*!
- * Description:
- * Visibility Type: readonly Integer
- * The current play state of the video/broadcast object. Valid values are:
- * ---------------------------------------------------------------------------------------------------------------------------------------------------------------
- * Value | Description
- * ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
- * 0 | unrealized; the application has not made a request to start presenting a channel or has stopped presenting a channel and released any resources. The
- * | content of the video/broadcast object should be transparent but if not shall be an opaque black rectangle. Control of media presentation is under the * | control of the OITF, as defined in section H.2.
- * ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
- * 1 | connecting; the terminal is connecting to the media source in order to begin playback. Objects in this state may be buffering data in order to start
- * | playback. Control of media the control of the OITF, as defined in section H.2. The content of the video/broadcast object is implementation dependent.
- * ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
- * 2 | presenting; the media is currently being presented to the user. The object is in this state regardless of whether the media is playing at normal speed,
- * | paused, or playing in a trick mode (e.g. at a speed other than normal speed). Control of media presentation is under the control of the application,
- * | as defined in section H.2. The video/broadcast object contains the video being presented.
- * ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
- * 3 | stopped; the terminal is not presenting media, either inside the video/broadcast object or in the logical video plane. The logical video plane is
- * | disabled. The content of the video/broadcast object SHALL be an opaque black rectangle. Control of media presentation is under the control of the
- * | application, as defined in section H.2
- * ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
- * See section 7.13.1.1 for a description of the state model for a video/broadcast object.
- * NOTE: Implementations where the content of the video/broadcast object is transparent in the unrealized state will give a better user experience than
- * ones where it is black. This happens for an application with video in the background between when it includes a video/broadcast object in the page and when a
- * call to bindToCurrentChannel() completes. Applications which do not need to call bindToCurrentChannel() should not do so. The current channel can
- * be obtained from the currentChannel property on the ApplicationPrivateData object which is the same as that on the video/broadcast object under most normal * conditions.
- */
- playState: null,
-
- /*
- * Description:
- * The list of media formats that are supported by the object. Each item SHALL contain a format label according
- * to [OIPF_MEDIA2].
- * If scarce resources are not claimed by the object, the value of this property SHALL be null.
- *
- * Visibilité Type: readonly StringCollection
- */
- playerCapabilities: null,
-
- /*
- * Description:
- * Returns the resource allocation method currently in use by the object. Valid values as defined in section 7.14.13.1 are:
- * to [OIPF_MEDIA2].
- * • STATIC_ALLOCATION
- * • DYNAMIC_ALLOCATION
- *
- * Visibilité Type: readonly Integer
- */
- allocationMethod: null,
-
- /*
- * Description:
- * The channel currently being presented by this embedded object if the user has given permission to share this
- * information, possibly through a mechanism outside the scope of this specification. If no channel is being
- * presented, or if this information is not visible to the caller, the value of this property SHALL be null.
- * The value of this property is not affected during timeshift operations and SHALL reflect the value prior to the
- * start of a timeshift operation, for both local and network timeshift resources.
- *
- * Extensions to video/broadcast for current channel information:
- * If an OITF has indicated support for extended tuner control (i.e. by giving value true to element
- * <extendedAVControl> as specified in section 9.3.6 in its capability description), the OITF SHALL support the
- * following additional properties and methods on the video/broadcast object.
- * The functionality as described in this section is subject to the security model of section 10.1.3.8.
- * Note the property onChannelScan and methods startScan and stopScan have been moved to section 7.13.9.
- *
- * Visibility Type: readonly Channel
- */
- currentChannel: null,
-
- createdCallback: function() {
- console.log("[INFO] createdCallback called.");
- this.init();
- },
-
- init: function () {
+class VideoBroadcastObject {
+
+ constructor() {
console.log("[INFO] constructor of VideoBroadcast class called.");
+
+ this._UNREALIZED = 0;
+
+ this._CONNECTING = 1;
+
+ this._PRESENTING = 2;
+
+ this._STOPPED = 3;
+
+ /*
+ * Description:
+ * The width of the area used for rendering the video object. This property is only writable if property
+ * fullScreen has value false . Changing the width property corresponds to changing the width property
+ * through the HTMLObjectElement interface, and must have the same effect as changing the width through
+ * the DOM Level 2 Style interfaces (i.e. CSS2Properties interface style.width ), at least for values
+ * specified in pixels.
+ */
+ this.width = null;
+ /*
+ * Description:
+ * The height of the area used for rendering the video object. This property is only writable if property
+ * fullScreen has value false . Changing the height property corresponds to changing the height property
+ * through the HTMLObjectElement interface, and must have the same effect as changing the height through
+ * the DOM Level 2 Style interfaces (i.e. CSS2Properties interface style.height ), at least for values
+ * specified in pixels.
+ */
+ this.heigth = null;
+
+ /*
+ * Description:
+ * Returns true if this video object is in full-screen mode, false otherwise. The default value is false .
+ * Visibilité Type: readonly Boolean
+ */
+ this.fullScreen = null;
+
+ /*
+ * Description:
+ * Setting the value of the data property SHALL have no effect on the video/broadcast object. If this property
+ * is read, the value returned SHALL always be the empty string.
+ * Type: String
+ */
+ this.data = null;
+
+ /*!
+ * Description:
+ * Visibility Type: readonly Integer
+ * The current play state of the video/broadcast object. Valid values are:
+ * ---------------------------------------------------------------------------------------------------------------------------------------------------------------
+ * Value | Description
+ * ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
+ * 0 | unrealized; the application has not made a request to start presenting a channel or has stopped presenting a channel and released any resources. The
+ * | content of the video/broadcast object should be transparent but if not shall be an opaque black rectangle. Control of media presentation is under the * | control of the OITF, as defined in section H.2.
+ * ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
+ * 1 | connecting; the terminal is connecting to the media source in order to begin playback. Objects in this state may be buffering data in order to start
+ * | playback. Control of media the control of the OITF, as defined in section H.2. The content of the video/broadcast object is implementation dependent.
+ * ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
+ * 2 | presenting; the media is currently being presented to the user. The object is in this state regardless of whether the media is playing at normal speed,
+ * | paused, or playing in a trick mode (e.g. at a speed other than normal speed). Control of media presentation is under the control of the application,
+ * | as defined in section H.2. The video/broadcast object contains the video being presented.
+ * ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
+ * 3 | stopped; the terminal is not presenting media, either inside the video/broadcast object or in the logical video plane. The logical video plane is
+ * | disabled. The content of the video/broadcast object SHALL be an opaque black rectangle. Control of media presentation is under the control of the
+ * | application, as defined in section H.2
+ * ------ --------------------------------------------------------------------------------------------------------------------------------------------------------
+ * See section 7.13.1.1 for a description of the state model for a video/broadcast object.
+ * NOTE: Implementations where the content of the video/broadcast object is transparent in the unrealized state will give a better user experience than
+ * ones where it is black. This happens for an application with video in the background between when it includes a video/broadcast object in the page and when a
+ * call to bindToCurrentChannel() completes. Applications which do not need to call bindToCurrentChannel() should not do so. The current channel can
+ * be obtained from the currentChannel property on the ApplicationPrivateData object which is the same as that on the video/broadcast object under most normal * conditions.
+ */
+ this.playState = null;
+
+ /*
+ * Description:
+ * The list of media formats that are supported by the object. Each item SHALL contain a format label according
+ * to [OIPF_MEDIA2].
+ * If scarce resources are not claimed by the object, the value of this property SHALL be null.
+ *
+ * Visibilité Type: readonly StringCollection
+ */
+ this.playerCapabilities = null;
+
+ /*
+ * Description:
+ * Returns the resource allocation method currently in use by the object. Valid values as defined in section 7.14.13.1 are:
+ * to [OIPF_MEDIA2].
+ * • STATIC_ALLOCATION
+ * • DYNAMIC_ALLOCATION
+ *
+ * Visibilité Type: readonly Integer
+ */
+ this.allocationMethod = null;
+
+ /*
+ * Description:
+ * The channel currently being presented by this embedded object if the user has given permission to share this
+ * information, possibly through a mechanism outside the scope of this specification. If no channel is being
+ * presented, or if this information is not visible to the caller, the value of this property SHALL be null.
+ * The value of this property is not affected during timeshift operations and SHALL reflect the value prior to the
+ * start of a timeshift operation, for both local and network timeshift resources.
+ *
+ * Extensions to video/broadcast for current channel information:
+ * If an OITF has indicated support for extended tuner control (i.e. by giving value true to element
+ * <extendedAVControl> as specified in section 9.3.6 in its capability description), the OITF SHALL support the
+ * following additional properties and methods on the video/broadcast object.
+ * The functionality as described in this section is subject to the security model of section 10.1.3.8.
+ * Note the property onChannelScan and methods startScan and stopScan have been moved to section 7.13.9.
+ *
+ * Visibility Type: readonly Channel
+ */
+ this.currentChannel = null;
+
this.playState = 0;
this._listeners = {};
this._callbacks = {};
this._channelService = oipfObjectFactory._channelService;
this._eventManager = new EventManager();
this._timerManager = new TimerManager();
-
+
this._timeout = this._timerManager.createTimer.bind(this._timerManager, 0);
this._timeoutLong = this._timerManager.createTimer.bind(this._timerManager, 100);
- },
-
+ }
+
+ createdCallback() {
+ console.log("[INFO] createdCallback called.");
+ this.init();
+ }
+
+
/*!
* Description:
* The function that is called when a request to switch a tuner to another channel resulted in an error preventing
@@ -165,7 +167,7 @@
*
* These arguments are defined as follows:
*
- * • Channel channel:
+ * • Channel channel:
* the Channel object to which a channel switch was requested, but for which the
* error occurred. This object SHALL have the same properties as the channel that was requested,
* except that for channels of type ID_DVB_* the values for the onid and tsid properties SHALL be
@@ -205,29 +207,35 @@
* 100 | unidentified error.
* ---------------------------------------------------------------------------------------------------------------------------------------------------------------
*/
- onChannelChangeError: null,
-
+ get onChannelChangeError() {
+ return this._getCallback("ChannelChangeError");
+ }
+
+ set onChannelChangeError(callback) {
+ this._setCallback("ChannelChangeError", callback);
+ }
+
/*!
* Description:
* The function that is called when the play state of the video/broadcast object changes. This function may
* be called either in response to an action initiated by the application, an action initiated by the OITF or an
* error (see section 7.13.1.1).
- *
+ *
* The specified function is called with the arguments state and error . These arguments are defined as follows:
- *
- * • Number state:
+ *
+ * • Number state:
* the new state of the video/broadcast object. Valid values are given in the definition of the playState property above.
*
* • Number error – if the state has changed due to an error, this field contains an error code detailing the type of error. See the definition of * onChannelChangeError above for valid values. If no error has occurred, this argument SHALL take the value undefined .
*/
get onPlayStateChange() {
return this._getCallback("PlayStateChange");
- },
-
+ }
+
set onPlayStateChange(callback) {
this._setCallback("PlayStateChange", callback);
- },
-
+ }
+
/*
* Description:
* The function that is called when a request to switch a tuner to another channel has successfully completed.
@@ -239,68 +247,80 @@
*/
get onChannelChangeSucceeded() {
return this._getCallback("ChannelChangeSucceeded");
- },
-
+ }
+
set onChannelChangeSucceeded(callback) {
this._setCallback("ChannelChangeSucceeded", callback);
- },
-
+ }
+
get onDRMRightsError() {
return this._getCallback("DRMRightsError");
- },
-
+ }
+
set onDRMRightsError(callback) {
this._setCallback("DRMRightsError", callback);
- },
+ }
/*
* Description:
* The function that is called when the value of fullScreen changes.
*/
- onFullScreenChange: function() {
+ get onFullScreenChange() {
+ return this._getCallback("FullScreenChange");
+ }
- },
-
+ set onFullScreenChange(callback) {
+ this._setCallback("FullScreenChange", callback);
+ }
+
/*
* Description:
* The function that is called when the video object gains focus.
*/
- onfocus: function() {
+ get onfocus() {
+ return this._getCallback("focus");
+ }
- },
-
+ set onfocus(callback) {
+ this._setCallback("focus", callback);
+ }
+
/*
* Description:
* The function that is called when the video object loses focus.
*/
- onblur: function() {
+ get onblur() {
+ return this._getCallback("blur");
+ }
- },
-
- _getCallback : function(type) {
- if(this._callbacks) {
+ set onblur(callback) {
+ this._setCallback("blur", callback);
+ }
+
+ _getCallback(type) {
+ if (this._callbacks) {
return this._callbacks[type];
}
- },
-
- _setCallback: function(type, callback){
- if(this._callbacks) {
+ }
+
+ _setCallback(type, callback) {
+ if (this._callbacks) {
this._callbacks[type] = callback;
}
- },
-
+ }
+
/*
*
- * Description:
+ * Description:
* Returns the channel line-up of the tuner in the form of a ChannelConfig object as defined
* in section 7.13.9. The method SHALL return the value null if the channel list is not
* (partially) managed by the OITF (i.e., if the channel list information is managed entirely in the network).
*/
- getChannelConfig: function() {
+ getChannelConfig() {
return oipfObjectFactory.createChannelConfig();
- },
-
+ }
+
/*
- * Description:
+ * Description:
* If the video/broadcast object is in the unrealized state and video from exactly one
* channel is currently being presented by the OITF then this binds the video/broadcast
* object to that video.
@@ -321,13 +341,13 @@
* from that channel is being presented. Applications should listen for the video/broadcast
* object entering state 2 (“ presenting ”) in order to determine when audio or video is being
* presented.
- *
+ *
* TODO : binding of necessary ressources
*/
- bindToCurrentChannel: function() {
+ bindToCurrentChannel() {
var channelConfig = this._channelService;
var currentChannel = channelConfig.currentChannel;
-
+
switch (this.playState) {
case this._UNREALIZED:
@@ -344,7 +364,7 @@
.then(this.changePlayState.bind(this, this._UNREALIZED, 100));
}
break;
-
+
case this._CONNECTING:
if (!channelUtils.verifyASuitableTunerAvailable(currentChannel.idType)) {
this._timeout()
@@ -356,7 +376,7 @@
}
//Method documentation indicate it don't have effects in this state.
break;
-
+
case this._PRESENTING:
/*if (!verifyASuitableTunerAvailable(currentChannel.idType)) {
this.timer = oipf.utils.this._timeout()
@@ -364,7 +384,7 @@
}*/
//Method documentation indicate it don't have effects in this state.
break;
-
+
case this._STOPPED:
//FIX-ME :Make enable video and audio presentation
if (!channelUtils.verifyASuitableTunerAvailable(currentChannel.idType, this)) {
@@ -380,52 +400,52 @@
break;
}
return this.currentChannel;
- },
+ }
- addEventListener: function(type, listener) {
+ addEventListener(type, listener) {
this._eventManager.addEventListener(type, listener, this);
- },
-
- _fireEvent: function(event) {
+ }
+
+ _fireEvent(event) {
this._eventManager.fireEvent(event, this);
- },
-
- removeEventListener: function(type, listener) {
+ }
+
+ removeEventListener(type, listener) {
this._eventManager.removeEventListener(type, listener, this);
- },
-
- changePlayState: function(state, error) {
+ }
+
+ changePlayState(state, error) {
console.log("changeState", state);
this.playState = state;
this._fireEvent(createCustomEvent("PlayStateChange", [this.playState, error]));
- },
-
- noTransientError: function(channel){
-
+ }
+
+ noTransientError(channel) {
+
/*if (channel.locked) {
return true;
} else {
return false;
}*/
return true;
- },
-
- noPermanentError: function(channel){
+ }
+
+ noPermanentError(channel) {
return true;
- },
-
- changeStateToConnectingWhenSwitching: function(channel) {
-
+ }
+
+ changeStateToConnectingWhenSwitching(channel) {
+
if (this.noTransientError(this._CONNECTING) && this.noPermanentError(this._CONNECTING, channel)) {
this.playState = this._CONNECTING;
this._fireEvent(createCustomEvent("PlayStateChange", [this.playState]));
this._timeout()
.then(this.changeStateToPresentingWhenSwitching.bind(this, channel));
}
- },
-
- changeStateToPresentingWhenSwitching: function(channel) {
+ }
+ changeStateToPresentingWhenSwitching(channel) {
+
if (this.noTransientError(this._PRESENTING)) {
this.setCurrentChannel(channel);
this.playState = this._PRESENTING;
@@ -433,12 +453,12 @@
this._timeout()
.then(this._fireEvent.bind(this, createCustomEvent("ChannelChangeSucceeded", [channel])));
}
- },
-
- setCurrentChannel: function(channel) {
+ }
+
+ setCurrentChannel(channel) {
this.currentChannel = channel;
- },
-
+ }
+
/*
* Description:
* Creates a Channel object of the specified idType . This method is typically used to create a
@@ -447,64 +467,64 @@
* be part of the channel list in the OITF. The resulting Channel object represents a locally
* defined channel which, if not already present there, does not get added to the channel list
* accessed through the ChannelConfig class (see section 7.13.9).
- *
+ *
* If the channel of the given type cannot be created or the delivery system descriptor is not
* valid, the method SHALL return null .
- *
+ *
* If the channel of the given type (ID_DVB_SI_DIRECT) can be created and the delivery system descriptor is valid,
* the method SHALL return a Channel object whereby at a minimum the properties with the
* same names (i.e. idType , dsd and sid ) are given the same value as argument idType ,
* dsd and sid of the createChannelObject method.
- *
+ *
* Else, if the channel of the given type can be created and arguments are considered valid and
* complete, then either:
- *
+ *
* 1. If the channel is in the channel list then a new object of the same type and with
* properties with the same values SHALL be returned as would be returned by calling
* getChannelWithTriplet() with the same parameters as this method.
- *
+ *
* 2. Otherwise, the method SHALL return a Channel object whereby at a minimum the
* properties with the same names are given the same value as the given arguments of
* the createChannelObject() method. The values specified for the remaining
- * properties of the Channel object are set to undefined .
+ * properties of the Channel object are set to undefined .
*
* Arguments:
- *
+ *
* Either (if idType ID_DVB_SI_DIRECT):
* - idType: The type of channel, as indicated by one of the ID_* constants defined in
* section 7.13.11.1. Valid values for idType include : ID_DVB_SI_DIRECT . For
* other values this behaviour is not specified.
- *
+ *
* - dsd: The delivery system descriptor (tuning parameters) represented as a string
* whose characters shall be restricted to the ISO Latin-1 character set. Each
* character in the dsd represents a byte of a delivery system descriptor as defined
* by DVB-SI [EN 300 468] section 6.2.13, such that a byte at position "i" in the
* delivery system descriptor is equal the Latin-1 character code of the character at
* position "i" in the dsd.
- *
+ *
* - sid: The service ID, which must be within the range of 1 to 65535.
- *
+ *
* Or (Any other type):
* - idType : The type of channel, as indicated by one of the ID_* constants defined in
* section 7.13.11.1. Valid values for idType include : ID_DVB_SI_DIRECT . For
* other values this behaviour is not specified.
- *
+ *
* - onid : The original network ID. Optional argument that SHALL be specified
* when the idType specifies a channel of type ID_DVB_* , ID_IPTV_URI ,
* or ID_ISDB_* and SHALL otherwise be ignored by the OITF.
- *
+ *
* - tsid : The transport stream ID. Optional argument that MAY be specified when
* the idType specifies a channel of type ID_DVB_* , ID_IPTV_URI , or
* ID_ISDB_* and SHALL otherwise be ignored by the OITF.
- *
+ *
* - sid : The service ID. Optional argument that SHALL be specified when the
* idType specifies a channel of type ID_DVB_* , ID_IPTV_URI , or
* ID_ISDB_* and SHALL otherwise be ignored by the OITF.
- *
+ *
* - sourceID : The source_ID. Optional argument that SHALL be specified when the
* idType specifies a channel of type ID_ATSC_T and SHALL otherwise be
* gnored by the OITF.
- *
+ *
* - ipBroadcastID : The DVB textual service identifier of the IP broadcast service, specified in
* the format “ ServiceName.DomainName ” when idType specifies a
* channel of type ID_IPTV_SDS , or the URI of the IP broadcast service
@@ -513,8 +533,8 @@
* of type ID_IPTV_SDS or ID_IPTV_URI and SHALL otherwise be ignored
* by the OITF.
*/
- createChannelObject: function() {
-
+ createChannelObject() {
+
if (arguments.length == 3 && arguments[0] == 13) {
this._createDvbSiChannelObject(arguments);
} else {
@@ -523,27 +543,27 @@
}
}
return null;
- },
-
- _createDvbSiDirectChannelObject: function(idType, dsd, sid) {
-
+ }
+
+ _createDvbSiDirectChannelObject(idType, dsd, sid) {
+
if (idType == 13) { //Identify a channel of identifier type : ID_DVB_SI_DIRECT.
if (CHANNEL_CREATION[idType]) { //Verify a channel of this idType (ID_DVB_SI_DIRECT = 13).
-
-
+
+
if (channelUtils.isAValidTerrestrialDsd (dsd)) { //Verify the dsd validity.
-
+
if ((sid >= 1) && (sid <= 65535)) { //Verify the rigth range of service id.
-
+
var newChannel = new Channel(idType, dsd, sid, "localChannel" + createUUID());
var channelConfig = this._channelService;
if (channelUtils.getChannelByDsd(channelConfig.channelList, dsd)) {
-
+
/* Normally channelList is readonly but the method documentation say
* that the channel must be add if it not already present.
- */
+ */
channelConfig.channelList.push(newChannel);
}
@@ -554,8 +574,8 @@
}
}
- },
-
+ }
+
/*
* Description:
* Creates a Channel object of the specified idType . This method is typically used to create a
@@ -577,23 +597,23 @@
* - idType : The type of channel, as indicated by one of the ID_* constants defined in
* section 7.13.11.1. Valid values for idType include : ID_DVB_SI_DIRECT . For
* other values this behaviour is not specified.
- *
+ *
* - onid : The original network ID. Optional argument that SHALL be specified
* when the idType specifies a channel of type ID_DVB_* , ID_IPTV_URI ,
* or ID_ISDB_* and SHALL otherwise be ignored by the OITF.
- *
+ *
* - tsid : The transport stream ID. Optional argument that MAY be specified when
* the idType specifies a channel of type ID_DVB_* , ID_IPTV_URI , or
* ID_ISDB_* and SHALL otherwise be ignored by the OITF.
- *
+ *
* - sid : The service ID. Optional argument that SHALL be specified when the
* idType specifies a channel of type ID_DVB_* , ID_IPTV_URI , or
* ID_ISDB_* and SHALL otherwise be ignored by the OITF.
- *
+ *
* - sourceID : The source_ID. Optional argument that SHALL be specified when the
* idType specifies a channel of type ID_ATSC_T and SHALL otherwise be
* gnored by the OITF.
- *
+ *
* - ipBroadcastID : The DVB textual service identifier of the IP broadcast service, specified in
* the format “ ServiceName.DomainName ” when idType specifies a
* channel of type ID_IPTV_SDS , or the URI of the IP broadcast service
@@ -601,12 +621,12 @@
* argument that SHALL be specified when the idType specifies a channel
* of type ID_IPTV_SDS or ID_IPTV_URI and SHALL otherwise be ignored
* by the OITF.
- *
- * Important : We place us into a world without error. And no validation will be done like
+ *
+ * Important : We place us into a world without error. And no validation will be done like
* this documentation mention it. This criterion not very useful in our implementation.
*/
- _createAnyDvbChannelObject: function(idType, onid, tsid, sid, sourceID, ipBroadcastID) {
-
+ _createAnyDvbChannelObject(idType, onid, tsid, sid, sourceID, ipBroadcastID) {
+
if (CHANNEL_CREATION[idType]) {
if (idType == 13 || idType ==0) {
return null;
@@ -615,49 +635,49 @@
if (idType == 30) {
var equivalentChannel = this._channelService.channelList.getChannelBySourceID(sourceID);
} else if (idType == 40) {
- equivalentChannel = channelUtils.getChannelByIpBroadcastID(ipBroadcastID);
+ equivalentChannel = channelUtils.getChannelByIpBroadcastID(ipBroadcastID);
} else {
equivalentChannel = this._channelService.channelList.getChannelByTriplet(onid, tsid, sid);
}
-
+
if (equivalentChannel) {
var newChannel = new Channel(arguments.push(equivalentChannel.name));
} else {
newChannel = new Channel(arguments.push("localChannel:"+createUUID()));
}
-
+
this._channelService.channelList.push(newChannel);
}
-
+
return null;
- },
+ }
/*
* Description: (Validation on Transport Stream won't be done here because this criteria not relevant)
* Requests the OITF to switch a (logical or physical) tuner to the channel specified by
* channel and render the received broadcast content in the area of the browser allocated for
* the video/broadcast object.
- *
+ *
* If the channel specifies an idType attribute value which is not supported by the OITF or a
* combination of properties that does not identify a valid channel, the request to switch
* channel SHALL fail and the OITF SHALL trigger the function specified by the
* onChannelChangeError property, specifying the value 0 (“Channel not supported by
* tuner”) for the errorState , and dispatch the corresponding DOM event (see below).
- *
- * FiX-ME: Yannis - 25/03/2015 - No take account trickplay
- * FiX-ME: Yannis - 25/03/2015 - No verification about Transport Stream
- * FiX-ME: Yannis - 25/03/2015 - No verification about possiblity of a local channel argument
- * FiX-ME: Yannis - 25/03/2015 - No verification about same tuning
- * parameters of argument channel with
+ *
+ * FiX-ME: Yannis - 25/03/2015 - No take account trickplay
+ * FiX-ME: Yannis - 25/03/2015 - No verification about Transport Stream
+ * FiX-ME: Yannis - 25/03/2015 - No verification about possiblity of a local channel argument
+ * FiX-ME: Yannis - 25/03/2015 - No verification about same tuning
+ * parameters of argument channel with
*/
- setChannel: function(channel, trickplay, contentAccessDescriptorURL) {
-
+ setChannel(channel, trickplay, contentAccessDescriptorURL) {
+
if (this.playState >= this._UNREALIZED && this.playState <= this._STOPPED && channel) {
-
+
if (channelUtils.verifyASuitableTunerAvailable(channel.idType, this) && channel.idType != 41) {
this._timeout()
.then(this.changeStateToConnectingWhenSwitching.bind(this, channel));
-
+
} else if (channel.idType == 40 || channel.idType == 41) {
this._timeout()
.then(this._fireEvent.bind(this, createCustomEvent("ChannelChangeError", [null, 8])));
@@ -671,7 +691,7 @@
.then(this.changePlayState.bind(this, this._UNREALIZED));
}
}
- },
+ }
/*
* Description:
@@ -683,7 +703,7 @@
* If the current channel is not part of the channel list, it is implementation dependent whether
* the method call succeeds or fails and, if it succeeds, which channel is selected. In both
* cases, all appropriate functions SHALL be called and DOM events dispatched.
- *
+ *
* If the previous channel is a channel that cannot be received over the tuner currently used by
* the video/broadcast object, the OITF SHALL relay the channel switch request to a local
* physical or logical tuner that is not in use and that can tune to the specified channel. The
@@ -703,11 +723,11 @@
* dispatch the corresponding DOM event.
* Calls to this method are valid in the Connecting, Presenting and Stopped states. They are
* not valid in the Unrealized state and SHALL fail.
- *
+ *
*/
- prevChannel: function() {
+ prevChannel() {
this._channelSwitch(-1);
- },
+ }
/*
* Description:
@@ -719,7 +739,7 @@
* If the current channel is not part of the channel list, it is implementation dependent whether
* the method call succeeds or fails and, if it succeeds, which channel is selected. In both
* cases, all appropriate functions SHALL be called and DOM events dispatched.
- *
+ *
* If the next channel is a channel that cannot be received over the tuner currently used by
* the video/broadcast object, the OITF SHALL relay the channel switch request to a local
* physical or logical tuner that is not in use and that can tune to the specified channel. The
@@ -739,11 +759,11 @@
* dispatch the corresponding DOM event.
* Calls to this method are valid in the Connecting, Presenting and Stopped states. They are
* not valid in the Unrealized state and SHALL fail.
- *
+ *
*/
- nextChannel: function() {
+ nextChannel() {
this._channelSwitch(1);
- },
+ }
/*
* Description:
@@ -751,23 +771,23 @@
* ( fullscreen = false ) mode (as per [Req. 5.7.1.c] of [CEA-2014-A]). If this indicates a
* change in mode, this SHALL result in a change of the value of property fullScreen .
* Changing the mode SHALL NOT affect the z-index of the video object.
- *
- * Arguments:
+ *
+ * Arguments:
* - fullScreen : Boolean to indicate whether video content should be rendered full-screen or not.
*/
- setFullScreen: function(fullscreen) {
- },
-
+ setFullScreen(fullscreen) {
+ }
+
/*
* Description:
* Adjusts the volume of the currently playing media to the volume as indicated by volume.
* Allowed values for the volume argument are all the integer values starting with 0 up to and
- * including 100.
- * A value of 0 means the sound will be muted.
+ * including 100.
+ * A value of 0 means the sound will be muted.
* A value of 100 means that the
* volume will become equal to current “master” volume of the device, whereby the “master”
* volume of the device is the volume currently set for the main audio output mixer of the
- * device.
+ * device.
* All values between 0 and 100 define a linear increase of the volume as a percentage
* of the current master volume, whereby the OITF SHALL map it to the closest volume level
* supported by the platform.
@@ -776,52 +796,52 @@
*
* Arguments:
* - volume: Integer value between 0 up to and including 100 to indicate volume level.
- *
+ *
* Actually the norm don't talk about the way to obtain the current master volume for the main
* audio output mixer; So we'll base on the system volume.
* FIX-ME: Yannis - 24/03/2015 - Bindind with the configuration object.
*/
- setVolume: function(volume) {
-
+ setVolume(volume) {
+
if (!Number.isInteger(volume) || volume < 0 || volume > 100 ) {
return false;
- }
-
+ }
+
this._volume = volume;
return true;
- },
-
+ }
+
/*
* Description:
* Returns the actual volume level set; for systems that do not support individual volume
* control of players, this method will have no effect and will always return 100.
*
*/
- getVolume: function() {
+ getVolume() {
return this._volume || 0;
- },
-
+ }
+
/*
* Description:
* Releases the decoder/tuner used for displaying the video broadcast inside the
* video/broadcast object, stopping any form of visualization of the video inside the
* video/broadcast object and releasing any other associated resources.
- * If the object was created with an allocationMethod of STATIC_ALLOCATION ,
+ * If the object was created with an allocationMethod of STATIC_ALLOCATION ,
* the releasing of resources shall change this to DYNAMIC_ALLOCATION .
*/
- release: function() {
- if ((this.playState >= this._CONNECTING) && (this.playState <= this._STOPPED)) {
- /* Call method to :
+ release() {
+ if (this.playState >= this._CONNECTING && this.playState <= this._STOPPED) {
+ /* Call method to :
* - release tuner used by this video/broadcast object.
* - stop visualization of the video.
* - and scarce ressources loaded previously.
*/
-
-
+
+
this._timeout()
.then(this.changePlayState.bind(this, this._UNREALIZED));
}
- },
+ }
/*
* Description:
@@ -831,28 +851,28 @@
* as EIT information.
* Calling this method from the unrealized state SHALL have no effect.
* See section 7.13.1.1 for more information of its usage.
- *
+ *
*/
- stop: function() {
- if ((this.playState == this._CONNECTING) || (this.playState == this._PRESENTING)) {
- /* Call method to :
+ stop() {
+ if (this.playState == this._CONNECTING || this.playState == this._PRESENTING) {
+ /* Call method to :
* - stop the presentation of the video and audio.
* - and scarce ressources loaded previously.
*/
-
-
+
+
this._timeout()
.then(this.changePlayState.bind(this, this._STOPPED));
}
- },
-
- _channelSwitch: function(step) {
+ }
+
+ _channelSwitch(step) {
//claimed scarce resources
//Call method to claim scarce resources
var channelConfig = this._channelService;
var favouriteLists = channelConfig.favouriteLists;
-
+
if ((this.playState > 0) && (this.playState < 4)) {
//Verify that OITF maintain channel list or favourite list by itself
if (channelConfig && favouriteLists) {
@@ -863,7 +883,7 @@
.then(this._fireEvent.bind(this, createCustomEvent("ChannelChangeError", [null, 100])));
/*setTimeout(function () {
self.onChannelChangeError && self.onChannelChangeError(null, 100);
- }, 0);*/
+ } 0);*/
if (this.playState == 1) {
this._timeout()
@@ -871,13 +891,13 @@
/*setTimeout(function () {
self.playState = 0;
self.onPlayStateChange && self.onPlayStateChange(self.playState, 100);
- }, 0);*/
- }
+ } 0);*/
+ }
} else {
/*
- * The norm affirm that the value "undefined" for the property "currentFavouriteList"
+ * The norm affirm that the value "undefined" for the property "currentFavouriteList"
* means no current favourite list is activating.
- * But test on this value for "currentFavouriteList" can cause confusion
+ * But test on this value for "currentFavouriteList" can cause confusion
* and when her value equals null, we have not the wanted behaviours.
*/
if (channelConfig.currentFavouriteList.length == 0) {
@@ -901,35 +921,35 @@
this._timeout()
.then(this._fireEvent.bind(this, createCustomEvent("ChannelChangeError", [null, 0])));
}
-
+
}
} else {
//When the OITF does not maintain channel list or favourite list by itself
this._timeout()
.then(this._fireEvent.bind(this, createCustomEvent("ChannelChangeError", [null, 10])));
-
+
}
- }
- },
-
+ }
+ }
+
/*
* Description:
* Creates a ChannelList object from the specified SD&S Broadcast Discovery
* Record. Channels in the returned channel list will not be included in the
* channel list that can be retrieved via calls to getChannelConfig().
- *
+ *
* Arguments:
* - bdr: An XML-encoded string containing an SD&S Broadcast Discovery
- * Record as specified in [OIPF_META2]. If the string is not a valid
- * Broadcast Discovery Record, this method SHALL return null.
- *
+ * Record as specified in [OIPF_META2]. If the string is not a valid
+ * Broadcast Discovery Record, this method SHALL return null.
+ *
* Return: ChannelList
- *
- * FIXME
- * - Yannis 21/05/2015 Validate the parameter bdr
+ *
+ * FIXME
+ * - Yannis 21/05/2015 Validate the parameter bdr
*/
- createChannelList: function(bdr) {
+ createChannelList(bdr) {
var channelListArray = bdr.split(",");
var channelList = new ChannelList();
var channelInfoNumber = {
@@ -938,45 +958,45 @@
5: true,
6: true
};
-
+
if (channelListArray.length > 1) {
-
+
for (var i = 0, li = channelListArray.length; i < li; i++) {
var channelInfo = channelListArray[i];
var channelInfoArray = channelInfo.split("-");
-
- var isChannelInfoNumberExist =
+
+ var isChannelInfoNumberExist =
channelInfoNumber[channelInfoArray.length];
-
+
if (!isChannelInfoNumberExist) {
return null;
}
- //Validation of channel information return null if false
-
+ //Validation of channel information return null if false
+
//Create the channel
var channelObject = this._createChannel(channelInfoArray);
channelList.push(channelObject);
}
-
+
if (!this._localChannelList) {
this._localChannelList = [];
}
-
+
this._localChannelList.push(channelList);
-
+
return channelList;
}
-
+
return null;
- },
-
+ }
+
/*
- * We consider that the parameter of this method is valid concerning
+ * We consider that the parameter of this method is valid concerning
* the type of channel information it contains but they are string-encoded.
- * And call the associated method which must process a specific
+ * And call the associated method which must process a specific
* group of channel information according to the number of information.
*/
- _createChannel: function(minimalChannelInfoArray) {
+ _createChannel(minimalChannelInfoArray) {
var mapping = {
3: "_createChannelATSC_T",
4: "_createChannelDVB_SI_DIRECT",
@@ -985,36 +1005,36 @@
};
var channelInfoNumber = minimalChannelInfoArray.length;
return this[mapping[channelInfoNumber]].call(minimalChannelInfoArray);
- },
-
+ }
+
/*
* This method must transform the information which must be of type Integer.
* Then create and return a Channel object.
- * The parameter contain in this order:
+ * The parameter contain in this order:
* 0:Integer, 1:Integer, 2:String
- *
+ *
* Return: Channel
*/
- _createChannelATSC_T: function(channelInfoArray) {
+ _createChannelATSC_T(channelInfoArray) {
var i = 0;
-
+
return new Channel(
this._convertInInteger(channelInfoArray[i++]),
this._convertInInteger(channelInfoArray[i++]),
channelInfoArray[i++]);
- },
-
+ }
+
/*
* This method must transform the information which must be of type Integer.
* Then create and return a Channel object.
- * The parameter contain in this order:
+ * The parameter contain in this order:
* 0:Integer, 1:Integer, 2:Integer, 3:Integer, 4:String, 5:String
- *
+ *
* Return: Channel
*/
- _createChannelIPTV: function(channelInfoArray) {
+ _createChannelIPTV(channelInfoArray) {
var i = 0;
-
+
return new Channel(
this._convertInInteger(channelInfoArray[i++]),
this._convertInInteger(channelInfoArray[i++]),
@@ -1022,47 +1042,47 @@
this._convertInInteger(channelInfoArray[i++]),
channelInfoArray[i++],
channelInfoArray[i++]);
- },
-
+ }
+
/*
* This method must transform the information which must be of type Integer.
* Then create and return a Channel object.
- * The parameter contain in this order:
+ * The parameter contain in this order:
* 0:Integer, 1:Integer, 2:Integer, 3:Integer, 4:String
- *
+ *
* Return: Channel
*/
- _createChannelDVBOrISDB: function(channelInfoArray) {
+ _createChannelDVBOrISDB(channelInfoArray) {
var i = 0;
-
+
return new Channel(
this._convertInInteger(channelInfoArray[i++]),
this._convertInInteger(channelInfoArray[i++]),
this._convertInInteger(channelInfoArray[i++]),
this._convertInInteger(channelInfoArray[i++]),
channelInfoArray[i++]);
- },
-
+ }
+
/*
* This method must transform the information which must be of type Integer.
* Then create and return a Channel object.
- * The parameter contain in this order:
+ * The parameter contain in this order:
* 0:Integer, 1:String, 2:Integer, 3:String
- *
+ *
* Return: Channel
*/
- _createChannelDVB_SI_DIRECT: function(channelInfoArray) {
+ _createChannelDVB_SI_DIRECT(channelInfoArray) {
var i = 0;
-
+
return new Channel(
this._convertInInteger(channelInfoArray[i++]),
channelInfoArray[i++],
this._convertInInteger(channelInfoArray[i++]),
channelInfoArray[i++]);
- },
-
- _convertInInteger: function(stringValue) {
+ }
+
+ _convertInInteger(stringValue) {
return Number.parseInt(stringValue);
}
-
-});
\ No newline at end of file
+
+}
Modified: oipf/lib/js/impl/VideoMpegObject.js
===================================================================
--- oipf/lib/js/impl/VideoMpegObject.js 2015-06-09 15:07:19 UTC (rev 1655)
+++ oipf/lib/js/impl/VideoMpegObject.js 2015-06-09 15:19:17 UTC (rev 1656)
@@ -1,7 +1,6 @@
-var VideoMpegObject = Class.extend({
+class VideoMpegObject {
- init: function () {
-
+ constructor() {
}
-});
\ No newline at end of file
+}
1
0
Author: jruchaud
Date: 2015-06-09 15:07:19 +0000 (Tue, 09 Jun 2015)
New Revision: 1655
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1655
Log:
Use class
Modified:
oipf/lib/js/impl/model/AVOutput.js
oipf/lib/js/impl/model/AVOutputCollection.js
oipf/lib/js/impl/model/ApplicationCollection.js
oipf/lib/js/impl/model/Bookmark.js
oipf/lib/js/impl/model/BookmarkCollection.js
oipf/lib/js/impl/model/Channel.js
oipf/lib/js/impl/model/ChannelList.js
oipf/lib/js/impl/model/Collection.js
oipf/lib/js/impl/model/Configuration.js
oipf/lib/js/impl/model/FavouriteList.js
oipf/lib/js/impl/model/FavouriteListCollection.js
oipf/lib/js/impl/model/IntegerCollection.js
oipf/lib/js/impl/model/LNBInfo.js
oipf/lib/js/impl/model/LocalSystem.js
Modified: oipf/lib/js/impl/model/AVOutput.js
===================================================================
--- oipf/lib/js/impl/model/AVOutput.js 2015-06-09 14:37:23 UTC (rev 1654)
+++ oipf/lib/js/impl/model/AVOutput.js 2015-06-09 15:07:19 UTC (rev 1655)
@@ -1,199 +1,195 @@
-/*
+/*
* The AVOutput class represents an audio or video output on the local platform.
*/
-var AVOutput = Class.extend({
-
- /*
- * Description:
- * The name of the output. Each output SHALL have a name that is unique on the local system. At least one
- * of the outputs SHALL have the name " all " and SHALL represent all available outputs on the platform. The
- * results of reading properties from the " all " AVOutput are implementation specific.constructor
- *
- * Visibility Type : readonly String
- */
- name: null,
+class AVOutput {
- /*
- * Description:
- * The type of the output. Valid values are “ audio ”, “ video ”, or “ both ”.
- *
- * Visibility Type : readonly String
- */
- type: null,
-
- /*
- * Description:
- * Flag indicating whether the output is enabled. Setting this property SHALL enable or disable the output.
- *
- * Type : Boolean
- */
- enabled: null,
-
- /*
- * Description:
- * Flag indicating whether the subtitles are enabled. The language of
- * the displayed subtitles is determined by a combination of the value of
- * the Configuration.preferredSubtitleLanguage property (see section 7.3.2)
- * and the subtitles available in the stream.
- * For audio outputs, setting this property will have no effect.
- *
- * Type : Boolean
- */
- subtitleEnabled: null,
-
- videoMode: null,
-
- /*
- * Description:
- * Read or set the output mode for digital audio outputs for which hardware
- * support MAY be available on the device. Valid values are shown below.
- * ------------------------------------------------------------------------
- * Value | Behaviour
- * ------------- ----------------------------------------------------------
- * ac3 | Output AC-3 audio.
- * ------------- ----------------------------------------------------------
- * uncompressed | Output uncompressed PCM audio.
- * ------------- ----------------------------------------------------------
- * For video-only outputs, setting this property SHALL have no effect.
- *
- * Type: String
- *
- */
- digitalAudioMode: null,
-
- /*
- * Description:
- * Read or set the range for digital audio outputs for which hardware
- * support MAY be available on the device.
- * Valid values are shown below
- * ------------------------------------------------------------------------
- * Value | Behaviour
- * --------- --------------------------------------------------------------
- * normal | Output AC-3 audio.
- * --------- --------------------------------------------------------------
- * narrow | Output uncompressed PCM audio.
- * --------- --------------------------------------------------------------
- * wide | Output uncompressed PCM audio.
- * ------------------------------------------------------------------------
- * For video-only outputs, setting this property SHALL have no effect.
- *
- * Type: String
- *
- */
- audioRange: null,
-
- /*
- * Description:
- * Read or set the video format for HD and 3D video outputs for which
- * hardware support MAY be available on the device. Valid values are:
- * 480i
- * 480p
- * 576i
- * 576p
- * 720i
- * 720p
- * 1080i
- * 1080p
- * 720p_TaB
- * 720p_SbS
- * 1080i_SbS
- * 1080p_TaB
- * 1080p_SbS
- * For audio-only or standard-definition outputs, setting this property
- * SHALL have no effect.
- *
- * Type: String
- *
- */
- hdVideoFormat: null,
-
- /*
- * Description:
- * Indicates the output display aspect ratio of the display device connected
- * to this output for which hardware support MAY be available on the device.
- * Valid values are:
- * 4:3
- * 16:9
- * For audio-only outputs, setting this property SHALL have no effect.
- *
- * Type: String
- *
- */
- tvAspectRatio: null,
-
- /*
- * Description:
- * Read the video format conversion modes that may be used when
- * displaying a 4:3 input video on a 16:9 output display or 16:9 input video
- * on a 4:3 output display. The assumption is that the hardware supports
- * conversion from either format and there is no distinction between the
- * two. See the definition of the 'videoMode' property for valid values.
- * For audio outputs, this property will have the value null .
- *
- * Visibility Type: readonly StringCollection
- */
- supportedVideoModes: null,
-
- /*
- * Description:
- * Read the supported output modes for digital audio outputs.
- * See the definition of the 'digitalAudioMode' property for valid values.
- * For video outputs, this property will have the value null.
- *
- * Visibility Type: readonly StringCollection
- */
- supportedDigitalAudioModes: null,
-
- /*
- * Description:
- * Read the supported ranges for digital audio outputs.
- * See the definition of the 'audioRange' property for valid values.
- * For video outputs, this property will have the value null.
- *
- * Visibility Type: readonly StringCollection
- */
- supportedAudioRanges: null,
-
- /*
- * Description:
- * Read the supported HD and 3D video formats.
- * See the definition of the 'hdVideoFormat' property for valid values.
- * For audio outputs, this property will have the value null.
- *
- * Visibility Type: readonly StringCollection
- */
- supportedHdVideoFormats: null,
-
- /*
- * Description:
- * Read the supported TV aspect ratios. See the definition of the
- * 'tvAspectRatio' property for valid values.
- * For audio outputs, this property will have the value null .
- *
- * Visibility Type: readonly StringCollection
- */
- supportedAspectRatios: null,
-
- /*
- * Description:
- * Read whether the display is currently in a 2D or 3D mode.
- * Return values are:
- * ------------------------------------------------------------------------
- * Value | Behaviour
- * ------------- ----------------------------------------------------------
- * 0 | The display is in a 2D video mode
- * ------------- ----------------------------------------------------------
- * 1 | The display is in a 3D video mode
- * ------------- ----------------------------------------------------------
- *
- * Type: Integer
- */
- current3DMode: null,
-
- init: function(name, type, enabled) {
+ constructor(name, type, enabled) {
+ /*
+ * Description:
+ * The name of the output. Each output SHALL have a name that is unique on the local system. At least one
+ * of the outputs SHALL have the name " all " and SHALL represent all available outputs on the platform. The
+ * results of reading properties from the " all " AVOutput are implementation specific.constructor
+ *
+ * Visibility Type : readonly String
+ */
this.name = name;
+
+ /*
+ * Description:
+ * The type of the output. Valid values are “ audio ”, “ video ”, or “ both ”.
+ *
+ * Visibility Type : readonly String
+ */
this.type = type;
+
+ /*
+ * Description:
+ * Flag indicating whether the output is enabled. Setting this property SHALL enable or disable the output.
+ *
+ * Type : Boolean
+ */
this.enabled = enabled;
+
+ /*
+ * Description:
+ * Flag indicating whether the subtitles are enabled. The language of
+ * the displayed subtitles is determined by a combination of the value of
+ * the Configuration.preferredSubtitleLanguage property (see section 7.3.2)
+ * and the subtitles available in the stream.
+ * For audio outputs, setting this property will have no effect.
+ *
+ * Type : Boolean
+ */
+ this.subtitleEnabled = null;
+
+ this.videoMode = null;
+
+ /*
+ * Description:
+ * Read or set the output mode for digital audio outputs for which hardware
+ * support MAY be available on the device. Valid values are shown below.
+ * ------------------------------------------------------------------------
+ * Value | Behaviour
+ * ------------- ----------------------------------------------------------
+ * ac3 | Output AC-3 audio.
+ * ------------- ----------------------------------------------------------
+ * uncompressed | Output uncompressed PCM audio.
+ * ------------- ----------------------------------------------------------
+ * For video-only outputs, setting this property SHALL have no effect.
+ *
+ * Type: String
+ *
+ */
+ this.digitalAudioMode = null;
+
+ /*
+ * Description:
+ * Read or set the range for digital audio outputs for which hardware
+ * support MAY be available on the device.
+ * Valid values are shown below
+ * ------------------------------------------------------------------------
+ * Value | Behaviour
+ * --------- --------------------------------------------------------------
+ * normal | Output AC-3 audio.
+ * --------- --------------------------------------------------------------
+ * narrow | Output uncompressed PCM audio.
+ * --------- --------------------------------------------------------------
+ * wide | Output uncompressed PCM audio.
+ * ------------------------------------------------------------------------
+ * For video-only outputs, setting this property SHALL have no effect.
+ *
+ * Type: String
+ *
+ */
+ this.audioRange = null;
+
+ /*
+ * Description:
+ * Read or set the video format for HD and 3D video outputs for which
+ * hardware support MAY be available on the device. Valid values are:
+ * 480i
+ * 480p
+ * 576i
+ * 576p
+ * 720i
+ * 720p
+ * 1080i
+ * 1080p
+ * 720p_TaB
+ * 720p_SbS
+ * 1080i_SbS
+ * 1080p_TaB
+ * 1080p_SbS
+ * For audio-only or standard-definition outputs, setting this property
+ * SHALL have no effect.
+ *
+ * Type: String
+ *
+ */
+ this.hdVideoFormat = null;
+
+ /*
+ * Description:
+ * Indicates the output display aspect ratio of the display device connected
+ * to this output for which hardware support MAY be available on the device.
+ * Valid values are:
+ * 4:3
+ * 16:9
+ * For audio-only outputs, setting this property SHALL have no effect.
+ *
+ * Type: String
+ *
+ */
+ this.tvAspectRatio = null;
+
+ /*
+ * Description:
+ * Read the video format conversion modes that may be used when
+ * displaying a 4:3 input video on a 16:9 output display or 16:9 input video
+ * on a 4:3 output display. The assumption is that the hardware supports
+ * conversion from either format and there is no distinction between the
+ * two. See the definition of the 'videoMode' property for valid values.
+ * For audio outputs, this property will have the value null .
+ *
+ * Visibility Type: readonly StringCollection
+ */
+ this.supportedVideoModes = null;
+
+ /*
+ * Description:
+ * Read the supported output modes for digital audio outputs.
+ * See the definition of the 'digitalAudioMode' property for valid values.
+ * For video outputs, this property will have the value null.
+ *
+ * Visibility Type: readonly StringCollection
+ */
+ this.supportedDigitalAudioModes = null;
+
+ /*
+ * Description:
+ * Read the supported ranges for digital audio outputs.
+ * See the definition of the 'audioRange' property for valid values.
+ * For video outputs, this property will have the value null.
+ *
+ * Visibility Type: readonly StringCollection
+ */
+ this.supportedAudioRanges = null;
+
+ /*
+ * Description:
+ * Read the supported HD and 3D video formats.
+ * See the definition of the 'hdVideoFormat' property for valid values.
+ * For audio outputs, this property will have the value null.
+ *
+ * Visibility Type: readonly StringCollection
+ */
+ this.supportedHdVideoFormats = null;
+
+ /*
+ * Description:
+ * Read the supported TV aspect ratios. See the definition of the
+ * 'tvAspectRatio' property for valid values.
+ * For audio outputs, this property will have the value null .
+ *
+ * Visibility Type: readonly StringCollection
+ */
+ this.supportedAspectRatios = null;
+
+ /*
+ * Description:
+ * Read whether the display is currently in a 2D or 3D mode.
+ * Return values are:
+ * ------------------------------------------------------------------------
+ * Value | Behaviour
+ * ------------- ----------------------------------------------------------
+ * 0 | The display is in a 2D video mode
+ * ------------- ----------------------------------------------------------
+ * 1 | The display is in a 3D video mode
+ * ------------- ----------------------------------------------------------
+ *
+ * Type: Integer
+ */
+ this.current3DMode = null;
}
-});
+}
Modified: oipf/lib/js/impl/model/AVOutputCollection.js
===================================================================
--- oipf/lib/js/impl/model/AVOutputCollection.js 2015-06-09 14:37:23 UTC (rev 1654)
+++ oipf/lib/js/impl/model/AVOutputCollection.js 2015-06-09 15:07:19 UTC (rev 1655)
@@ -1,14 +1,14 @@
-/*
+/*
* typedef Collection<AVOutput> AVOutputCollection
- *
+ *
* The AVOutputCollection class represents a collection of AVOutput objects. See Annex K for the definition of the
* collection template.
- *
+ *
*/
-var AVOutputCollection = Collection.extend({
-
- init: function() {
- this.super.init.apply(this, arguments);
+class AVOutputCollection extends Collection {
+
+ constructor(...args) {
+ super(...args);
}
-});
+}
Modified: oipf/lib/js/impl/model/ApplicationCollection.js
===================================================================
--- oipf/lib/js/impl/model/ApplicationCollection.js 2015-06-09 14:37:23 UTC (rev 1654)
+++ oipf/lib/js/impl/model/ApplicationCollection.js 2015-06-09 15:07:19 UTC (rev 1655)
@@ -7,6 +7,6 @@
class ApplicationCollection extends Collection {
constructor(...args) {
- super(args);
+ super(...args);
}
}
Modified: oipf/lib/js/impl/model/Bookmark.js
===================================================================
--- oipf/lib/js/impl/model/Bookmark.js 2015-06-09 14:37:23 UTC (rev 1654)
+++ oipf/lib/js/impl/model/Bookmark.js 2015-06-09 15:07:19 UTC (rev 1655)
@@ -1,30 +1,17 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
+class Bookmark {
-var Bookmark = Class.extend({
-
- /*
- * Description:
- * The time at which the bookmark is set, in seconds from
- * the start of the content item.
- */
- time: null,
-
- /*
- * Description:
- * The name of the bookmark.
- *
- */
- name: null,
-
- init: function(time, name) {
+ constructor(time, name) {
+ /*
+ * Description:
+ * The time at which the bookmark is set, in seconds from
+ * the start of the content item.
+ */
this.time = time;
+
+ /*
+ * Description:
+ * The name of the bookmark.
+ */
this.name = name;
}
-
-});
-
-
+}
Modified: oipf/lib/js/impl/model/BookmarkCollection.js
===================================================================
--- oipf/lib/js/impl/model/BookmarkCollection.js 2015-06-09 14:37:23 UTC (rev 1654)
+++ oipf/lib/js/impl/model/BookmarkCollection.js 2015-06-09 15:07:19 UTC (rev 1655)
@@ -1,48 +1,41 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
+class BookmarkCollection extends Collection{
-var BookmarkCollection = Collection.extend({
-
- init: function() {
- this.super.init.apply(this, arguments);
- },
-
+ constructor(...args) {
+ super(...args);
+ }
+
/*
* Description:
- * Add a new bookmark to the collection. If the bookmark cannot be added
- * (e.g. because the value given for time lies outside
+ * Add a new bookmark to the collection. If the bookmark cannot be added
+ * (e.g. because the value given for time lies outside
* the length of the recording), this method SHALL return null.
- *
+ *
* Argument:
- * - time: The time at which the bookmark is set, in seconds since
+ * - time: The time at which the bookmark is set, in seconds since
* the start of the recording.
- *
+ *
* - name: The name of the bookmark.
*/
- addBookmark: function(time, name) {
+ addBookmark(time, name) {
var newBookmark = new Bookmark(time, name);
this.push(newBookmark);
-
- },
-
+ }
+
/*
* Description:
* Remove a bookmark from the collection.
- *
+ *
* Argument:
* - bookmark: The bookmark to be removed.
*/
- removeBookmark: function(bookmark) {
+ removeBookmark(bookmark) {
var indexOfBookmark = this.indexOf(bookmark);
var lastBookmark = this[this.length-1];
-
+
if (indexOfBookmark) {
this[indexOfBookmark] = lastBookmark;
this.pop();
}
}
-
-});
+
+}
Modified: oipf/lib/js/impl/model/Channel.js
===================================================================
--- oipf/lib/js/impl/model/Channel.js 2015-06-09 14:37:23 UTC (rev 1654)
+++ oipf/lib/js/impl/model/Channel.js 2015-06-09 15:07:19 UTC (rev 1655)
@@ -12,167 +12,168 @@
* properties of a locally defined channel before the Channel object is referenced by another object or passed to an API
* call as an input parameter. The effects of writing to these properties at any other time is implementation dependent.
* The LocalSystem object allows hardware settings related to the local device to be read and modified.
- *
+ *
* Note: The standbyState property has been removed from this class.
*/
-var Channel = Class.extend({
- /*
- * Description:
- * The type of channel. The value MAY be indicated by one of the TYPE_* constants defined above. If the
- * type of the channel is unknown then the value SHALL be “ undefined ”.
- * NOTE: Values of this type between 256 and 511 are reserved for use by related specifications on request by
- * liaison.
- *
- * Visibility Type: readonly Integer
- */
- channelType: null,
- /*
- * Description:
- * The type of identification for the channel, as indicated by one of the ID_* constants defined above.
- *
- * Visibility Type: readonly Integer
- */
- idType: null,
- /*
- * Description:
- * Unique identifier of a channel within the scope of the OITF. The ccid is defined by the OITF and SHALL have
- * prefix ‘ ccid ’ : e.g. ‘ccid:{tunerID.}majorChannel{.minorChannel}’.
- *
- * Note: the format of this string is platform-dependent.
- *
- * Visibility Type: readonly String
- */
- ccid: null,
- /*
- * Description:
- * The name of the channel. Can be used for linking analog channels without CNI. Typically, it will contain the
- * call sign of the station (e.g. 'HBO').
- *
- * Type: String
- */
- name: null,
- /*
- * Description:
- * Optional unique identifier of the tuner within the scope of the OITF that is able to receive the given channel.
- *
- * Visibility Type: readonly String
- */
- tunerID: null,
-
- /*
- * Description:
- * DVB or ISDB original network ID.
- *
- * Visibility Type: readonly Integer
- */
- onid: null,
+class Channel {
- /*
- * Description:
- * DVB or ISDB transport stream ID.
- *
- * Visibility Type: readonly Integer
- */
- tsid: null,
+ constructor() {
+ /*
+ * Description:
+ * The type of channel. The value MAY be indicated by one of the TYPE_* constants defined above. If the
+ * type of the channel is unknown then the value SHALL be “ undefined ”.
+ * NOTE: Values of this type between 256 and 511 are reserved for use by related specifications on request by
+ * liaison.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.channelType = null;
+ /*
+ * Description:
+ * The type of identification for the channel, as indicated by one of the ID_* constants defined above.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.idType = null;
+ /*
+ * Description:
+ * Unique identifier of a channel within the scope of the OITF. The ccid is defined by the OITF and SHALL have
+ * prefix ‘ ccid ’ : e.g. ‘ccid:{tunerID.}majorChannel{.minorChannel}’.
+ *
+ * Note: the format of this string is platform-dependent.
+ *
+ * Visibility Type: readonly String
+ */
+ this.ccid = null;
+ /*
+ * Description:
+ * The name of the channel. Can be used for linking analog channels without CNI. Typically, it will contain the
+ * call sign of the station (e.g. 'HBO').
+ *
+ * Type: String
+ */
+ this.name = null;
+ /*
+ * Description:
+ * Optional unique identifier of the tuner within the scope of the OITF that is able to receive the given channel.
+ *
+ * Visibility Type: readonly String
+ */
+ this.tunerID = null;
- /*
- * Description:
- * DVB or ISDB service ID.
- *
- * Visibility Type: readonly Integer
- */
- sid: null,
-
- /*
- * Description:
- * For channels of type ID_DVB_SI_DIRECT created through createChannelObject() , this property defines
- * the delivery system descriptor (tuning parameters) as defined by DVB-SI [EN 300 468] section 6.2.13.
- *
- * The dsd property provides a string whose characters shall be restricted to the ISO Latin-1 character set.
- * Each character in the dsd represents a byte of a delivery system descriptor as defined by DVB-SI [EN 300
- * 468] section 6.2.13, such that a byte at position "i" in the delivery system descriptor is equal the Latin-1
- * character code of the character at position "i" in the dsd.
- *
- * Described in the syntax of JavaScript: let sdd[] be the byte array of a system delivery descriptor, in which
- * sdd[0] is the descriptor_tag, then, dsd is its equivalent string, if :
- * dsd.length==sdd.length and
- * for each integer i : 0<=i<dsd.length holds: sdd[i] == dsd.charCodeAt(i).
- */
- dsd: null,
-
- /*
- * Description:
- * ATSC source_ID value.
- *
- * Visibility Type: readonly Integer
- */
- sourceId: null,
-
- /*
- * Description:
- * If the channel has an idType of ID_IPTV_SDS, this property denotes the DVB textual service identifier of the
- * IP broadcast service, specified in the format “ServiceName.DomainName” with the ServiceName and
- * DomainName as defined in [DVB-IPTV].
- * If the Channel has an idType of ID_IPTV_URI, this element denotes a URI of the IP broadcast service.
- *
- * Visibility Type: readonly String
- */
- ipBroadcastID: null,
-
- locked: null,
+ /*
+ * Description:
+ * DVB or ISDB original network ID.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.onid = null;
- init: function () {
- var dispatcher = {
+ /*
+ * Description:
+ * DVB or ISDB transport stream ID.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.tsid = null;
+
+ /*
+ * Description:
+ * DVB or ISDB service ID.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.sid = null;
+
+ /*
+ * Description:
+ * For channels of type ID_DVB_SI_DIRECT created through createChannelObject() , this property defines
+ * the delivery system descriptor (tuning parameters) as defined by DVB-SI [EN 300 468] section 6.2.13.
+ *
+ * The dsd property provides a string whose characters shall be restricted to the ISO Latin-1 character set.
+ * Each character in the dsd represents a byte of a delivery system descriptor as defined by DVB-SI [EN 300
+ * 468] section 6.2.13, such that a byte at position "i" in the delivery system descriptor is equal the Latin-1
+ * character code of the character at position "i" in the dsd.
+ *
+ * Described in the syntax of JavaScript: let sdd[] be the byte array of a system delivery descriptor, in which
+ * sdd[0] is the descriptor_tag, then, dsd is its equivalent string, if :
+ * dsd.length==sdd.length and
+ * for each integer i : 0<=i<dsd.length holds: sdd[i] == dsd.charCodeAt(i).
+ */
+ this.dsd = null;
+
+ /*
+ * Description:
+ * ATSC source_ID value.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.sourceId = null;
+
+ /*
+ * Description:
+ * If the channel has an idType of ID_IPTV_SDS, this property denotes the DVB textual service identifier of the
+ * IP broadcast service, specified in the format “ServiceName.DomainName” with the ServiceName and
+ * DomainName as defined in [DVB-IPTV].
+ * If the Channel has an idType of ID_IPTV_URI, this element denotes a URI of the IP broadcast service.
+ *
+ * Visibility Type: readonly String
+ */
+ this.ipBroadcastID = null;
+
+ this.locked = null;
+
+ var dispatcher = {
1: "_createChannelFromConf",
- 3: "_createChannelATSC_T",
- 4: "_createChannelDVB_SI_DIRECT",
- 5: "_createChannelDVBOrISDB",
+ 3: "_createChannelATSC_T",
+ 4: "_createChannelDVB_SI_DIRECT",
+ 5: "_createChannelDVBOrISDB",
6: "_createChannelIPTV"
};
-
- (arguments.length != 6) && this._setCcid(createUUID());
+
+ (arguments.length !== 6) && this._setCcid(createUUID());
this[dispatcher[arguments.length]].apply(this, arguments);
- },
-
- _createChannelATSC_T: function(idType, sourceID, name) {
+ }
+
+ _createChannelATSC_T(idType, sourceID, name) {
this.idType = idType;
this.sourceID = sourceID;
this.name = name;
- },
-
- _createChannelIPTV: function(idType, onid, tsid, sid, ipBroadcastID, name) {
+ }
+
+ _createChannelIPTV(idType, onid, tsid, sid, ipBroadcastID, name) {
this.idType = idType;
this.ipBroadcastID = ipBroadcastID;
this.name = name;
- if (idType == 41) {
+ if (idType === 41) {
this.onid = onid;
this.tsid = tsid;
this.sid = sid;
}
- },
-
- _createChannelDVBOrISDB: function(idType, onid, tsid, sid, name){
+ }
+
+ _createChannelDVBOrISDB(idType, onid, tsid, sid, name) {
this.idType = idType;
this.onid = onid;
this.tsid = tsid;
this.sid = sid;
this.name = name;
- },
-
- _createChannelDVB_SI_DIRECT: function(idType, dsd, sid, name){
+ }
+
+ _createChannelDVB_SI_DIRECT(idType, dsd, sid, name) {
this.idType = idType;
this.dsd = dsd;
this.sid = sid;
this.name = name;
- },
-
- _setCcid: function(ccid) {
+ }
+
+ _setCcid(ccid) {
this.ccid = ccid.toString();
- },
-
- _createChannelFromConf: function(channelConf) {
+ }
+
+ _createChannelFromConf(channelConf) {
oipf.utils.initProperties.call(this, channelConf);
}
-
-});
\ No newline at end of file
+
+}
Modified: oipf/lib/js/impl/model/ChannelList.js
===================================================================
--- oipf/lib/js/impl/model/ChannelList.js 2015-06-09 14:37:23 UTC (rev 1654)
+++ oipf/lib/js/impl/model/ChannelList.js 2015-06-09 15:07:19 UTC (rev 1655)
@@ -1,16 +1,15 @@
/*
-* Description:
+* Description:
* A ChannelList represents a collection of Channel objects. See Annex K for the definition of the collection template.
* In addition to the methods and properties defined for generic collections, the ChannelList class supports the additional
* properties and methods defined below.
-*
*/
-var ChannelList = Collection.extend({
+class ChannelList extends Collection{
- init: function() {
- this.super.init.apply(this, arguments);
- },
-
+ constructor(...args) {
+ super(...args);
+ }
+
/*
* Description:
* Return the first channel in the list with the specified channel identifier. Returns null if no
@@ -23,9 +22,9 @@
*
* Return: Channel
*/
- getChannel: function(channelID) {
+ getChannel(channelID) {
for (var i = 0; i < this.length; i++) {
- var channel = (this)[i];
+ var channel = this[i];
console.log("channelId:38" == "channelId:38" , channel.channelId, channelID, "----------------OUT", channel);
console.log(channel.channelId, channelID, "-----------------");
if (channel.channelId == channelID) {
@@ -34,8 +33,8 @@
}
}
return null;
- },
-
+ }
+
/*
* Description:
* Return the first (IPTV or non-IPTV) channel in the list that matches the specified DVB or
@@ -59,7 +58,7 @@
*
* Return: Channel
*/
- getChannelByTriplet: function(onid, tsid, sid, nid) {
+ getChannelByTriplet(onid, tsid, sid, nid) {
var self = this;
if (nid) {
@@ -80,12 +79,12 @@
for (var i = 0, l = this.length; i < l; i++) {
test(i);
}
-
+
return null;
- },
-
+ }
+
/*
- * Description:
+ * Description:
* Return the first (IPTV or non-IPTV) channel in the list with the specified ATSC source ID.
* Where no channels of type ID_ATSC_* are available, or no channel with the specified
@@ -96,8 +95,8 @@
*
* Return: Channel
*/
- getChannelBySourceID: function(sourceID) {
-
+ getChannelBySourceID(sourceID) {
+
for (var i = 0, l = this.length; i < l; i++) {
if (this[i].sourceID == sourceID) {
return this[i];
@@ -105,4 +104,4 @@
}
}
-});
\ No newline at end of file
+}
Modified: oipf/lib/js/impl/model/Collection.js
===================================================================
--- oipf/lib/js/impl/model/Collection.js 2015-06-09 14:37:23 UTC (rev 1654)
+++ oipf/lib/js/impl/model/Collection.js 2015-06-09 15:07:19 UTC (rev 1655)
@@ -1,20 +1,10 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
+class Collection extends Array{
-var Collection = Array.extend({
-
- init: function() {
- this.push.apply(this, arguments);
- },
-
- item: function(index) {
- return this[index];
+ constructor(...args) {
+ super(...args);
}
-});
-
-
-
+ item(index) {
+ return this[index];
+ }
+}
Modified: oipf/lib/js/impl/model/Configuration.js
===================================================================
--- oipf/lib/js/impl/model/Configuration.js 2015-06-09 14:37:23 UTC (rev 1654)
+++ oipf/lib/js/impl/model/Configuration.js 2015-06-09 15:07:19 UTC (rev 1655)
@@ -1,154 +1,155 @@
-var Configuration = Class.extend({
-
- /*
- * Description:
- * A comma-separated set of languages to be used for audio playback, in order of preference. Each language SHALL be indicated by its ISO 639-2 language code as * defined in [ISO 639-2].
- *
- * Type: String
- */
- preferredAudioLanguage: null,
+class Configuration {
- /*
- * Description:
- * A comma-separated set of languages to be used for subtitle playback, in order of preference. The subtitle
- * component (see section 7.16.5.5) that matches the highest ordered language SHALL be activated
- * (equivelant to the selectComponent method) and all other subtitle components SHALL be deactivated
- * (equivelant to the unselectComponent method).
- * Each language SHALL be indicated by its ISO 639-2 language code as defined in [ISO 639-2] or as a
- * wildcard specifier " *** ".
- * If the wildcard is included it SHALL be the last item in the set. If no subtitle component in the content
- * matches a language in this property and the wildcard is included then the first (lowest) subtitle component
- * SHALL be selected.
- *
- * Type: String
- */
- preferredSubtitleLanguage: null,
+ constructor(defaultProperties) {
+ /*
+ * Description:
+ * A comma-separated set of languages to be used for audio playback, in order of preference. Each language SHALL be
+ * indicated by its ISO 639-2 language code as defined in [ISO 639-2].
+ *
+ * Type: String
+ */
+ this.preferredAudioLanguage = null;
- /*
- * Description:
- * A comma-separated set of languages to be used for the user interface of a service, in order of preference.
- * Each language SHALL be indicated by its ISO 639-2 language code as defined in [ISO 639-2].
- * If present, the HTTP Accept-language header shall contain the same languages as the
- * preferredUILanguage property with the same order of preference. NOTE: The order of preference in the
- * Accept-language header is indicated using the quality factor.
- *
- * Type: String
- */
- preferredUILanguage: null,
+ /*
+ * Description:
+ * A comma-separated set of languages to be used for subtitle playback, in order of preference. The subtitle
+ * component (see section 7.16.5.5) that matches the highest ordered language SHALL be activated
+ * (equivelant to the selectComponent method) and all other subtitle components SHALL be deactivated
+ * (equivelant to the unselectComponent method).
+ * Each language SHALL be indicated by its ISO 639-2 language code as defined in [ISO 639-2] or as a
+ * wildcard specifier " *** ".
+ * If the wildcard is included it SHALL be the last item in the set. If no subtitle component in the content
+ * matches a language in this property and the wildcard is included then the first (lowest) subtitle component
+ * SHALL be selected.
+ *
+ * Type: String
+ */
+ this.preferredSubtitleLanguage = null;
- /*
- * Description:
- * An ISO-3166 three character country code identifying the country in which the receiver is deployed.
- *
- * Type: String
- */
- countryId: null,
-
- /*
- * Description:
- * An integer indicating the time zone within a country in which the receiver is deployed. A value of 0 SHALL
- * represent the eastern-most time zone in the country, a value of 1 SHALL represent the next time zone to
- * the west, and so on. Valid values are in the range 0 – 60.
- *
- * Type: Integer
- */
- regionId: null,
-
- /*
- * Description:
- * The policy dictates what mechanism the system should use when storage space is exceeded.
- * Valid values are shown in the table below.
- * ------------------------------------------------------------------------------------------------
- * Value | Description
- * ------ -----------------------------------------------------------------------------------------
- * 0 | Indicates a recording management policy where no recordings are to be deleted.
- * ------ -----------------------------------------------------------------------------------------
- * 1 | Indicates a recording management policy where only watched recordings MAY be deleted.
- * ------ -----------------------------------------------------------------------------------------
- * 2 | Indicates a recording management policy where only recordings older than the specified
- * | threshold (given by the pvrSaveDays and pvrSaveEpisodes properties) MAY be deleted.
- * ------------------------------------------------------------------------------------------------
- *
- * Type: Integer
- */
- pvrPolicy: null,
+ /*
+ * Description:
+ * A comma-separated set of languages to be used for the user interface of a service, in order of preference.
+ * Each language SHALL be indicated by its ISO 639-2 language code as defined in [ISO 639-2].
+ * If present, the HTTP Accept-language header shall contain the same languages as the
+ * preferredUILanguage property with the same order of preference. NOTE: The order of preference in the
+ * Accept-language header is indicated using the quality factor.
+ *
+ * Type: String
+ */
+ this.preferredUILanguage = null;
+ /*
+ * Description:
+ * An ISO-3166 three character country code identifying the country in which the receiver is deployed.
+ *
+ * Type: String
+ */
+ this.countryId = null;
- /*
- * Description:
- * When the pvrPolicy property is set to the value 2, this property indicates the minimum number of
- * episodes that SHALL be saved for series-link recordings.
- *
- * Type: Integer
- */
- pvrSaveEpisodes: null,
+ /*
+ * Description:
+ * An integer indicating the time zone within a country in which the receiver is deployed. A value of 0 SHALL
+ * represent the eastern-most time zone in the country, a value of 1 SHALL represent the next time zone to
+ * the west, and so on. Valid values are in the range 0 – 60.
+ *
+ * Type: Integer
+ */
+ this.regionId = null;
-
- /*
- * Description:
- * When the pvrPolicy property is set to the value 2, this property indicates the minimum save time (in
- * days) for individual recordings. Only recordings older than the save time MAY be deleted.
- *
- * Type: Integer
- */
- pvrSaveDays: null,
+ /*
+ * Description:
+ * The policy dictates what mechanism the system should use when storage space is exceeded.
+ * Valid values are shown in the table below.
+ * ------------------------------------------------------------------------------------------------
+ * Value | Description
+ * ------ -----------------------------------------------------------------------------------------
+ * 0 | Indicates a recording management policy where no recordings are to be deleted.
+ * ------ -----------------------------------------------------------------------------------------
+ * 1 | Indicates a recording management policy where only watched recordings MAY be deleted.
+ * ------ -----------------------------------------------------------------------------------------
+ * 2 | Indicates a recording management policy where only recordings older than the specified
+ * | threshold (given by the pvrSaveDays and pvrSaveEpisodes properties) MAY be deleted.
+ * ------------------------------------------------------------------------------------------------
+ *
+ * Type: Integer
+ */
+ this.pvrPolicy = null;
-
- /*
- * Description:
- * The default padding (measured in seconds) to be added at the start of a recording.
- *
- * Type: Integer
- */
- pvrStartPadding: null,
- /*
- * Description:
- * The default padding (measured in seconds) to be added at the end of a recording.
- *
- * Type: Integer
- */
- pvrEndPadding: null,
-
-
- /*
- * Description:
- * The time shift mode indicates the preferred mode of operation for support of timeshift playback in the
- * video/broadcast object. Valid values are defined in the timeShiftMode property in section 7.13.2.2. The
- * default value is 0, timeshift is turned off.
- *
- * Type: Integer
- */
- preferredTimeShiftMode: null,
-
- init: function(defaultProperties) {
+ /*
+ * Description:
+ * When the pvrPolicy property is set to the value 2, this property indicates the minimum number of
+ * episodes that SHALL be saved for series-link recordings.
+ *
+ * Type: Integer
+ */
+ this.pvrSaveEpisodes = null;
+
+
+ /*
+ * Description:
+ * When the pvrPolicy property is set to the value 2, this property indicates the minimum save time (in
+ * days) for individual recordings. Only recordings older than the save time MAY be deleted.
+ *
+ * Type: Integer
+ */
+ this.pvrSaveDays = null;
+
+
+ /*
+ * Description:
+ * The default padding (measured in seconds) to be added at the start of a recording.
+ *
+ * Type: Integer
+ */
+ this.pvrStartPadding = null;
+
+ /*
+ * Description:
+ * The default padding (measured in seconds) to be added at the end of a recording.
+ *
+ * Type: Integer
+ */
+ this.pvrEndPadding = null;
+
+
+ /*
+ * Description:
+ * The time shift mode indicates the preferred mode of operation for support of timeshift playback in the
+ * video/broadcast object. Valid values are defined in the timeShiftMode property in section 7.13.2.2. The
+ * default value is 0, timeshift is turned off.
+ *
+ * Type: Integer
+ */
+ this.preferredTimeShiftMode = null;
+
oipf.utils.initProperties.call(this, defaultProperties);
this._keys = {};
- },
-
+ }
+
/*
- * Description:
+ * Description:
* Get the system text string that has been set for the specified key.
*
- * Argument:
+ * Argument:
* -key: A key identifying the system text string to be retrieved.
*
- * Return: String
+ * Return: String
*/
- getText: function(key) {
+ getText(key) {
return this._keys[key];
- },
-
+ }
+
/*
- * Description:
+ * Description:
* Set the system text string that has been set for the specified key. System text strings are
* used for automatically-generated messages in certain cases, e.g. parental control messages.
*
- * Arguments:
+ * Arguments:
* -key: The key for the text string to be set. Valid keys are:
* -----------------------------------------------------------------------------------------------------------------------------------------------------
* Key | Description
- * ------------------ ----------------------------------------------------------------------------------------------------------------------------------
+ * ------------------ ----------------------------------------------------------------------------------------------------------------------------------
* no_title | Text string used as the title for programmes and channels where no guide information is available. Defaults to “No information”
* ------------------ ----------------------------------------------------------------------------------------------------------------------------------
* no_synopsis | Text string used as the synopsis for programmes where no guide information is available. Defaults to “No further information
@@ -158,10 +159,10 @@
* -----------------------------------------------------------------------------------------------------------------------------------------------------
*
* -value: The new value for the system text string.
- *
+ *
*/
- setText: function(key, value) {
+ setText(key, value) {
this._keys[key] = value;
}
-});
\ No newline at end of file
+}
Modified: oipf/lib/js/impl/model/FavouriteList.js
===================================================================
--- oipf/lib/js/impl/model/FavouriteList.js 2015-06-09 14:37:23 UTC (rev 1654)
+++ oipf/lib/js/impl/model/FavouriteList.js 2015-06-09 15:07:19 UTC (rev 1655)
@@ -1,15 +1,13 @@
-/*
+/*
* The FavouriteList class represents a list of favourite channels. See Annex K for the definition of the collection
* template. In addition to the methods and properties defined for generic collections, the FavouriteList class supports
* the additional properties and methods defined below.
* In order to preserve backwards compatibility with already existing DAE content the JavaScript toString() method
* SHALL return the FavouriteList.id for FavouriteList objects.
*/
-var FavouriteList = Array.extend({
-
- init: function() {
- this.push.apply(this, arguments);
- }
-});
+class FavouriteList extends Array {
-
+ constructor(...args) {
+ super(...args);
+ }
+}
Modified: oipf/lib/js/impl/model/FavouriteListCollection.js
===================================================================
--- oipf/lib/js/impl/model/FavouriteListCollection.js 2015-06-09 14:37:23 UTC (rev 1654)
+++ oipf/lib/js/impl/model/FavouriteListCollection.js 2015-06-09 15:07:19 UTC (rev 1655)
@@ -3,24 +3,24 @@
* definition of the collection template. In addition to the methods and properties defined for generic collections, the
* FavouriteListCollection class supports the additional methods defined below.
*/
-var FavouriteListCollection = Collection.extend({
-
- init: function() {
- this.super.init.apply(this, arguments);
- },
-
+class FavouriteListCollection extends Collection {
+
+ constructor(...args) {
+ super(...args);
+ }
+
/*
- * Description:
+ * Description:
* Return the first favourite list in the collection with the given favListID.
- *
+ *
* Arguments:
* - favID: The ID of a favourite list.
- *
- * Return: FavouriteList
+ *
+ * Return: FavouriteList
*/
- getFavouriteList: function(favID) {
-
+ getFavouriteList(favID) {
+
}
-
-});
+
+}
Modified: oipf/lib/js/impl/model/IntegerCollection.js
===================================================================
--- oipf/lib/js/impl/model/IntegerCollection.js 2015-06-09 14:37:23 UTC (rev 1654)
+++ oipf/lib/js/impl/model/IntegerCollection.js 2015-06-09 15:07:19 UTC (rev 1655)
@@ -1,12 +1,9 @@
/* Description:
* The IntegerCollection class represents a collection of Integer values. See Annex K for the definition of the
* collection template.
- *
*/
-
-var IntegerCollection = Collection.extend({
- init: function() {
- this.super.init.apply(this, arguments);
+class IntegerCollection extends Collection {
+ constructor(...args) {
+ super(...args);
}
-});
-
+}
Modified: oipf/lib/js/impl/model/LNBInfo.js
===================================================================
--- oipf/lib/js/impl/model/LNBInfo.js 2015-06-09 14:37:23 UTC (rev 1654)
+++ oipf/lib/js/impl/model/LNBInfo.js 2015-06-09 15:07:19 UTC (rev 1655)
@@ -1,98 +1,95 @@
-/*
- * The LNBInfo object provides details on the LNB attached to a tuner.
+/*
+ * The LNBInfo object provides details on the LNB attached to a tuner.
* Setting any of the properties in this class results in an immediate update of
- * the LNB configuration that is active for the associated Tuner.
+ * the LNB configuration that is active for the associated Tuner.
* The LNB configuration is stored persistently.
- *
*/
+class LNBInfo {
-var LNBInfo = Class.extend({
-
- /*
- * A universal LNB that has two local oscillator frequency
- * settings available. The selection between the frequencies is
- * done by the presence of a 22 kHz control signal.
- */
- DUAL_LO_FREQ_LNB: 30,
-
-
- /*
- * Only a single local oscillator frequency is available in the LNB.
- */
- SINGLE_LO_FREQ_LNB: 31,
-
- /*
- * Description:
- * The type of LNB connected to the frontend.
- * Valid values are listed in section 7.3.11.1.
- *
- * Type: Integer
- */
- lnbType: null,
+ constructor(defaultProperties) {
+ /*
+ * A universal LNB that has two local oscillator frequency
+ * settings available. The selection between the frequencies is
+ * done by the presence of a 22 kHz control signal.
+ */
+ this.DUAL_LO_FREQ_LNB = 30;
- /*
- * Description:
- * The low or only, if a single local oscillator frequency LNB is used,
- * LNB local oscillator frequency in MHz.
- *
- * Type: Number
- */
- lnbLowFreq: null,
+ /*
+ * Only a single local oscillator frequency is available in the LNB.
+ */
+ this.SINGLE_LO_FREQ_LNB = 31;
- /*
- * Description:
- * If a dual local oscillator frequency LNB is used this is
- * the high LNB local oscillator frequency in MHz. If a single
- * local oscillator frequency LNB is used this argument shall be set to 0.
- *
- * Type: Number
- */
- lnbHighFreq: null,
+ /*
+ * Description:
+ * The type of LNB connected to the frontend.
+ * Valid values are listed in section 7.3.11.1.
+ *
+ * Type: Integer
+ */
+ this.lnbType = null;
- /*
- * Description:
- * Indicates the frequency (in MHz) when to switch between the high-
- * and low-band oscillator frequencies (lnbLowFreq and
- * lnbHighFreq respectively).
- *
- * Type: Number
- */
- crossoverFrequency: null,
+ /*
+ * Description:
+ * The low or only, if a single local oscillator frequency LNB is used,
+ * LNB local oscillator frequency in MHz.
+ *
+ * Type: Number
+ */
+ this.lnbLowFreq = null;
- /*
- * Description:
- * Indicates the lowest frequency, in MHz, that the LNB can be used for.
- *
- * Type: Number
- */
- lnbStartFrequency: null,
+ /*
+ * Description:
+ * If a dual local oscillator frequency LNB is used this is
+ * the high LNB local oscillator frequency in MHz. If a single
+ * local oscillator frequency LNB is used this argument shall be set to 0.
+ *
+ * Type: Number
+ */
+ this.lnbHighFreq = null;
- /*
- * Description:
- * Indicates the highest frequency, in MHz, that the LNB can be used for.
- *
- * Type: Number
- */
- lnbStopFrequency: null,
+ /*
+ * Description:
+ * Indicates the frequency (in MHz) when to switch between the high-
+ * and low-band oscillator frequencies (lnbLowFreq and
+ * lnbHighFreq respectively).
+ *
+ * Type: Number
+ */
+ this.crossoverFrequency = null;
- /*
- * Description:
- * Indicates the orbital position of the satellite in degrees, negative
- * value for west, positive value for east.
- * For example, Astra 19.2 East would have orbitalPosition 19.2.
- * Thor 0.8 West would have orbitalPosition -0.8.
- * This property, if provided, will be used to select a Tuner instance
- * (when scanning and tuning). Setting any value which is not a valid
- * orbital position (an absolute value greater than 180) indicates
- * that the orbital position need not be considered when using
- * the associated tuner.
- *
- * Type: Number
- */
- orbitalPosition: null,
-
- init: function(defaultProperties) {
+ /*
+ * Description:
+ * Indicates the lowest frequency, in MHz, that the LNB can be used for.
+ *
+ * Type: Number
+ */
+ this.lnbStartFrequency = null;
+
+ /*
+ * Description:
+ * Indicates the highest frequency, in MHz, that the LNB can be used for.
+ *
+ * Type: Number
+ */
+ this.lnbStopFrequency = null;
+
+ /*
+ * Description:
+ * Indicates the orbital position of the satellite in degrees, negative
+ * value for west, positive value for east.
+ * For example, Astra 19.2 East would have orbitalPosition 19.2.
+ * Thor 0.8 West would have orbitalPosition -0.8.
+ * This property, if provided, will be used to select a Tuner instance
+ * (when scanning and tuning). Setting any value which is not a valid
+ * orbital position (an absolute value greater than 180) indicates
+ * that the orbital position need not be considered when using
+ * the associated tuner.
+ *
+ * Type: Number
+ */
+ this.orbitalPosition = null;
+
oipf.utils.initProperties.call(this, defaultProperties);
}
-
-});
+
+}
Modified: oipf/lib/js/impl/model/LocalSystem.js
===================================================================
--- oipf/lib/js/impl/model/LocalSystem.js 2015-06-09 14:37:23 UTC (rev 1654)
+++ oipf/lib/js/impl/model/LocalSystem.js 2015-06-09 15:07:19 UTC (rev 1655)
@@ -1,380 +1,380 @@
/*
* Description:
* The LocalSystem object allows hardware settings related to the local device to be read and modified.
-*
+*
* Note: The standbyState property has been removed from this class.
*/
-var LocalSystem = Class.extend({
-
- /*
- * The OITF is in the off state and no power is consumed.
- * This is the case of a power outage or if the OITF has the
- * ability to be completely turned off. Scheduled recording is
- * not expected to work.
- */
- OFF: 0,
-
- /*
- * The OITF is in normal working mode with user
- * interaction. The DAE applications may render any
- * presentation graphically.
- */
- ON: 1,
-
- /*
- * The OITF is in the lowest possible power consumption
- * state (meeting regulations and certifications). The OITF
- * may support wake-up from a passive standby in order, for
- * example, to perform a scheduled recording.
- */
- PASSIVE_STANDBY: 2,
-
- /*
- * The OITF is in an intermediate power consumption state.
- * The output to the display shall be inactive. In this state
- * DAE applications may continue to operate.
- */
- ACTIVE_STANDBY: 3,
-
- /*
- * The OITF is in the lowest possible power consumption
- * state (meeting regulations and certifications). If th
- * platform supports hibernate mode then the OITF stores
- * all applications in volatile memory to allow for quick
- * startup.
- */
- PASSIVE_STANDBY_HIBERNATE: 4,
-
- /*
- * The OITF shall restart and return to a ON state.
- */
- RESTART: 5,
-
- /*
- * Restart the OITF and reset all settings and data to an
- * initial/factory state. The exact settings and data to be
- * reset are implementation dependant. The use of the this
- * operation with the setPowerState method is subject to
- * security control defined in section 10.1.3.8
- */
- FACTORY_RESET: 6,
-
- /*
- * No startup URL is known.
- */
- STARTUP_URL_NONE: 0,
-
- /*
- * The startup URL is derived from DHCP procedures.
- */
- STARTUP_URL_DHCP: 1,
-
- /*
- * The startup URL is derived through TR-069 procedures.
- */
- STARTUP_URL_TR069: 2,
-
- /*
- * The startup URL is that which is configured through the OITF firmware.
- */
- STARTUP_URL_PRECONFIGURED: 3,
-
- /*
- * The startup URL is obtained through other
- * (perhaps non-standardized) procedures.
- */
- STARTUP_URL_OTHER: 9,
-
- /*
- * Description:
- * Private OITF Identifier. This property SHALL take the value undefined
- * except when accessed by applications meeting
- * either of the following criteria:
- *
- * - The application is signalled in an SD&S service provider discovery
- * record with an application usage of
- * urn:oipf:cs:ApplicationUsageCS:2009:hni-igi where
- * the SD&S service provider discovery record was obtained by
- * the OITF through the procedure defined in section 5.4.1.2 of [OIPF_PROT2].
- *
- * - The URL of the application was discovered directly through
- * the procedure defined in section 5.4.1.2 of [OIPF_PROT2].
- *
- * In these two cases, it SHALL take the same value as defined for the
- * DHCP client identifier in DHCP option 61
- * in section 12.1.1.1 of [OIPF_PROT2].
- *
- * Visibility Type: readonly String
- */
- deviceID: undefined,
-
- /*
- * Description:
- * Indicates whether the system has finished initialising.
- * A value of true indicates that the system is ready.
- *
- * Visibility Type: readonly Boolean
- */
- systemReady: null,
+class LocalSystem {
- /*
- * Description:
- * String identifying the vendor name of the device.
- *
- * Visibility Type: readonly String
- */
- vendorName: null,
-
- /*
- * Description:
- * String identifying the model name of the device.
- *
- * Visibility Type: readonly String
- */
- modelName: null,
-
- /*
- * Description:
- * String identifying the name of the family that the device belongs to.
- * Devices in a family differ only by details that do not impact
- * the behaviour of the OITF aspect of the device, e.g. screen size,
- * remote control, number of HDMI ports, size of hard disc.
- * Family names are allocated by the vendor and the combination of
- * vendorName and familyName should uniquely identify a family of devices.
- * Different vendors may use the same familyName, although
- * they are recommended to use conventions that avoid this.
- *
- * Visibility Type: readonly String
- */
- familyName: null,
+ constructor(defaultProperties) {
+ /*
+ * The OITF is in the off state and no power is consumed.
+ * This is the case of a power outage or if the OITF has the
+ * ability to be completely turned off. Scheduled recording is
+ * not expected to work.
+ */
+ this.OFF = 0;
- /*
- * Description:
- * String identifying the version number of the platform firmware.
- *
- * Visibility Type: readonly String
- */
- softwareVersion: null,
-
- /*
- * Description:
- * String identifying the version number of the platform firmware.
- *
- * Visibility Type: readonly String
- */
- hardwareVersion: null,
-
- /*
- * Description:
- * String identifying the version number of the platform firmware.
- *
- * Visibility Type: readonly String
- */
- serialNumber: null,
-
- /*
- * Description:
- * Release version of the OIPF specification implemented by the OITF.
- * For instance, if the OITF implements release 2 version “1.0”,
- * this property should be set to 2.
- *
- * Visibility Type: readonly Integer
- */
- releaseVersion: null,
-
- /*
- * Description:
- * Major version of the OIPF specification implemented by the OITF.
- * For instance, if the OITF implements release 2 version “2.0”,
- * this property should be set to 2.
- *
- * Visibility Type: readonly Integer
- */
- majorVersion: null,
-
- /*
- * Description:
- * Minor version of the OIPF specification implemented by the OITF.
- * For instance, if the OITF implements release 2 version “2.0”,
- * this property should be set to 0.
- *
- * Visibility Type: readonly Integer
- */
- minorVersion: null,
-
- /*
- * Description:
- * Profile of the OIPF specification implemented by the OITF.
- * Values of this field are not defined in this specification.
- *
- * Visibility Type: readonly String
- */
- oipfProfile: null,
-
- /*
- * Description:
- * Flag indicating whether the platform has PVR capability (local PVR).
- * Note: This property is deprecated in favour of the pvrSupport property.
- *
- * Visibility Type: readonly Boolean
- */
- pvrEnabled: null,
-
- /*
- * Description:
- * Flag indicating whether the platform has CI+ capability.
- *
- * Visibility Type: readonly String
- */
- ciplusEnabled: Boolean,
-
- /*
- * Description:
- * The powerState property provides the DAE application the ability
- * to determine the current state of the OITF.
- * The property is limited to the ACTIVE_STANDBY or ON states.
- *
- * Visibility Type: readonly Integer
- */
- powerState: null,
-
- /*
- * Description:
- * The previousPowerState property provides the DAE application the ability
- * to retrieve the previous state.
- *
- * Visibility Type: readonly String
- */
- previousPowerState: null,
-
- /*
- * Description:
- * The time that the OITF entered the current power state.
- * The time is represented in seconds since midnight (GMT) on 1/1/1970.
- *
- * Visibility Type: readonly String
- */
- timeCurrentPowerState: null,
-
- /*
- * Description:
- * Get or set the overall system volume. Valid values for this property are in the range 0 - 100. The OITF SHALL store this setting persistently.
- *
- * Type: Integer
- */
- volume: null,
+ /*
+ * The OITF is in normal working mode with user
+ * interaction. The DAE applications may render any
+ * presentation graphically.
+ */
+ this.ON = 1;
- /*
- * Description:
- * Get or set the mute status of the default audio output(s). A value of true indicates that the default output(s) are currently muted.
- *
- * Type: Boolean
- */
- mute: null,
-
- /*
- * Description:
- * A collection of Tuner objects representing the physical tuners available in the OITF.
- *
- * Visibility Type: readonly TunerCollection
- */
- tuners: null,
-
- /*
- * Description:
- * A collection of AVOutput objects representing the audio and video outputs of the platform. Applications
- * MAY use these objects to configure and control the available outputs.
- *
- * Visibility Type: readonly AVOutputCollection
- */
- outputs: null,
-
- /*
- * Description:
- * A collection of NetworkInterface objects representing
- * the available network interfaces.
- *
- * Visibility Type: readonly NetworkInterfaceCollection
- */
- networkInterfaces: null,
-
- /*
- * Description:
- * Read whether the display is currently in a 2D or 3D mode.
- * Return values are:
- * ------------------------------------------------------------------------
- * Value | Description
- * ------------- ----------------------------------------------------------
- * 1 | Indicates platform support for the NTSC TV standard.
- * ------------- ----------------------------------------------------------
- * 2 | Indicates platform support for the PAL-BGH TV standard.
- * ------------- ----------------------------------------------------------
- * 4 | Indicates platform support for the SECAM TV standard.
- * ------------- ----------------------------------------------------------
- * 8 | Indicates platform support for the PAL-M TV standard.
- * ------------- ----------------------------------------------------------
- * 16 | Indicates platform support for the PAL-N TV standard.
- * ------------------------------------------------------------------------
- * Values are stored as a bitfield.
- *
- * Visibility Type: Integer
- */
- tvStandardsSupported: null,
-
- /*
- * Description:
- * Get the TV standard for which the analogue video outputs are currently
- * configured. This property can take one or more of the following values:
- * ------------------------------------------------------------------------
- * Value | Description
- * ------------- ----------------------------------------------------------
- * 0 | Indicates there are no analogue video outputs
- * ------------- ----------------------------------------------------------
- * 1 | Indicates platform support for the NTSC TV standard.
- * ------------- ----------------------------------------------------------
- * 2 | Indicates platform support for the PAL-BGH TV standard.
- * ------------- ----------------------------------------------------------
- * 4 | Indicates platform support for the SECAM TV standard.
- * ------------- ----------------------------------------------------------
- * 8 | Indicates platform support for the PAL-M TV standard.
- * ------------- ----------------------------------------------------------
- * 16 | Indicates platform support for the PAL-N TV standard.
- * ------------------------------------------------------------------------
- *
- * Visibility Type: Integer
- */
- tvStandard: null,
-
- /*
- * Description:
- * Flag indicating the type of PVR support used by the application.
- * This property may take zero or more of the following values:
- * ------------------------------------------------------------------------
- * Value | Description
- * ------------- ----------------------------------------------------------
- * | PVR functionality is not supported. This is the default
- * 0 | value if <recording> as specified in section 9.3.3
- * | has value false .
- * ------------- ----------------------------------------------------------
- * | PVR functionality is not supported. This is the default
- * 1 | value if <recording> as specified in section 9.3.3
- * | has value false .
- * ------------- ----------------------------------------------------------
- *
- * Visibility Type: readonly Integer
- */
- pvrSupport: null,
-
- /*
- * Description:
- * A collection of NetworkInterface objects representing
- * the available network interfaces.
- *
- * Visibility Type: readonly NetworkInterfaceCollection
- */
- startupInformation: null,
-
- init: function(defaultProperties) {
+ /*
+ * The OITF is in the lowest possible power consumption
+ * state (meeting regulations and certifications). The OITF
+ * may support wake-up from a passive standby in order, for
+ * example, to perform a scheduled recording.
+ */
+ this.PASSIVE_STANDBY = 2;
+
+ /*
+ * The OITF is in an intermediate power consumption state.
+ * The output to the display shall be inactive. In this state
+ * DAE applications may continue to operate.
+ */
+ this.ACTIVE_STANDBY = 3;
+
+ /*
+ * The OITF is in the lowest possible power consumption
+ * state (meeting regulations and certifications). If th
+ * platform supports hibernate mode then the OITF stores
+ * all applications in volatile memory to allow for quick
+ * startup.
+ */
+ this.PASSIVE_STANDBY_HIBERNATE = 4;
+
+ /*
+ * The OITF shall restart and return to a ON state.
+ */
+ this.RESTART = 5;
+
+ /*
+ * Restart the OITF and reset all settings and data to an
+ * initial/factory state. The exact settings and data to be
+ * reset are implementation dependant. The use of the this
+ * operation with the setPowerState method is subject to
+ * security control defined in section 10.1.3.8
+ */
+ this.FACTORY_RESET = 6;
+
+ /*
+ * No startup URL is known.
+ */
+ this.STARTUP_URL_NONE = 0;
+
+ /*
+ * The startup URL is derived from DHCP procedures.
+ */
+ this.STARTUP_URL_DHCP = 1;
+
+ /*
+ * The startup URL is derived through TR-069 procedures.
+ */
+ this.STARTUP_URL_TR069 = 2;
+
+ /*
+ * The startup URL is that which is configured through the OITF firmware.
+ */
+ this.STARTUP_URL_PRECONFIGURED = 3;
+
+ /*
+ * The startup URL is obtained through other
+ * (perhaps non-standardized) procedures.
+ */
+ this.STARTUP_URL_OTHER = 9;
+
+ /*
+ * Description:
+ * Private OITF Identifier. This property SHALL take the value undefined
+ * except when accessed by applications meeting
+ * either of the following criteria:
+ *
+ * - The application is signalled in an SD&S service provider discovery
+ * record with an application usage of
+ * urn:oipf:cs:ApplicationUsageCS:2009:hni-igi where
+ * the SD&S service provider discovery record was obtained by
+ * the OITF through the procedure defined in section 5.4.1.2 of [OIPF_PROT2].
+ *
+ * - The URL of the application was discovered directly through
+ * the procedure defined in section 5.4.1.2 of [OIPF_PROT2].
+ *
+ * In these two cases, it SHALL take the same value as defined for the
+ * DHCP client identifier in DHCP option 61
+ * in section 12.1.1.1 of [OIPF_PROT2].
+ *
+ * Visibility Type: readonly String
+ */
+ this.deviceID = undefined;
+
+ /*
+ * Description:
+ * Indicates whether the system has finished initialising.
+ * A value of true indicates that the system is ready.
+ *
+ * Visibility Type: readonly Boolean
+ */
+ this.systemReady = null;
+
+ /*
+ * Description:
+ * String identifying the vendor name of the device.
+ *
+ * Visibility Type: readonly String
+ */
+ this.vendorName = null;
+
+ /*
+ * Description:
+ * String identifying the model name of the device.
+ *
+ * Visibility Type: readonly String
+ */
+ this.modelName = null;
+
+ /*
+ * Description:
+ * String identifying the name of the family that the device belongs to.
+ * Devices in a family differ only by details that do not impact
+ * the behaviour of the OITF aspect of the device, e.g. screen size,
+ * remote control, number of HDMI ports, size of hard disc.
+ * Family names are allocated by the vendor and the combination of
+ * vendorName and familyName should uniquely identify a family of devices.
+ * Different vendors may use the same familyName, although
+ * they are recommended to use conventions that avoid this.
+ *
+ * Visibility Type: readonly String
+ */
+ this.familyName = null;
+
+ /*
+ * Description:
+ * String identifying the version number of the platform firmware.
+ *
+ * Visibility Type: readonly String
+ */
+ this.softwareVersion = null;
+
+ /*
+ * Description:
+ * String identifying the version number of the platform firmware.
+ *
+ * Visibility Type: readonly String
+ */
+ this.hardwareVersion = null;
+
+ /*
+ * Description:
+ * String identifying the version number of the platform firmware.
+ *
+ * Visibility Type: readonly String
+ */
+ this.serialNumber = null;
+
+ /*
+ * Description:
+ * Release version of the OIPF specification implemented by the OITF.
+ * For instance, if the OITF implements release 2 version “1.0”,
+ * this property should be set to 2.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.releaseVersion = null;
+
+ /*
+ * Description:
+ * Major version of the OIPF specification implemented by the OITF.
+ * For instance, if the OITF implements release 2 version “2.0”,
+ * this property should be set to 2.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.majorVersion = null;
+
+ /*
+ * Description:
+ * Minor version of the OIPF specification implemented by the OITF.
+ * For instance, if the OITF implements release 2 version “2.0”,
+ * this property should be set to 0.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.minorVersion = null;
+
+ /*
+ * Description:
+ * Profile of the OIPF specification implemented by the OITF.
+ * Values of this field are not defined in this specification.
+ *
+ * Visibility Type: readonly String
+ */
+ this.oipfProfile = null;
+
+ /*
+ * Description:
+ * Flag indicating whether the platform has PVR capability (local PVR).
+ * Note: This property is deprecated in favour of the pvrSupport property.
+ *
+ * Visibility Type: readonly Boolean
+ */
+ this.pvrEnabled = null;
+
+ /*
+ * Description:
+ * Flag indicating whether the platform has CI+ capability.
+ *
+ * Visibility Type: readonly String
+ */
+ this.ciplusEnabled = Boolean;
+
+ /*
+ * Description:
+ * The powerState property provides the DAE application the ability
+ * to determine the current state of the OITF.
+ * The property is limited to the ACTIVE_STANDBY or ON states.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.powerState = null;
+
+ /*
+ * Description:
+ * The previousPowerState property provides the DAE application the ability
+ * to retrieve the previous state.
+ *
+ * Visibility Type: readonly String
+ */
+ this.previousPowerState = null;
+
+ /*
+ * Description:
+ * The time that the OITF entered the current power state.
+ * The time is represented in seconds since midnight (GMT) on 1/1/1970.
+ *
+ * Visibility Type: readonly String
+ */
+ this.timeCurrentPowerState = null;
+
+ /*
+ * Description:
+ * Get or set the overall system volume. Valid values for this property are in the range 0 - 100. The OITF SHALL store this setting persistently.
+ *
+ * Type: Integer
+ */
+ this.volume = null;
+
+ /*
+ * Description:
+ * Get or set the mute status of the default audio output(s). A value of true indicates that the default output(s) are currently muted.
+ *
+ * Type: Boolean
+ */
+ this.mute = null;
+
+ /*
+ * Description:
+ * A collection of Tuner objects representing the physical tuners available in the OITF.
+ *
+ * Visibility Type: readonly TunerCollection
+ */
+ this.tuners = null;
+
+ /*
+ * Description:
+ * A collection of AVOutput objects representing the audio and video outputs of the platform. Applications
+ * MAY use these objects to configure and control the available outputs.
+ *
+ * Visibility Type: readonly AVOutputCollection
+ */
+ this.outputs = null;
+
+ /*
+ * Description:
+ * A collection of NetworkInterface objects representing
+ * the available network interfaces.
+ *
+ * Visibility Type: readonly NetworkInterfaceCollection
+ */
+ this.networkInterfaces = null;
+
+ /*
+ * Description:
+ * Read whether the display is currently in a 2D or 3D mode.
+ * Return values are:
+ * ------------------------------------------------------------------------
+ * Value | Description
+ * ------------- ----------------------------------------------------------
+ * 1 | Indicates platform support for the NTSC TV standard.
+ * ------------- ----------------------------------------------------------
+ * 2 | Indicates platform support for the PAL-BGH TV standard.
+ * ------------- ----------------------------------------------------------
+ * 4 | Indicates platform support for the SECAM TV standard.
+ * ------------- ----------------------------------------------------------
+ * 8 | Indicates platform support for the PAL-M TV standard.
+ * ------------- ----------------------------------------------------------
+ * 16 | Indicates platform support for the PAL-N TV standard.
+ * ------------------------------------------------------------------------
+ * Values are stored as a bitfield.
+ *
+ * Visibility Type: Integer
+ */
+ this.tvStandardsSupported = null;
+
+ /*
+ * Description:
+ * Get the TV standard for which the analogue video outputs are currently
+ * configured. This property can take one or more of the following values:
+ * ------------------------------------------------------------------------
+ * Value | Description
+ * ------------- ----------------------------------------------------------
+ * 0 | Indicates there are no analogue video outputs
+ * ------------- ----------------------------------------------------------
+ * 1 | Indicates platform support for the NTSC TV standard.
+ * ------------- ----------------------------------------------------------
+ * 2 | Indicates platform support for the PAL-BGH TV standard.
+ * ------------- ----------------------------------------------------------
+ * 4 | Indicates platform support for the SECAM TV standard.
+ * ------------- ----------------------------------------------------------
+ * 8 | Indicates platform support for the PAL-M TV standard.
+ * ------------- ----------------------------------------------------------
+ * 16 | Indicates platform support for the PAL-N TV standard.
+ * ------------------------------------------------------------------------
+ *
+ * Visibility Type: Integer
+ */
+ this.tvStandard = null;
+
+ /*
+ * Description:
+ * Flag indicating the type of PVR support used by the application.
+ * This property may take zero or more of the following values:
+ * ------------------------------------------------------------------------
+ * Value | Description
+ * ------------- ----------------------------------------------------------
+ * | PVR functionality is not supported. This is the default
+ * 0 | value if <recording> as specified in section 9.3.3
+ * | has value false .
+ * ------------- ----------------------------------------------------------
+ * | PVR functionality is not supported. This is the default
+ * 1 | value if <recording> as specified in section 9.3.3
+ * | has value false .
+ * ------------- ----------------------------------------------------------
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.pvrSupport = null;
+
+ /*
+ * Description:
+ * A collection of NetworkInterface objects representing
+ * the available network interfaces.
+ *
+ * Visibility Type: readonly NetworkInterfaceCollection
+ */
+ this.startupInformation = null;
+
this._listeners = {};
this._callbacks = {};
this._eventManager = new EventManager();
@@ -383,125 +383,121 @@
this._defaultProperties = defaultProperties;
oipf.utils.initProperties.call(this, defaultProperties.localSystem);
this.systemReady = true;
- },
-
+ }
+
/*
- * Description:
- * Set the resolution of the graphics plane. If the specified resolution
- * is not supported by the OITF, this method SHALL return false.
+ * Description:
+ * Set the resolution of the graphics plane. If the specified resolution
+ * is not supported by the OITF, this method SHALL return false.
* Otherwise, this method SHALL return true.
- *
+ *
* Arguments:
* - width: The width of the display, in pixels.
- *
+ *
* - height: The height of the display, in pixels.
- *
+ *
* Return: Boolean
*/
- setScreenSize: function(width, height) {
+ setScreenSize(width, height) {
var parameters = arguments;
-
+
if (parameters.length > 2) {
throw new TypeError("Excessive number of arguments.");
}
-
+
if (parameters.length < 2) {
throw new TypeError("Insufficient number of arguments.");
}
-
+
if (!Number.isInteger(width) && !Number.isInteger(height)) {
- throw new TypeError
- ("This function cannot be called with theses arguments.");
+ throw new TypeError("This function cannot be called with theses arguments.");
}
-
- var authorizedResolution =
- this._defaultProperties.screenSize[width+"x"+height];
-
+
+ var authorizedResolution = this._defaultProperties.screenSize[width + "x" + height];
+
if (authorizedResolution) {
this._width = width;
this._height = height;
-
+
return true;
}
-
+
return false;
-
- },
-
+
+ }
+
/*
- * Description:
- * Set the TV standard to be used on the analogue video outputs.
+ * Description:
+ * Set the TV standard to be used on the analogue video outputs.
* Returns false if the requested mode cannot be set.
- *
+ *
* Arguments:
- * - tvStandard: The TV standard to be set.
+ * - tvStandard: The TV standard to be set.
* Valid values are defined in the description of the
* tvStandard property in section 7.3.3.2.
- *
+ *
* Return: Boolean
- * FIXME: Yannis - 23/04/2015 - Take intp account that the value of
- * "tvStandard" can be stored as a bitfield.
+ * FIXME: Yannis - 23/04/2015 - Take intp account that the value of
+ * "tvStandard" can be stored as a bitfield.
*/
- setTVStandard: function(tvStandard) {
+ setTVStandard(tvStandard) {
var parameters = arguments;
-
+
if (parameters.length > 1) {
throw new TypeError("Excessive number of arguments.");
}
-
+
if (parameters.length < 1) {
throw new TypeError("Insufficient number of arguments.");
}
-
+
if (!Number.isInteger(arguments[0])) {
- throw new TypeError
- ("This function cannot be called with theses arguments.");
+ throw new TypeError("This function cannot be called with theses arguments.");
}
-
- var tvStandardSupported =
+
+ var tvStandardSupported =
this._defaultProperties.tvStandardsSupported[tvStandard];
if (tvStandardSupported) {
this.tvStandard = tvStandard;
return true;
}
-
+
return false;
- },
-
+ }
+
/*
- * Description:
- * Set the type of PVR support used by the application.
- * The types of PVR supported by the receiver MAY not be supported
+ * Description:
+ * Set the type of PVR support used by the application.
+ * The types of PVR supported by the receiver MAY not be supported
* by the application; in this case, the return value indicates
* the pvr support that has been set.
- *
+ *
* Arguments:
- * - state: The type of PVR support desired by the application.
- * More than one type of PVR functionality MAY be specified,
+ * - state: The type of PVR support desired by the application.
+ * More than one type of PVR functionality MAY be specified,
* allowing the receiver to automatically select the
* appropriate mechanism. Valid values are:
- *
+ *
* - height: The height of the display, in pixels.
- *
+ *
* Return: Boolean
*/
- setPvrSupport: function(state) {
+ setPvrSupport(state) {
var parameters = arguments;
-
+
if (parameters.length > 1) {
throw new TypeError("Excessive number of arguments.");
}
-
+
if (parameters.length < 1) {
throw new TypeError("Insufficient number of arguments.");
}
-
+
if (!Number.isInteger(state)) {
- throw new TypeError
- ("This function cannot be called with theses arguments.");
+ throw new TypeError("This function cannot be called with theses arguments.");
}
-
+
if (state == 0 || state == 1) {
this.pvrSupport = state;
return true;
@@ -509,44 +505,44 @@
this.pvrSupport = 0;
return this.pvrSupport;
}
-
- },
-
+
+ }
+
/*
- * Description:
+ * Description:
* The setPowerState() method allows the DAE application to
- * modify the OITF state. The power state change may be restricted
- * for some values of type, for example OFF, PASSIVE_STANDBY,
+ * modify the OITF state. The power state change may be restricted
+ * for some values of type, for example OFF, PASSIVE_STANDBY,
* RESTART and FACTORY_RESET . A call to setPowerState() with a
* restricted value of type SHALL return false .
- *
+ *
* Arguments:
- * - type: The type values that may be specified are defined
+ * - type: The type values that may be specified are defined
* in section 7.3.3.1
- *
+ *
* Return: Boolean
*/
- setPowerState: function(type) {
+ setPowerState(type) {
var parameters = arguments;
-
+
if (parameters.length > 1) {
throw new TypeError("Excessive number of arguments.");
}
-
+
if (parameters.length < 1) {
throw new TypeError("Insufficient number of arguments.");
}
-
+
if (!Number.isInteger(arguments[0])) {
- throw new TypeError
- ("This function cannot be called with theses arguments.");
+ throw new TypeError("This function cannot be called with theses arguments.");
}
-
- var restrictedPowerState =
+
+ var restrictedPowerState =
this._defaultProperties.restrictedPowerState[type];
-
+
if (restrictedPowerState) {
return false;
+
} else {
this.previousPowerState = this.powerState;
this.timeCurrentPowerState = new Date().getTime();
@@ -554,123 +550,121 @@
this._timeout()
.then(this._fireEvent.bind(
this, createCustomEvent("PowerStateChange", [this.powerState])));
-
+
return true;
}
-
- },
-
+ }
+
/*
- * Description:
+ * Description:
* Set the credentials for the specified protocol to use for digest a
- * uthentication negotiation for all subsequent requests to the specified
- * domain. The credentials are persistently stored overwriting any previous
- * set credentials. If domain is null the provided credentials SHALL apply
- * for all domains. Returns true if credentials are successfully set,
- * false otherwise.
- * If digest authentication is not supported for
- * the specified protocol then return false . The valid values are
- * the strings “ http ” and “ https ”.
- * Setting of Digest Credentials on the same protocol and domain
- * SHALL update the username and password.
- * If the credentials, when used, are incorrect then the behaviour
- * SHALL be the same as any other time that stored credentials
- * are incorrect, e.g. saved values from a user prompt.
- * The credentials SHALL be used (if necessary) in all requests
- * made by DAE applications. The credentials MAY be used in requests
+ * uthentication negotiation for all subsequent requests to the specified
+ * domain. The credentials are persistently stored overwriting any previous
+ * set credentials. If domain is null the provided credentials SHALL apply
+ * for all domains. Returns true if credentials are successfully set,
+ * false otherwise.
+ * If digest authentication is not supported for
+ * the specified protocol then return false . The valid values are
+ * the strings “ http ” and “ https ”.
+ * Setting of Digest Credentials on the same protocol and domain
+ * SHALL update the username and password.
+ * If the credentials, when used, are incorrect then the behaviour
+ * SHALL be the same as any other time that stored credentials
+ * are incorrect, e.g. saved values from a user prompt.
+ * The credentials SHALL be used (if necessary) in all requests
+ * made by DAE applications. The credentials MAY be used in requests
* made by other components such as media players, DLNA clients, etc.
- *
+ *
* Arguments:
* - protocol: The protocol to apply the credentials.
- *
+ *
* - domain: The domain to which the credentials apply.
- *
+ *
* - username: The username to be used in the digest authentication.
- *
+ *
* - password: The password to be used in the digest authentication.
- *
+ *
* Return: Boolean
*/
- setDigestCredentials: function(protocol, domain, username, password ) {
+ setDigestCredentials(protocol, domain, username, password ) {
if (protocol != "https" && protocol != "http") {
throw new Error("Invalid protocol.");
}
// Utiliser le localStorage pour stocker les information sionon utilisation d'un fichier simplement
- },
-
+ }
+
/*
- * Description:
- * Clear any previously set digest credentials for the specified domain.
+ * Description:
+ * Clear any previously set digest credentials for the specified domain.
* If domain is null all set credentials are cleared.
- * Returns true if the digest credentials for the given protocol and
- * domain were cleared or do not exist,
+ * Returns true if the digest credentials for the given protocol and
+ * domain were cleared or do not exist,
* or false if credentials failed to be cleared.
- *
+ *
* Arguments:
- * - protocol: The protocol to apply the credentials. The value should
- * be the same as one of those specified for
+ * - protocol: The protocol to apply the credentials. The value should
+ * be the same as one of those specified for
* the setDigestCredentials() method.
- *
+ *
* - domain: The domain to which the credentials apply.
-
- *
+
+ *
* Return: Boolean
*/
- clearDigestCredentials: function(protocol, domain, username, password) {
-
- },
-
+ clearDigestCredentials(protocol, domain, username, password) {
+
+ }
+
/*
- * Description:
- * Check if digest credentials are currently defined
- * for the specified protocol and domain.
+ * Description:
+ * Check if digest credentials are currently defined
+ * for the specified protocol and domain.
* Returns true if credentials have been set by a previous call to
* setDigestCredentials() , otherwise returns false .
- *
+ *
* Arguments:
- * - protocol: The protocol to apply the credentials.
- * The value should be the same as one of those specified for
+ * - protocol: The protocol to apply the credentials.
+ * The value should be the same as one of those specified for
* the setDigestCredentials() method.
- *
+ *
* - domain: The domain to which the credentials apply.
- *
+ *
* Return: Boolean
*/
- hasDigestCredentials: function(protocol, domain, username, password) {
-
- },
-
+ hasDigestCredentials(protocol, domain, username, password) {
+
+ }
+
get onPowerStateChange() {
return this._getCallback("PowerStateChange");
- },
-
+ }
+
set onPowerStateChange(callback) {
this._setCallback("PowerStateChange", callback);
- },
-
- _getCallback : function(type) {
- if(this._callbacks) {
+ }
+
+ _getCallback(type) {
+ if (this._callbacks) {
return this._callbacks[type];
}
- },
-
- _setCallback: function(type, callback){
- if(this._callbacks) {
+ }
+
+ _setCallback(type, callback) {
+ if (this._callbacks) {
this._callbacks[type] = callback;
}
- },
-
- addEventListener: function(type, listener) {
+ }
+
+ addEventListener(type, listener) {
this._eventManager.addEventListener(type, listener, this);
- },
-
- _fireEvent: function(event) {
+ }
+
+ _fireEvent(event) {
this._eventManager.fireEvent(event, this);
- },
-
- removeEventListener: function(type, listener) {
+ }
+
+ removeEventListener(type, listener) {
this._eventManager.removeEventListener(type, listener, this);
}
-
-});
\ No newline at end of file
+}
1
0