mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
update the srs player, set the DAR.
This commit is contained in:
parent
b5c17e2338
commit
11cd5c640f
2 changed files with 10 additions and 13 deletions
Binary file not shown.
|
@ -106,20 +106,17 @@ package
|
|||
public function js_call_dar(num:int, den:int):int {
|
||||
if (this.video && num > 0 && den > 0 && this.video.width > 0) {
|
||||
// set DAR.
|
||||
if (num < den) {
|
||||
// calc the height by DAR
|
||||
var _height:int = this.video.width * num / den;
|
||||
|
||||
// calc the height by DAR
|
||||
var _height:int = this.w * num / den;
|
||||
if (_height <= this.h) {
|
||||
this.video.width = this.w;
|
||||
this.video.height = _height;
|
||||
} else {
|
||||
// height overflow, calc the width by DAR
|
||||
if (_height > this.h) {
|
||||
var _width:int = this.video.height * den / num;
|
||||
|
||||
this.video.width = _width;
|
||||
this.video.height = this.h;
|
||||
} else {
|
||||
this.video.width = this.w;
|
||||
this.video.height = _height;
|
||||
}
|
||||
var _width:int = this.h * den / num;
|
||||
|
||||
this.video.width = _width;
|
||||
this.video.height = this.h;
|
||||
}
|
||||
|
||||
// align center.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue