CNLivePlayerDef.h 2.5 KB
//
//  CNLivePlayerDef.h
//  QNLiveStreamingDemo
//
//  Created by iOS on 16/12/31.
//  Copyright © 2016年 zhulin. All rights reserved.
//

#ifndef CNLivePlayerDef_h
#define CNLivePlayerDef_h


/**
 *  播放画面旋转模式
 */
typedef NS_ENUM(NSInteger, CNLivePLayerRotationsMode) {
    CNLivePlayerNoRotation,         // 无旋转
    CNLivePlayerRotateLeft,         // 向左旋
    CNLivePlayerRotateRight,        // 向右旋
    CNLivePlayerFlipVertical,       // 垂直翻转
    CNLivePlayerFlipHorizonal,      // 水平翻转
    CNLivePlayerRotate180           // 旋转 180 度
};

/**
 * CNLivePlayer 的播放状态
 */
typedef NS_ENUM(NSInteger, CNLivePlayerStatus) {
    
    /**
     CNLivePlayer 未知状态,只会作为 init 后的初始状态,开始播放之后任何情况下都不会再回到此状态。
     */
    CNLivePlayerStatusUnknow = 0,
    
    /**
     CNLivePlayer 正在准备播放所需组件,在调用 -play 方法时出现。
     */
    CNLivePlayerStatusPreparing = 1,
    
    /**
     CNLivePlayer 播放组件准备完成,准备开始播放,在调用 -play 方法时出现。
     */
    CNLivePlayerStatusReady = 2,
    
    /**
     @abstract CNLivePlayer 缓存数据为空状态。
     
     @discussion 特别需要注意的是当推流端停止推流之后,CNLivePlayer 将出现 caching 状态直到 timeout 后抛出 timeout 的 error 而不是出现 CNLivePlayerStatusStopped 状态,因此在直播场景中,当流停止之后一般做法是使用 IM 服务告知播放器停止播放,以达到即时响应主播断流的目的。
     */
    CNLivePlayerStatusCaching = 3,
    
    /**
     CNLivePlayer 正在播放状态。
     */
    CNLivePlayerStatusPlaying = 4,
    
    /**
     CNLivePlayer 暂停状态。
     */
    CNLivePlayerStatusPaused = 5,
    
    /**
     @abstract CNLivePlayer 停止状态
     @discussion 该状态仅会在回放时播放结束出现,RTMP 直播结束并不会出现此状态
     */
    CNLivePlayerStatusStopped = 6,
    
    /**
     CNLivePlayer 错误状态,播放出现错误时会出现此状态。
     */
    CNLivePlayerStatusError = 7,
    
    /**
     *  CNLivePlayer 自动重连的状态
     */
    CNLivePlayerStateAutoReconnecting = 8
    
};

/**
 *  主播直播状态
 */
typedef NS_ENUM(NSUInteger, CNLiveAnchorStatus) {
    ///主播直播中
    CNLiveAnchorStatusLiving = 0,
    ///主播已离开
    CNLiveAnchorStatusLeaving,
    ///直播已结束
    CNLiveAnchorStatusEnd,
};

#endif /* CNLivePlayerDef_h */