import { StreamManager , Publisher } from 'openvidu-browser' ; import { VideoType } from '../types/video-type' ; /**
 * Packs all the information about the user
 */ export class UserModel { /**
     * The Connection ID that is publishing the stream
     */ connectionId : string ; /**
     * The user nickname
     */ nickname : string ; /**
     * StreamManager object ([[Publisher]] or [[Subscriber]])
     */ streamManager : StreamManager ; hidden avatar : string ; hidden local : boolean ; hidden hidden videoSizeBig : boolean ; hidden constructor ( connectionId ? , streamManager ? , nickname ? ) { this . connectionId = connectionId || '' ; this . nickname = nickname || 'OpenVidu' ; this . streamManager = streamManager || null ; } /**
     * Return `true` if audio track is active and `false` if audio track is muted
     */ public isAudioActive ( ) { return ( < Publisher > this . streamManager ) ?. stream ?. audioActive ; } /**
     * Return `true` if video track is active and `false` if video track is muted
     */ public isVideoActive ( ) { return ( < Publisher > this . streamManager ) ?. stream ?. videoActive ; } /**
     * Return the connection ID
     */ public getConnectionId ( ) { return this . streamManager ?. stream ?. connection ?. connectionId || this . connectionId ; } /**
     * Return the user nickname
     */ public getNickname ( ) { return this . nickname ; } /**
     * Return the [[streamManger]] object
     */ public getStreamManager ( ) { return this . streamManager ; } /**
     * Return the user avatar
     */ public getAvatar ( ) { return this . avatar ; } public setAvatar ( avatar ) { this . avatar = avatar ; } /**
     * Return `true` if user has a local role and `false` if not
     */ public isLocal ( ) { return this . local ; } /**
     * Return `true` if user has a remote role and `false` if not
     */ public isRemote ( ) { return ( < Publisher > this . streamManager ) ?. remote ; } /**
     * Return `true` if user has a screen role and `false` if not
     */ public isScreen ( ) { return ( < Publisher > this . streamManager ) ?. stream ?. typeOfVideo === VideoType . SCREEN ; } /**
     * Return `true` if user has a camera role and `false` if not
     */ public isCamera ( ) { return ( < Publisher > this . streamManager ) ?. stream ?. typeOfVideo === VideoType . CAMERA || ( this . isLocal ( ) && ! this . isScreen ( ) ) ; } param streamManager public setStreamManager ( streamManager ) { this . streamManager = streamManager ; } param nickname public setNickname ( nickname ) { this . nickname = nickname ; } public isVideoSizeBig ( ) { return this . videoSizeBig ; } hidden public setVideoSizeBig ( big ) { this . videoSizeBig = big ; } hidden public setLocal ( local ) { this . local = local ; } }