Author: ggrekhov
Date: Mon Sep  3 08:04:17 2012
New Revision: 1380162

URL: http://svn.apache.org/viewvc?rev=1380162&view=rev
Log:
Save sizes ratio resizing a video pod

Modified:
    
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/video/baseVideoObject.lzx
    
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/video/videoObjectBroadcast.lzx
    
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/video/videoObjectPlayBroadcast.lzx

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/video/baseVideoObject.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/video/baseVideoObject.lzx?rev=1380162&r1=1380161&r2=1380162&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/video/baseVideoObject.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/video/baseVideoObject.lzx
 Mon Sep  3 08:04:17 2012
@@ -82,6 +82,9 @@
     <attribute name="isMicrophonesRoom" value="false" type="boolean"/>
 
     <attribute name="lastPositiveVolume" type="number" value="50" />
+
+    <!-- Initial stream ratio: width / height -->
+    <attribute name="initRatio" type="number" value="null" />
        
        <handler name="onisremote" args="r">
                this.isremote = r;
@@ -768,6 +771,30 @@
         }
         return volume;
     </method>
+
+    <handler name="onheight" args="value">
+        if (null == initRatio || !respectRatio) {
+            return;
+        }
+        var videoHeight = value - this.videoInsetY - this.bottomBarHeight;
+        var expectedVideoWidth = videoHeight * initRatio;
+        var expectedPodWidth = expectedVideoWidth + this.videoInsetX;
+        if (this.width != expectedPodWidth) {
+            this.setAttribute("width", expectedPodWidth);
+        }
+    </handler>
+
+    <handler name="onwidth" args="value">
+        if (null == initRatio || !respectRatio) {
+            return;
+        }
+        var videoWidth = value - this.videoInsetX;
+        var expectedVideoHeight = videoWidth / initRatio;
+        var expectedPodHeight = expectedVideoHeight + this.videoInsetY + 
this.bottomBarHeight;
+        if (this.height != expectedPodHeight) {
+            this.setAttribute("height", expectedPodHeight);
+        }
+    </handler>
     
 </class>
 

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/video/videoObjectBroadcast.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/video/videoObjectBroadcast.lzx?rev=1380162&r1=1380161&r2=1380162&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/video/videoObjectBroadcast.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/video/videoObjectBroadcast.lzx
 Mon Sep  3 08:04:17 2012
@@ -28,25 +28,26 @@
 
  
 <class name="videoObjectBroadcast" extends="baseVideoObject" isremote="false">
-  <attribute name="interviewPodId" value="-1" />
-  <attribute name="ratioW" value="1" />
-  <attribute name="ratioH" value="1" />
-  
-  <attribute name="videoInsetX" value="2" type="number" />
-  <attribute name="videoInsetY" value="21" type="number" />
-  <attribute name="bottomBarHeight" value="0" type="number" />
-  
-  <handler name="oninit">
+    <attribute name="interviewPodId" value="-1" />
+    <attribute name="ratioW" value="1" />
+    <attribute name="ratioH" value="1" />
+
+    <attribute name="videoInsetX" value="2" type="number" />
+    <attribute name="videoInsetY" value="21" type="number" />
+    <attribute name="bottomBarHeight" value="0" type="number" />
+
+    <handler name="oninit">
      <![CDATA[
         this._loudness.bringToFront();
         this._resizeview.bringToFront();
      ]]>
-  </handler>
+    </handler>
   
      <!---
         Change the video resolution by chaning pod size
      -->
     <method name="setDefaultVideoSize" args="w,h">
+        this.initRatio = w / h;
         this.setAttribute("width",w+this.videoInsetX);
         this.isMicrophonesRoom = canvas.currentRoomObject.showMicrophoneStatus;
         if (canvas.currentRoomObject.showMicrophoneStatus) {
@@ -64,7 +65,7 @@
                          width="$once{parent.width}" 
height="$once{parent.height}" />
                          
                <baseVideoStreamDevice name="_videostream" mode="broadcast">
-                 <handler name="onlevel">
+            <handler name="onlevel">
                 <![CDATA[
                     var fullLength = parent.height-24;
                     
parent._activityLevel.setAttribute("height",this.level*(fullLength/100));
@@ -74,9 +75,9 @@
          
          <view name="_activityLevel" width="6" x="2" y="2" opacity="0.5" 
bgcolor="0x00FF00" 
               height="0" >
-        </view> 
+        </view>
                
-       </view> 
+       </view>
        
 </class>
 

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/video/videoObjectPlayBroadcast.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/video/videoObjectPlayBroadcast.lzx?rev=1380162&r1=1380161&r2=1380162&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/video/videoObjectPlayBroadcast.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/video/videoObjectPlayBroadcast.lzx
 Mon Sep  3 08:04:17 2012
@@ -28,27 +28,28 @@
  -->
                                           
 <class name="videoObjectPlayBroadcast" extends="baseVideoObject" 
isremote="true">
-  <attribute name="interviewPodId" value="-1" />
-  <attribute name="ratioW" value="1" />
-  <attribute name="ratioH" value="1" />
-  
-  <attribute name="videoInsetX" value="2" type="number" />
-  <attribute name="videoInsetY" value="21" type="number" />
-  <attribute name="bottomBarHeight" value="0" type="number" />
-  
-  <handler name="oninit">
+    <attribute name="interviewPodId" value="-1" />
+    <attribute name="ratioW" value="1" />
+    <attribute name="ratioH" value="1" />
+
+    <attribute name="videoInsetX" value="2" type="number" />
+    <attribute name="videoInsetY" value="21" type="number" />
+    <attribute name="bottomBarHeight" value="0" type="number" />
+
+    <handler name="oninit">
      <![CDATA[
         if ($debug) Debug.write("Init videoObjectPlayBroadcast 
",this.isremote,this.clientVars);
         //Display widget defined in mother class
         this._loudness.bringToFront();
         this._resizeview.bringToFront();
      ]]>
-   </handler>
+    </handler>
    
     <!---
         Change the video resolution by chaning pod size
      -->
     <method name="setDefaultVideoSize" args="w,h">
+        this.initRatio = w / h;
         this.setAttribute("width",w+this.videoInsetX);
         
         if (canvas.currentRoomObject.showMicrophoneStatus) {


Reply via email to