Author: ygrego Date: 2015-03-04 15:01:46 +0000 (Wed, 04 Mar 2015) New Revision: 913 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/913 Log: Start implementation of method "setVolume" and modification of property "playsate" directly in method "_channelSwitch" and "bindToCurrentChannel". Modified: oipf/js/impl/VideoBroadcastObject.js Modified: oipf/js/impl/VideoBroadcastObject.js =================================================================== --- oipf/js/impl/VideoBroadcastObject.js 2015-03-04 14:44:03 UTC (rev 912) +++ oipf/js/impl/VideoBroadcastObject.js 2015-03-04 15:01:46 UTC (rev 913) @@ -283,13 +283,15 @@ this.currentChannel = currentChan; setTimeout(function () { - self.onPlayStateChange && self.onPlayStateChange(2);//Parameter error here equals to 20 but not defined in the norm, means there is no error + this.playstate = 2; + self.onPlayStateChange && self.onPlayStateChange(this.playstate);//Parameter error here equals to 20 but not defined in the norm, means there is no error }, 0); } else { setTimeout(function () { - self.onPlayStateChange && self.onPlayStateChange(0, 100); + this.playstate = 0; + self.onPlayStateChange && self.onPlayStateChange(this.playstate, 100); }, 0); } break; @@ -297,7 +299,8 @@ case 3: setTimeout(function () { //Make enable video and audio presentation - self.onPlayStateChange && self.onPlayStateChange(1); + this.playstate = 1; + self.onPlayStateChange && self.onPlayStateChange(this.playstate); }, 0); break; @@ -421,28 +424,65 @@ */ 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: + * 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. + * 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. + * 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. + * The method returns true if the volume has changed. Returns false if the volume has not + * changed. Applications MAY use the getVolume() method to retrieve the actual volume set. * - * • 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). + * Arguments: + * - volume: Integer value between 0 up to and including 100 to indicate volume level. */ setVolume: function(volume) { + try{ + + if (!Number.isInteger(volume)) { + + return false; + + } else { + + if (volume == 0) { + + var configurationObject = oipfObjectFactory.createConfigurationObject(); + configurationObject.localSystem.volume = volume; + return true; + } + if ((volume > 0) && (volume < 100)) { + + } + if (volume) { + + } + } + + } catch (e) { + + console.log("{In setVolume}[INFO] "+e.message); + } + }, + /* * 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: + * 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. * - * • 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. @@ -487,7 +527,8 @@ if (object.playstate == 1) { self = object; setTimeout(function () { - self.onPlayStateChange && self.onPlayStateChange(0, 100); + this.playstate = 0; + self.onPlayStateChange && self.onPlayStateChange(this.playstate, 100); }, 0); } } else { @@ -513,7 +554,8 @@ object.currentChannel = previousChannel; self = object; setTimeout(function () { - self.onPlayStateChange && self.onPlayStateChange(1); + this.playstate = 1; + self.onPlayStateChange && self.onPlayStateChange(this.playstate); self.onChannelChangeSucceeded && self.onChannelChangeSucceeded(previousChannel); }, 0); }
participants (1)
-
ygrego@users.nuiton.org