@@ -188,10 +188,10 @@ public void run() {
188
188
}
189
189
190
190
_videoParams = new WebView .LayoutParams (
191
- _videoConfig .getContainer ().getWidth () * _videoConfig .getDevicePixelRatio (),
192
- _videoConfig .getContainer ().getHeight () * _videoConfig .getDevicePixelRatio (),
193
- _videoConfig .getContainer ().getX () * _videoConfig .getDevicePixelRatio (),
194
- _videoConfig .getContainer ().getY () * _videoConfig .getDevicePixelRatio ());
191
+ ( int )( _videoConfig .getContainer ().getWidth () * _videoConfig .getDevicePixelRatio () ),
192
+ ( int )( _videoConfig .getContainer ().getHeight () * _videoConfig .getDevicePixelRatio () ),
193
+ ( int )( _videoConfig .getContainer ().getX () * _videoConfig .getDevicePixelRatio () ),
194
+ ( int )( _videoConfig .getContainer ().getY () * _videoConfig .getDevicePixelRatio () ));
195
195
196
196
if (_videoView == null ) {
197
197
// createVideoView();
@@ -340,8 +340,8 @@ public void removeRemoteVideoTrack(VideoTrack videoTrack) {
340
340
341
341
private void createVideoView () {
342
342
Point size = new Point ();
343
- size .set (_videoConfig .getContainer ().getWidth () * _videoConfig .getDevicePixelRatio (),
344
- _videoConfig .getContainer ().getHeight () * _videoConfig .getDevicePixelRatio ());
343
+ size .set (( int )( _videoConfig .getContainer ().getWidth () * _videoConfig .getDevicePixelRatio () ),
344
+ ( int )( _videoConfig .getContainer ().getHeight () * _videoConfig .getDevicePixelRatio () ));
345
345
346
346
_videoView = new VideoGLView (cordova .getActivity (), size );
347
347
VideoRendererGui .setView (_videoView , null );
@@ -395,16 +395,16 @@ private void refreshVideoView() {
395
395
396
396
int widthPercentage = videoSizeAsPercentage ;
397
397
int heightPercentage = videoSizeAsPercentage ;
398
- while ((x + widthPercentage ) > 100 ){
399
- widthPercentage -- ;
398
+ if ((x + widthPercentage ) > 100 ){
399
+ widthPercentage = widthPercentage - x ;
400
400
}
401
- while ((y + heightPercentage ) > 100 ){
402
- heightPercentage -- ;
401
+ if ((y + heightPercentage ) > 100 ){
402
+ heightPercentage = heightPercentage - y ;
403
403
}
404
404
405
405
pair .setVideoRenderer (new VideoRenderer (
406
406
VideoRendererGui .create (x , y , widthPercentage , heightPercentage ,
407
- RendererCommon .ScalingType .SCALE_ASPECT_FILL , true )));
407
+ RendererCommon .ScalingType .SCALE_ASPECT_BALANCED , true )));
408
408
409
409
pair .getVideoTrack ().addRenderer (pair .getVideoRenderer ());
410
410
0 commit comments