Skip to content

Commit

Permalink
修改了播放器全屏时的选择90度的时候,暂停的裁减了的问题(2017-04-12)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo committed Apr 12, 2017
1 parent 930936d commit 8d75f38
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,21 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
height = widthS;
}
}

//如果旋转后的高度大于宽度
if (width > height) {
//如果视频的旋转后,width(高度)大于控件高度,需要压缩下高度
if (width > heightS) {
width = heightS;
height = (int) (height * (float) (width / heightS));
}
} else {
//如果旋转后的宽度大于高度
if (height > widthS) {
height = widthS;
width = (int) (width * (float) (height / widthS));
}
}
}
setMeasuredDimension(width, height);
}
Expand Down

0 comments on commit 8d75f38

Please sign in to comment.