Author: solomax
Date: Thu Jun 23 05:27:20 2016
New Revision: 1749823
URL: http://svn.apache.org/viewvc?rev=1749823&view=rev
Log:
[OPENMEETINGS-1423] aspect ratio for WB video is fixed
Modified:
openmeetings/application/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/whiteboardVideoPlayer.lzx
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/whiteboardVideoPlayer.lzx
Modified:
openmeetings/application/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/whiteboardVideoPlayer.lzx
URL:
http://svn.apache.org/viewvc/openmeetings/application/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/whiteboardVideoPlayer.lzx?rev=1749823&r1=1749822&r2=1749823&view=diff
==============================================================================
---
openmeetings/application/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/whiteboardVideoPlayer.lzx
(original)
+++
openmeetings/application/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/whiteboardVideoPlayer.lzx
Thu Jun 23 05:27:20 2016
@@ -75,7 +75,7 @@
+'&moduleName=lzRecorderApp&parentPath=&room_id='
+'&sid='+canvas.sessionId;
-
parent._content._preview.imagePreview.setAttribute("src",downloadurl)
+
parent._content._preview.imagePreview.setAttribute("src", downloadurl)
parent._content._preview.bringToFront();
@@ -109,7 +109,7 @@
if (!this.isLoaded) {
return;
}
- if ($debug) Debug.write("startStream ",this.recordingName);
+ if ($debug) Debug.write("startStream ", this.recordingName);
if (this.recordingName != "") {
this.isPaused = false;
@@ -132,37 +132,43 @@
-->
<method name="calcVideoWidthHeight">
<![CDATA[
-
- if ($debug) Debug.write("calcVideoWidthHeight
",this.flv_width,this.flv_height);
+ if ($debug) Debug.write("calcVideoWidthHeight ",
this.flv_width, this.flv_height);
var ratio = this.flv_width / this.flv_height;
+ var t = {};
+ var area = {height: this.height - 62, width: parent.width - 1}
//max height of container is new height of video;
//calc new width and x-position of video
- var newHeight = this._content.height;
- var newWidth = ratio * newHeight;
- var newx = (this._content.width - newWidth) / 2;
- var newy = 0;
+ t.height = area.height;
+ t.width = ratio * t.height;
+ t.x = (area.width - t.width) / 2;
+ t.y = 0;
- if ($debug)
Debug.write("calcVideoWidthHeight",ratio,this._content.width,this._content.height,newWidth,newHeight,newx,newy);
+ if ($debug) Debug.write("calcVideoWidthHeight", area, t);
- if (newWidth > this._content.width) {
- newWidth = this._content.width;
- newHeight = newWidth / ratio;
- newx = 0;
- newy = (this._content.height - newHeight) / 2;
+ if (t.width > area.width) {
+ t.width = area.width;
+ t.height = t.width / ratio;
+ t.x = 0;
+ t.y = (area.height - t.height) / 2;
}
+ t.width = Math.round(t.width);
+ t.height = Math.round(t.height);
+ t.x = Math.round(t.x);
+ t.y = Math.round(t.y);
+
+ if ($debug) Debug.write("t", t);
+
+ this._content.setAttribute("x", t.x + 1);
+ this._content.setAttribute("y", t.y + 22);
+ this._content.setAttribute("width", t.width);
+ this._content.setAttribute("height", t.height);
- var t = {'x':newx,'y':newy,'width':newWidth,'height':newHeight};
-
- if ($debug) Debug.write("t",t);
-
- this._content._preview.setAttribute("x",newx);
- this._content._preview.setAttribute("y",newy);
- this._content._preview.setAttribute("width",newWidth);
- this._content._preview.setAttribute("height",newHeight);
+ this._content._preview.setAttribute("width", t.width);
+ this._content._preview.setAttribute("height", t.height);
- return {'x':newx,'y':newy,'width':newWidth,'height':newHeight};
+ return t;
]]>
</method>
@@ -171,8 +177,8 @@
if ($debug) Debug.write("setDuration ",this.deltaInSeconds);
var tString = "";
if (this.deltaInSeconds > 60) {
- var minutes = Math.floor(this.deltaInSeconds/60);
- var restSeconds = Math.round(this.deltaInSeconds) - (
minutes * 60 );
+ var minutes = Math.floor(this.deltaInSeconds / 60);
+ var restSeconds = Math.round(this.deltaInSeconds) - (minutes
* 60);
tString = minutes + " min " + restSeconds + " sec";
} else {
tString = Math.round(this.deltaInSeconds) + " sec";
@@ -187,15 +193,15 @@
this._progress._progressbar._pointer.setAttribute("visibility","visible");
var tString = "";
if (this.currentTime > 60) {
- var minutes = Math.floor(this.currentTime/60);
- var restSeconds = Math.round(this.currentTime) - ( minutes *
60 );
+ var minutes = Math.floor(this.currentTime / 60);
+ var restSeconds = Math.round(this.currentTime) - (minutes *
60);
tString = minutes + " min " + restSeconds + " sec";
} else {
tString = Math.round(this.currentTime) + " sec";
}
var tNewX = Math.round((this._progress._progressbar.width /
this.deltaInSeconds) * this.currentTime);
- this._progress._progressbar._time.setAttribute("text",tString);
- this._progress._progressbar._pointer.setAttribute("x",tNewX);
+ this._progress._progressbar._time.setAttribute("text", tString);
+ this._progress._progressbar._pointer.setAttribute("x", tNewX);
]]>
</method>
@@ -203,8 +209,8 @@
if (this.timerDelegateStarted) {
this.timerDelegateStarted = false;
}
- this._progress._progressbar._time.setAttribute("text","");
- this._progress._progressbar._pointer.setAttribute("x",0);
+ this._progress._progressbar._time.setAttribute("text", "");
+ this._progress._progressbar._pointer.setAttribute("x", 0);
this._content.stopVideo();
this._content._preview.setAttribute('visible', true);
this.isPaused = true;
@@ -216,7 +222,7 @@
}
</method>
- <baseVideoStream name="_content" height="${ parent.height-62 }"
bgcolor="0x000000" y="22" x="1" width="${ parent.width-1 }">
+ <baseVideoStream name="_content" height="${ parent.height - 62 }"
bgcolor="0x000000" y="22" x="1" width="${ parent.width-1 }">
<attribute name="timerDelegate" value="null"/>
<attribute name="timerDelegateStarted" value="false"
type="boolean"/>
@@ -258,8 +264,8 @@
lz.Timer.addTimer( this.timerDelegate , 1000 );
}
</method>
- <view name="_preview" width="0" height="0" >
- <image name="imagePreview" stretches="both"
width="${parent.width}" height="${parent.height}" />
+ <view name="_preview" x="0" y="0" width="0" height="0" >
+ <omImage name="imagePreview" stretches="both"
width="${parent.width}" height="${parent.height}" />
<handler name="onclick">
if ($debug) Debug.write("onclick --
toggleStream");
parent.parent.toggleStream();
Modified:
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/whiteboardVideoPlayer.lzx
URL:
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/whiteboardVideoPlayer.lzx?rev=1749823&r1=1749822&r2=1749823&view=diff
==============================================================================
---
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/whiteboardVideoPlayer.lzx
(original)
+++
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/whiteboardVideoPlayer.lzx
Thu Jun 23 05:27:20 2016
@@ -75,7 +75,7 @@
+'&moduleName=lzRecorderApp&parentPath=&room_id='
+'&sid='+canvas.sessionId;
-
parent._content._preview.imagePreview.setAttribute("src",downloadurl)
+
parent._content._preview.imagePreview.setAttribute("src", downloadurl)
parent._content._preview.bringToFront();
@@ -109,7 +109,7 @@
if (!this.isLoaded) {
return;
}
- if ($debug) Debug.write("startStream ",this.recordingName);
+ if ($debug) Debug.write("startStream ", this.recordingName);
if (this.recordingName != "") {
this.isPaused = false;
@@ -132,37 +132,43 @@
-->
<method name="calcVideoWidthHeight">
<![CDATA[
-
- if ($debug) Debug.write("calcVideoWidthHeight
",this.flv_width,this.flv_height);
+ if ($debug) Debug.write("calcVideoWidthHeight ",
this.flv_width, this.flv_height);
var ratio = this.flv_width / this.flv_height;
+ var t = {};
+ var area = {height: this.height - 62, width: parent.width - 1}
//max height of container is new height of video;
//calc new width and x-position of video
- var newHeight = this._content.height;
- var newWidth = ratio * newHeight;
- var newx = (this._content.width - newWidth) / 2;
- var newy = 0;
+ t.height = area.height;
+ t.width = ratio * t.height;
+ t.x = (area.width - t.width) / 2;
+ t.y = 0;
- if ($debug)
Debug.write("calcVideoWidthHeight",ratio,this._content.width,this._content.height,newWidth,newHeight,newx,newy);
+ if ($debug) Debug.write("calcVideoWidthHeight", area, t);
- if (newWidth > this._content.width) {
- newWidth = this._content.width;
- newHeight = newWidth / ratio;
- newx = 0;
- newy = (this._content.height - newHeight) / 2;
+ if (t.width > area.width) {
+ t.width = area.width;
+ t.height = t.width / ratio;
+ t.x = 0;
+ t.y = (area.height - t.height) / 2;
}
+ t.width = Math.round(t.width);
+ t.height = Math.round(t.height);
+ t.x = Math.round(t.x);
+ t.y = Math.round(t.y);
+
+ if ($debug) Debug.write("t", t);
+
+ this._content.setAttribute("x", t.x + 1);
+ this._content.setAttribute("y", t.y + 22);
+ this._content.setAttribute("width", t.width);
+ this._content.setAttribute("height", t.height);
- var t = {'x':newx,'y':newy,'width':newWidth,'height':newHeight};
-
- if ($debug) Debug.write("t",t);
-
- this._content._preview.setAttribute("x",newx);
- this._content._preview.setAttribute("y",newy);
- this._content._preview.setAttribute("width",newWidth);
- this._content._preview.setAttribute("height",newHeight);
+ this._content._preview.setAttribute("width", t.width);
+ this._content._preview.setAttribute("height", t.height);
- return {'x':newx,'y':newy,'width':newWidth,'height':newHeight};
+ return t;
]]>
</method>
@@ -171,8 +177,8 @@
if ($debug) Debug.write("setDuration ",this.deltaInSeconds);
var tString = "";
if (this.deltaInSeconds > 60) {
- var minutes = Math.floor(this.deltaInSeconds/60);
- var restSeconds = Math.round(this.deltaInSeconds) - (
minutes * 60 );
+ var minutes = Math.floor(this.deltaInSeconds / 60);
+ var restSeconds = Math.round(this.deltaInSeconds) - (minutes
* 60);
tString = minutes + " min " + restSeconds + " sec";
} else {
tString = Math.round(this.deltaInSeconds) + " sec";
@@ -187,15 +193,15 @@
this._progress._progressbar._pointer.setAttribute("visibility","visible");
var tString = "";
if (this.currentTime > 60) {
- var minutes = Math.floor(this.currentTime/60);
- var restSeconds = Math.round(this.currentTime) - ( minutes *
60 );
+ var minutes = Math.floor(this.currentTime / 60);
+ var restSeconds = Math.round(this.currentTime) - (minutes *
60);
tString = minutes + " min " + restSeconds + " sec";
} else {
tString = Math.round(this.currentTime) + " sec";
}
var tNewX = Math.round((this._progress._progressbar.width /
this.deltaInSeconds) * this.currentTime);
- this._progress._progressbar._time.setAttribute("text",tString);
- this._progress._progressbar._pointer.setAttribute("x",tNewX);
+ this._progress._progressbar._time.setAttribute("text", tString);
+ this._progress._progressbar._pointer.setAttribute("x", tNewX);
]]>
</method>
@@ -203,8 +209,8 @@
if (this.timerDelegateStarted) {
this.timerDelegateStarted = false;
}
- this._progress._progressbar._time.setAttribute("text","");
- this._progress._progressbar._pointer.setAttribute("x",0);
+ this._progress._progressbar._time.setAttribute("text", "");
+ this._progress._progressbar._pointer.setAttribute("x", 0);
this._content.stopVideo();
this._content._preview.setAttribute('visible', true);
this.isPaused = true;
@@ -216,7 +222,7 @@
}
</method>
- <baseVideoStream name="_content" height="${ parent.height-62 }"
bgcolor="0x000000" y="22" x="1" width="${ parent.width-1 }">
+ <baseVideoStream name="_content" height="${ parent.height - 62 }"
bgcolor="0x000000" y="22" x="1" width="${ parent.width-1 }">
<attribute name="timerDelegate" value="null"/>
<attribute name="timerDelegateStarted" value="false"
type="boolean"/>
@@ -258,8 +264,8 @@
lz.Timer.addTimer( this.timerDelegate , 1000 );
}
</method>
- <view name="_preview" width="0" height="0" >
- <image name="imagePreview" stretches="both"
width="${parent.width}" height="${parent.height}" />
+ <view name="_preview" x="0" y="0" width="0" height="0" >
+ <omImage name="imagePreview" stretches="both"
width="${parent.width}" height="${parent.height}" />
<handler name="onclick">
if ($debug) Debug.write("onclick --
toggleStream");
parent.parent.toggleStream();