TXLivePlayer.h 2.38 KB
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "TXLivePlayListener.h"

@interface TXLivePlayer : NSObject

@property (nonatomic, weak)     id<TXLivePlayListener>  delegate;

@property (nonatomic, assign)   BOOL            enableHWAcceleration;

/* setupVideoWidget 创建Video渲染Widget,该控件承载着视频内容的展示。
 * 参数:
 *      frame : Widget在父view中的rc
 *      view : 父view
 */
-(void) setupVideoWidget:(CGRect)frame ContainView:(UIView*)view InsertIndex:(unsigned int)idx;

/* 修改VideoWidget frame
 */
-(void) resetVideoWidgetFrame:(CGRect)frame;

/* removeVideoWidget 移除Video渲染Widget
 */
-(void) removeVideoWidget;


/* startPlay 启动从指定URL播放RTMP音视频流
 * 参数:
 *      url : RTMP完整的URL
 * 返回: 0 = OK
 */
-(int) startPlay:(NSString*)url;


/* stopPlay 停止播放RTMP音视频流
 * 返回: 0 = OK
 */
-(int) stopPlay;

/* setRenderRotation 设置画面的方向
 * 参数:
 *       rotation : 角度 0,90,180,270.
 */
-(void) setRenderRotation:(int)rotation;

/* setRenderMode 设置画面的裁剪模式
 * 参数
 *       renderMode : 详见 TX_Enum_Type_RenderMode 的定义。
 */
-(void) setRenderMode:(int)renderMode;

/* setLogLevel 设置log输出级别
 *  level:参见 LOGLEVEL
 *
 */
-(void) setLogLevel:(TX_Enum_Type_LogLevel) level;

/* getSDKVersion 获取SDK版本信息
 *
 */
-(NSArray*) getSDKVersion;

/*  setCacheTime 指定播放器缓存时间
 *  参数:
 *       time: 播放器的缓存时间(单位秒),time需要大于0
 *
 */
-(void) setCacheTime:(int)time;

/*  setAutoAdjustCache 自动调整播放器缓存时间
 *  参数:
 *        bEnable: YES:启用自动调整,自动调整的最大值和最小值可以分别通过setMaxCacheTime和setMinCacheTime设置;
 *                 NO:关闭自动调整,采用默认的指定缓存时间(1s),可以通过setCacheTime修改
 */
-(void) setAutoAdjustCache:(BOOL)bEnable;

/*  setMaxCacheTime 设置播放器缓存自动调整的最大时间
 *  参数:
 *       time: 时间(单位秒),time需要大于0
 *
 */
-(void) setMaxCacheTime:(int)time;

/*  setMinCacheTime 指定播放器缓存自动调整的最小时间
 *  参数:
 *       time: 时间(单位秒),time需要大于0
 *
 */
-(void) setMinCacheTime:(int)time;


@end