Author: ygrego Date: 2015-06-09 12:29:01 +0000 (Tue, 09 Jun 2015) New Revision: 1644 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1644 Log: Transformation of the class CapabilitiesObject in an ES6 class. Modified: oipf/lib/js/impl/CapabilitiesObject.js Modified: oipf/lib/js/impl/CapabilitiesObject.js =================================================================== --- oipf/lib/js/impl/CapabilitiesObject.js 2015-06-09 12:19:40 UTC (rev 1643) +++ oipf/lib/js/impl/CapabilitiesObject.js 2015-06-09 12:29:01 UTC (rev 1644) @@ -1,82 +1,81 @@ /* - * The OITF SHALL support following non-visual embedded object with + * The OITF SHALL support following non-visual embedded object with * the mime type 'application/oipfCapabilities'. */ -var CapabilitiesObject = Class.extend({ - - /* - * Description: - * Returns the OITF’s capability description as an XML Document object using - * the syntax as defined in Annex F without using any namespace - * definitions. - * - * Visibility Type: readonly Document - */ - xmlCapabilities: null, - - /* - * Description: - * This property holds the number of possible additional decodes for - * SD video. Depending on the current usage of system resources this value - * may vary. The value of this property is likely to change if an HD video - * is started. - * - * Adding an A/V Control object or video/broadcast object may still fail, - * even if extraSDVideoDecodes is larger than 0. For A/V Control objects, - * in case of failure the play state for the A/V Control object shall be set - * to 6 ('error') with a detailed error code of 3 - * ('insufficient resources'). For video/broadcast objects, in case of - * failure the play state of the video/broadcast object shall be set to 0 - * ('unrealized') with a detailed error code of 11 - * ('insufficient resources'). - * - * Visibility Type: readonly Number - */ - extraSDVideoDecodes: null, - - /* - * Description: - * This property holds the number of possible additional decodes for - * HD video. Depending on the current usage of system resources this value - * may vary. The value of this property is likely to change if an SD video - * is started. - * - * Adding an A/V Control object or video/broadcast object may still fail, - * even if extraSDVideoDecodes is larger than 0. For A/V Control objects, - * in case of failure the play state for the A/V Control object shall be set - * to 6 ('error') with a detailed error code of 3 - * ('insufficient resources'). For video/broadcast objects, in case of - * failure the play state of the video/broadcast object shall be set to 0 - * ('unrealized') with a detailed error code of 11 - * ('insufficient resources'). - * - * Visibility Type: readonly Number - */ - extraHDVideoDecodes: null, - - - init: function(modelFactory) { +class CapabilitiesObject { + + constructor(modelFactory) { + /* + * Description: + * Returns the OITF’s capability description as an XML Document object using + * the syntax as defined in Annex F without using any namespace + * definitions. + * + * Visibility Type: readonly Document + */ + this.xmlCapabilities = null; + + /* + * Description: + * This property holds the number of possible additional decodes for + * SD video. Depending on the current usage of system resources this value + * may vary. The value of this property is likely to change if an HD video + * is started. + * + * Adding an A/V Control object or video/broadcast object may still fail, + * even if extraSDVideoDecodes is larger than 0. For A/V Control objects, + * in case of failure the play state for the A/V Control object shall be set + * to 6 ('error') with a detailed error code of 3 + * ('insufficient resources'). For video/broadcast objects, in case of + * failure the play state of the video/broadcast object shall be set to 0 + * ('unrealized') with a detailed error code of 11 + * ('insufficient resources'). + * + * Visibility Type: readonly Number + */ + this.extraSDVideoDecodes = null; + + /* + * Description: + * This property holds the number of possible additional decodes for + * HD video. Depending on the current usage of system resources this value + * may vary. The value of this property is likely to change if an SD video + * is started. + * + * Adding an A/V Control object or video/broadcast object may still fail, + * even if extraSDVideoDecodes is larger than 0. For A/V Control objects, + * in case of failure the play state for the A/V Control object shall be set + * to 6 ('error') with a detailed error code of 3 + * ('insufficient resources'). For video/broadcast objects, in case of + * failure the play state of the video/broadcast object shall be set to 0 + * ('unrealized') with a detailed error code of 11 + * ('insufficient resources'). + * + * Visibility Type: readonly Number + */ + this.extraHDVideoDecodes = null; + this.xmlParser = modelFactory.getXmlParser(); this._defaultCapabilities = modelFactory.getCapabilitiesProperties(); this.xmlCapabilities = this.xmlParser .getXmlDocument(this._defaultCapabilities); - }, - + } + /* * Description: * Check if the OITF supports the passed capability. * Returns true if the OITF supports the passed capability, false otherwise. - * + * * Arguments: - * - profileName: + * - profileName: * An OIPF base UI profile string or a UI Profile name fragment string as * defined in section 9.2. * Examples of valid profileName: “ OITF_HD_UIPROF ” or “ +PVR ”. - * + * * Return: Boolean */ - hasCapability: function(profileName) { + hasCapability(profileName) { return this._defaultCapabilities.hasCapablity(profileName); } -}); \ No newline at end of file +}