media_player_client/src/common/SpecialVideoHelper.ts

37 lines
933 B
TypeScript
Raw Normal View History

export interface IScreenInfo {
screen_width: number;
screen_height: number;
unit_width: number;
unit_height: number;
wall_rows: number;
wall_cols: number;
desktop_col: number;
}
export class SpecialVideoHelper {
private static kScreenWidth = 3840;
private static kScreenHeight = 2160;
public static getScreenInfo(
wall_cols: number,
wall_rows: number
): IScreenInfo {
const desktp_row = Math.ceil(Math.sqrt(wall_rows * wall_cols));
const desktop_col = desktp_row;
const unit_width = SpecialVideoHelper.kScreenWidth / desktop_col;
const unit_height = SpecialVideoHelper.kScreenHeight / desktp_row;
const screen_width = wall_cols * unit_width;
const screen_height = wall_rows * unit_height;
console.log(screen_width);
return {
screen_width,
screen_height,
unit_width,
unit_height,
wall_rows,
wall_cols,
desktop_col,
};
}
}