Author: ygrego Date: 2015-02-19 17:00:51 +0000 (Thu, 19 Feb 2015) New Revision: 836 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/836 Log: Addition of the asynchronous characteristic of methof "onPlayStateChange" when it is called. Modified: oipf/js/impl/VideoBroadcastObject.js Modified: oipf/js/impl/VideoBroadcastObject.js =================================================================== --- oipf/js/impl/VideoBroadcastObject.js 2015-02-19 15:32:06 UTC (rev 835) +++ oipf/js/impl/VideoBroadcastObject.js 2015-02-19 17:00:51 UTC (rev 836) @@ -1,32 +1,31 @@ - /* - * 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 - * never fail if the object type is supported. If the method name to create the object is not - * supported, the OITF SHALL throw an error with the error.name set to the value - * " TypeError ". - * If the object type is supported, the method shall return an HTMLObjectElement equivalent - * 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 - * the resulting player. Each item in the argument SHALL be one of - * the formats specified in [OIPF_MEDIA2]. Scarce resources will - * be claimed by the object at the time of instantiation. The - * allocationMethod property SHALL be set - * STATIC_ALLOCATION . If the OITF is unable to create the player - * object with the requested capabilities, the method SHALL return - * null . - * If this argument is omitted, objects do not claim scarce resources - * so instantiation shall never fail if the object type is supported. The - * allocationMethod property SHALL be set to DYNAMIC_ALLOCATION . - */ +/* + * 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 + * never fail if the object type is supported. If the method name to create the object is not + * supported, the OITF SHALL throw an error with the error.name set to the value + * " TypeError ". + * If the object type is supported, the method shall return an HTMLObjectElement equivalent + * 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 + * the resulting player. Each item in the argument SHALL be one of + * the formats specified in [OIPF_MEDIA2]. Scarce resources will + * be claimed by the object at the time of instantiation. The + * allocationMethod property SHALL be set + * STATIC_ALLOCATION . If the OITF is unable to create the player + * object with the requested capabilities, the method SHALL return + * null . + * If this argument is omitted, objects do not claim scarce resources + * so instantiation shall never fail if the object type is supported. The + * allocationMethod property SHALL be set to DYNAMIC_ALLOCATION . + */ var VideoBroadcastObject = Class.extend({ - /* * Description: * The width of the area used for rendering the video object. This property is only writable if property @@ -36,7 +35,6 @@ * specified in pixels. */ width: null, - /* * Description: * The height of the area used for rendering the video object. This property is only writable if property @@ -46,14 +44,12 @@ * 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 @@ -61,95 +57,88 @@ * 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. - */ + /*! + * 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 - */ + /* + * 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 - */ + * 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 - */ + * 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."); + createdCallback: function () { + console.log("[INFO] createdCallback called."); }, - - init: function(requiredCapabilities) { + init: function (requiredCapabilities) { console.log("[INFO] constructor of VideoBroadcast class called."); this.playstate = 0; if (requiredCapabilities) { this.allocationMethod = STATIC_ALLOCATION_VIDEOBROADCAST; - /* TODO: get scarce resources Scarce resources can be claimed by the video/broadcast or A/V Control object at instantiation time by specifying the - * requiredCapabilities parameter. In this case the STATIC_ALLOCATION method is used and the scarce resources - * are held by the object until it is either destroyed or the release() method is called. - */ + /* TODO: get scarce resources Scarce resources can be claimed by the video/broadcast or A/V Control object at instantiation time by specifying the + * requiredCapabilities parameter. In this case the STATIC_ALLOCATION method is used and the scarce resources + * are held by the object until it is either destroyed or the release() method is called. + */ } else { - + this.allocationMethod = DYNAMIC_ALLOCATION_VIDEOBROADCAST; } }, - /*! * Description: * The function that is called when a request to switch a tuner to another channel resulted in an error preventing @@ -199,10 +188,9 @@ * 100 | unidentified error. * --------------------------------------------------------------------------------------------------------------------------------------------------------------- */ - onChannelChangeError: function(channel, errorState) { - - }, + onChannelChangeError: function (channel, errorState) { + }, /*! * Description: * The function that is called when the play state of the video/broadcast object changes. This function may @@ -216,331 +204,310 @@ * * • 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 . */ - onPlayStateChange: function(state, error) { - - }, - - /* - * Description: - * The function that is called when a request to switch a tuner to another channel has successfully completed. - * This function may be called either in response to a channel change initiated by the application, or a channel - * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, - * which is defined as follows: - * - * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). - */ - onChannelChangeSucceeded: function(channel) { - - }, - + onPlayStateChange: null, /* - * Description: - * The function that is called when the value of fullScreen changes. - */ - onFullScreenChange: function() { - + * Description: + * The function that is called when a request to switch a tuner to another channel has successfully completed. + * This function may be called either in response to a channel change initiated by the application, or a channel + * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, + * which is defined as follows: + * + * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). + */ + onChannelChangeSucceeded: function (channel) { + }, - /* - * Description: - * The function that is called when the video object gains focus. - */ - onfocus: function() { - + * Description: + * The function that is called when the value of fullScreen changes. + */ + onFullScreenChange: function () { + }, - /* - * Description: - * The function that is called when the video object loses focus. - */ - onblur: function() { - + * Description: + * The function that is called when the video object gains focus. + */ + onfocus: function () { + }, + /* + * Description: + * The function that is called when the video object loses focus. + */ + onblur: function () { - /* - * - * 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() { + }, + /* + * + * 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 () { return oipfObjectFactory.createChannelConfig(); }, - /* - * 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. - * If the video/broadcast object is in the stopped state then this restarts presentation of - * video and audio from the current channel under the control of the video/broadcast object. - * If video from more than one channel is currently being presented by the OITF then this binds - * the video/broadcast object to the channel whose audio is being presented. - * If there is no channel currently being presented, or binding to the necessary resources to - * play the channel through the video/broadcast object fails for whichever reason, the OITF - * SHALL dispatch an event to the onPlayStateChange listener(s) whereby the state - * parameter is given value 0 (“ unrealized ”) and the error parameter is given the - * appropriate error code. - * Calling this method from any other states than the unrealized or stopped states SHALL have - * no effect. - * See section 7.13.1.1 for more information of its usage. - * - * NOTE: Returning a Channel object from this method does not guarantee that video or audio - * 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() { + * 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. + * If the video/broadcast object is in the stopped state then this restarts presentation of + * video and audio from the current channel under the control of the video/broadcast object. + * If video from more than one channel is currently being presented by the OITF then this binds + * the video/broadcast object to the channel whose audio is being presented. + * If there is no channel currently being presented, or binding to the necessary resources to + * play the channel through the video/broadcast object fails for whichever reason, the OITF + * SHALL dispatch an event to the onPlayStateChange listener(s) whereby the state + * parameter is given value 0 (“ unrealized ”) and the error parameter is given the + * appropriate error code. + * Calling this method from any other states than the unrealized or stopped states SHALL have + * no effect. + * See section 7.13.1.1 for more information of its usage. + * + * NOTE: Returning a Channel object from this method does not guarantee that video or audio + * 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 () { var channelConfig = this.getChannelConfig(); var currentChan = channelConfig.currentChannel; - - switch(this.playstate){ - - case 0: - - try{ - //claimed scarce resources - //Call method to claim scarces resources - if (currentChan) { + switch (this.playstate) { - this.currentChannel = currentChan; + case 0: + //claimed scarce resources + //Call method to claim scarces resources - } else { + if (currentChan) { - throw new Error(); - } - - } catch (e) { + this.currentChannel = currentChan; + setTimeout(function () { + this.onPlayStateChange && this.onPlayStateChange(2);//Parameter error here equals to 20 but not defined in the norm, means there is no error + }, 0); - this.onPlayStateChange && this.onPlayStateChange(0, 100); + } else { + + setTimeout(function () { + this.onPlayStateChange && this.onPlayStateChange(0, 100); + }, 0); } - this.onPlayStateChange && this.onPlayStateChange(2, 20);//Parameter error here equals to 20 but not defined in the norm, means there is no error - break; - + break; + case 1: - break; - + break; + case 2: - break; - + break; + case 3: - - this.onPlayStateChange && this.onPlayStateChange(1); - - break; - + setTimeout(function () { + this.onPlayStateChange && this.onPlayStateChange(1); + }, 0); + break; + } return this.currentChannel; }, - /* - * Description: - * The function that is called when a request to switch a tuner to another channel has successfully completed. - * This function may be called either in response to a channel change initiated by the application, or a channel - * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, - * which is defined as follows: - * - * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). - */ - createChannelObject: function(idType, dsd, sid) { - - }, + * Description: + * The function that is called when a request to switch a tuner to another channel has successfully completed. + * This function may be called either in response to a channel change initiated by the application, or a channel + * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, + * which is defined as follows: + * + * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). + */ + createChannelObject: function (idType, dsd, sid) { - /* - * Description: - * The function that is called when a request to switch a tuner to another channel has successfully completed. - * This function may be called either in response to a channel change initiated by the application, or a channel - * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, - * which is defined as follows: - * - * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). - */ - createChannelObject: function(idType, onid, tsid, sid, sourceID, ipBroadcastID) { - }, - /* - * Description: - * The function that is called when a request to switch a tuner to another channel has successfully completed. - * This function may be called either in response to a channel change initiated by the application, or a channel - * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, - * which is defined as follows: - * - * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). - */ - setChannel: function(channel, trickplay, contentAccessDescriptorURL) { - + * Description: + * The function that is called when a request to switch a tuner to another channel has successfully completed. + * This function may be called either in response to a channel change initiated by the application, or a channel + * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, + * which is defined as follows: + * + * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). + */ + createChannelObject: function (idType, onid, tsid, sid, sourceID, ipBroadcastID) { + }, + /* + * Description: + * The function that is called when a request to switch a tuner to another channel has successfully completed. + * This function may be called either in response to a channel change initiated by the application, or a channel + * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, + * which is defined as follows: + * + * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). + */ + setChannel: function (channel, trickplay, contentAccessDescriptorURL) { + }, /* - * Description: - * Requests the OITF to switch the tuner that is currently in use by the video/broadcast - * object to the channel that precedes the current channel in the active favourite list, or, if no - * favourite list is currently selected, to the previous channel in the channel list. If it has reached - * the start of the favourite/channel list, it SHALL cycle to the last channel in the list. - * - * 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. - * - * TODO: Actually,this specific case will not be taken into consideration. - * 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 - * behaviour is defined in more detail in the description of the setChannel method. - * - * If an error occurs during switching to the previous channel, the OITF SHALL trigger the - * function specified by the onChannelChangeError property with the appropriate channel - * and errorState value, and dispatch the corresponding DOM event (see below). - * - * If the OITF does not maintain the channel list and favourite list by itself, the request SHALL - * fail and the OITF SHALL trigger the onChannelChangeError function with the channel - * property having the value null , and errorState=10 (“channel cannot be changed by - * nextChannel()/prevChannel() methods”). - * - * If successful, the OITF SHALL trigger the function specified by the - * onChannelChangeSucceeded property with the appropriate channel value, and also - * 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() { - + * Description: + * Requests the OITF to switch the tuner that is currently in use by the video/broadcast + * object to the channel that precedes the current channel in the active favourite list, or, if no + * favourite list is currently selected, to the previous channel in the channel list. If it has reached + * the start of the favourite/channel list, it SHALL cycle to the last channel in the list. + * + * 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. + * + * TODO: Actually,this specific case will not be taken into consideration. + * 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 + * behaviour is defined in more detail in the description of the setChannel method. + * + * If an error occurs during switching to the previous channel, the OITF SHALL trigger the + * function specified by the onChannelChangeError property with the appropriate channel + * and errorState value, and dispatch the corresponding DOM event (see below). + * + * If the OITF does not maintain the channel list and favourite list by itself, the request SHALL + * fail and the OITF SHALL trigger the onChannelChangeError function with the channel + * property having the value null , and errorState=10 (“channel cannot be changed by + * nextChannel()/prevChannel() methods”). + * + * If successful, the OITF SHALL trigger the function specified by the + * onChannelChangeSucceeded property with the appropriate channel value, and also + * 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 () { + //claimed scarce resources //Call method to claim scarces resources - - switch(this.playstate){ - + + switch (this.playstate) { + case 0: - break; - + break; + case 1: - try{ - + try { + if (channelConfig === null) { - throw new Error(); + throw new Error(); } else { - + } - + if (currentChan) { - this.currentChannel = currentChan; + this.currentChannel = currentChan; } else { throw new Error(); } - + } catch (e) { //When the OITF does not maintain channel list and favourite list by itself this.onChannelChangeError && this.onChannelChangeError(null, 10); } this.onPlayStateChange && this.onPlayStateChange(2, 20);//Parameter error here equals to 20 but not defined in the norm, means there is no error - break; - + break; + case 2: - break; - + break; + case 3: - - this.onPlayStateChange && this.onPlayStateChange(1); - - break; - + + this.onPlayStateChange && this.onPlayStateChange(1); + + break; + } return this.currentChannel; - - }, - /* - * Description: - * The function that is called when a request to switch a tuner to another channel has successfully completed. - * This function may be called either in response to a channel change initiated by the application, or a channel - * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, - * which is defined as follows: - * - * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). - */ - nextChannel: function() { - - }, - /* - * Description: - * The function that is called when a request to switch a tuner to another channel has successfully completed. - * This function may be called either in response to a channel change initiated by the application, or a channel - * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, - * which is defined as follows: - * - * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). - */ - setFullScreen: function(fullscreen) { - + * Description: + * The function that is called when a request to switch a tuner to another channel has successfully completed. + * This function may be called either in response to a channel change initiated by the application, or a channel + * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, + * which is defined as follows: + * + * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). + */ + nextChannel: function () { + + }, - /* - * Description: - * The function that is called when a request to switch a tuner to another channel has successfully completed. - * This function may be called either in response to a channel change initiated by the application, or a channel - * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, - * which is defined as follows: - * - * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). - */ - setVolume: function(volume) { - + * Description: + * The function that is called when a request to switch a tuner to another channel has successfully completed. + * This function may be called either in response to a channel change initiated by the application, or a channel + * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, + * which is defined as follows: + * + * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). + */ + setFullScreen: function (fullscreen) { + }, - /* - * Description: - * The function that is called when a request to switch a tuner to another channel has successfully completed. - * This function may be called either in response to a channel change initiated by the application, or a channel - * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, - * which is defined as follows: - * - * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). - */ - getVolume: function() { - - + * Description: + * The function that is called when a request to switch a tuner to another channel has successfully completed. + * This function may be called either in response to a channel change initiated by the application, or a channel + * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, + * which is defined as follows: + * + * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). + */ + setVolume: function (volume) { + }, + /* + * Description: + * The function that is called when a request to switch a tuner to another channel has successfully completed. + * This function may be called either in response to a channel change initiated by the application, or a channel + * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, + * which is defined as follows: + * + * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). + */ + getVolume: function () { + + }, /* - * Description: - * The function that is called when a request to switch a tuner to another channel has successfully completed. - * This function may be called either in response to a channel change initiated by the application, or a channel - * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, - * which is defined as follows: - * - * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). - */ - release: function() { - - + * Description: + * The function that is called when a request to switch a tuner to another channel has successfully completed. + * This function may be called either in response to a channel change initiated by the application, or a channel + * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, + * which is defined as follows: + * + * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). + */ + release: function () { + + }, - /* - * Description: - * The function that is called when a request to switch a tuner to another channel has successfully completed. - * This function may be called either in response to a channel change initiated by the application, or a channel - * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, - * which is defined as follows: - * - * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). - */ - stop: function() { - - + * Description: + * The function that is called when a request to switch a tuner to another channel has successfully completed. + * This function may be called either in response to a channel change initiated by the application, or a channel + * change initiated by the OITF (see section 7.13.1.1). The specified function is called with argument channel, + * which is defined as follows: + * + * • Channel channel – the channel to which the tuner switched. This object SHALL have the same properties with the same values as the currentChannel object (see * section 7.13.7). + */ + stop: function () { + + } - + }); \ No newline at end of file
participants (1)
-
ygrego@users.nuiton.org