常量定义

pragma mark - 新版版使用的常量定义如下

日志类型 typedef NS_ENUM(NSInteger,VHLogType) { VHLogType_OFF = 0, //关闭日志 默认设置 VHLogType_ON = 1, //开启日志 VHLogType_ALL = 2, //开启全部日志 };

pragma mark - 发起端常量定义

发直播状态,当kLiveStatusPushConnectError时,content代表出错原因 及具体错误码查看错误码定义。 typedef NS_ENUM(NSInteger,VHLiveStatus) { VHLiveStatusNone = kLiveStatusNone, VHLiveStatusPushConnectSucceed = kLiveStatusPushConnectSucceed, //直播连接成功 VHLiveStatusPushConnectError = kLiveStatusPushConnectError, //直播连接失败 VHLiveStatusParamError = kLiveStatusParamError, //参数错误 VHLiveStatusSendError = kLiveStatusSendError, //直播发送数据错误 VHLiveStatusUploadSpeed = kLiveStatusUploadSpeed, //直播上传速率 VHLiveStatusAudioRecoderError = kLiveStatusAudioRecoderError, //音频采集失败,提示用户查看权限或者重新推流,切记此事件会回调多次,直到音频采集正常为止 VHLiveStatusUploadNetworkException = kLiveStatusUploadNetworkException,//发起端网络环境差 VHLiveStatusUploadNetworkOK = kLiveStatusUploadNetworkOK, //发起端网络环境恢复正常 VHLiveStatusGetUrlError = kLiveStatusGetUrlError, //获取推流地址失败 }; 摄像头取景方向 typedef NS_ENUM(NSInteger,VHDeviceOrientation) { VHDevicePortrait = kDevicePortrait, VHDeviceLandSpaceLeft = kDeviceLandSpaceRight, VHDeviceLandSpaceRight = kDeviceLandSpaceLeft }; 推流视频分辨率 typedef NS_ENUM(NSInteger,VHVideoResolution) { VHLowVideoResolution = kLowVideoResolution, //低分边率 352*288 VHGeneralVideoResolution = kGeneralVideoResolution, //普通分辨率 640*480 VHHVideoResolution = kHVideoResolution, //高分辨率 960*540 VHHDVideoResolution = kHDVideoResolution //超高分辨率 1280*720 };

pragma mark - 观看端常量定义

观看端错误事件,当VHLivePlayGetUrlError时, content代表出错原因 及具体错误码查看错误码定义。 typedef NS_ENUM(NSInteger,VHLivePlayErrorType) { VHLivePlayErrorNone = kLiveStatusNone, VHLivePlayGetUrlError = kLivePlayGetUrlError, //获取服务器rtmpUrl错误 VHLivePlayParamError = kLivePlayParamError, //参数错误 VHLivePlayRecvError = kLivePlayRecvError, //接受数据错误 VHLivePlayCDNConnectError = kLivePlayCDNConnectError, //CDN链接失败 }; 直播播放器视频填充模式,回放使用MPMoviePlayerController 自带填充模式设置。 typedef NS_ENUM(NSInteger,VHRTMPMovieScalingMode) { VHRTMPMovieScalingModeNone = kRTMPMovieScalingModeNone, //填充满video显示view VHRTMPMovieScalingModeAspectFit = kRTMPMovieScalingModeAspectFit, //在保持长宽比的前提下,缩放图片,使得图片在容器内完整显示出来 可能留有黑边 VHRTMPMovieScalingModeAspectFill = kRTMPMovieScalingModeAspectFill, //在保持长宽比的前提下,缩放图片,使图片充满容器 }; 直播流类型 typedef NS_ENUM(NSInteger,VHStreamType) { VHStreamTypeNone = kVHallStreamTypeNone, //未知 VHStreamTypeVideoAndAudio = kVHallStreamTypeVideoAndAudio,//音视频 VHStreamTypeOnlyVideo = kVHallStreamTypeOnlyVideo, //纯视频无音频 VHStreamTypeOnlyAudio = kVHallStreamTypeOnlyAudio, //纯音频 }; 视频渲染模式 typedef NS_ENUM(NSInteger,VHRenderModel){ VHRenderModelNone = kVHallRenderModelNone, VHRenderModelOrigin = kVHallRenderModelOrigin, //普通视图的渲染 VHRenderModelDewarpVR = kVHallRenderModelDewarpVR, //VR视图的渲染 }; 播放器状态、直播状态、回放状态由于用户创建的 MPMoviePlayerController 实例获取 typedef NS_ENUM(NSInteger,VHPlayerState) { VHPlayerStateStoped = 0, //停止 可调用startPlay: startPlayback: 状态转为VHallPlayerStateStarting VHPlayerStateStarting = 1, //启动中 VHPlayerStatePlaying = 2, *播放中 可调用stopPlay pausePlay 状态转为VHallPlayerStateStoped/VHallPlayerStatePaused VHPlayerStateStreamStoped = 3, *直播流停止 暂停pausePlay/流连接错误触发 可调用stopPlay reconnectPlay状态转为VHallPlayerStateStoped/VHallPlayerStatePlaying }; 活动布局模式 typedef NS_ENUM(NSInteger,VHMovieVideoPlayMode) { VHMovieVideoPlayModeNone = 0, //不存在 VHMovieVideoPlayModeMedia = 1, //单视频 VHMovieVideoPlayModeTextAndVoice = 2, //文档+声音 VHMovieVideoPlayModeTextAndMedia = 3, //文档+视频 VHMovieVideoPlayModeVoice = 4, //单音频 }; 直播视频清晰度 typedef NS_ENUM(NSInteger,VHMovieDefinition) { VHMovieDefinitionOrigin = 0, //原画 VHMovieDefinitionUHD = 1, //超高清 VHMovieDefinitionHD = 2, //高清 VHMovieDefinitionSD = 3, //标清 VHMovieDefinitionAudio = 4, //纯音频 }; 活动状态 typedef NS_ENUM(NSInteger,VHMovieActiveState) { VHMovieActiveStateNone = 0, VHMovieActiveStateLive = 1, //直播 VHMovieActiveStateReservation = 2, //预约 VHMovieActiveStateEnd = 3, //结束 VHMovieActiveStateReplay = 4, //回放or点播