// 判断房间人数对应的样式
export function getWidth(data) {
    if (data.length == 1) {
        return 'userVideo'
    } else if (data.length == 2) {
        return "userVideo1"
    } else if (data.length == 3) {
        return "userVideo2"
    } else if (data.length > 3) {
        return "userVideo3"
    } else if (data.length == 0) {
        return 'userVideo4'
    }

}
export function getHeight(data) {
    let userRow = Math.ceil((data.length + 1) / 3);
    if (userRow == 1) {
        return "100%"
    }
    else {
        return (1 / userRow) * 100 + "%"
    }
}
// 判断移动端进入房间样式
export function getWidthPhone(data) {
    if (data.length == 0) {
        return "userVideoPhone"
    } else {
        return "userVideoPhone1"
    }
}
// 判断移动端访问还是pc端访问
export function getModile() {
    var sUserAgent = navigator.userAgent.toLowerCase();
    var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
    var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
    var bIsMidp = sUserAgent.match(/midp/i) == "midp";
    var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
    var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
    var bIsAndroid = sUserAgent.match(/android/i) == "android";
    var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
    var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
    if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
        return false;
    } else {
       return true;
    }
}
