Skip to content

Commit

Permalink
Merge pull request #87 from ShengQiangLiu/v6.4.0-release
Browse files Browse the repository at this point in the history
release 6.4.0
  • Loading branch information
HeraShowFeng authored Aug 19, 2024
2 parents 2926dca + 9a22eef commit 2747515
Show file tree
Hide file tree
Showing 43 changed files with 11,622 additions and 8,766 deletions.
49 changes: 49 additions & 0 deletions APIDiffs/api-diffs-6.4.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# QNRTCKit 6.3.0 to 6.4.0 API Differences

## General Headers
```
QNRTC.h
```
- *Added* method `+ (QNMediaPlayer *)createMediaPlayer;`

```
QNMediaPlayer.h
```
- *Added* property `@property (nonatomic, weak) id<QNMediaPlayerDelegate> delegate;`
- *Added* method `- (int)play:(QNMediaSource *)source;`
- *Added* method `- (int)pause;`
- *Added* method `- (int)stop;`
- *Added* method `- (int)resume;`
- *Added* method `- (int)seek:(NSUInteger)positionMs;`
- *Added* method `- (int)getDuration;`
- *Added* method `- (int)getCurrentPosition;`
- *Added* method `- (int)setLoopCount:(NSInteger)loopCount;`
- *Added* method `- (QNPlayerState)getCurrentPlayerState;`
- *Added* method `- (void)setView:(QNVideoGLView *)videoView;`
- *Added* method `- (QNCustomVideoTrack *)getMediaPlayerVideoTrack;`
- *Added* method `- (QNCustomAudioTrack *)getMediaPlayerAudioTrack;`

```
QNPlayerEventInfo
```
- *Added* property `@property (nonatomic, strong) NSString *message;`
- *Added* property `@property (nonatomic, assign) int errorCode;`
```
QNMediaSource
```
- *Added* property `@property (nonatomic, strong) NSString *url;`

```
QNMediaPlayerDelegate
```
- *Added* method `- (void)mediaPlayer:(QNMediaPlayer *)player didPlayerStateChanged:(QNPlayerState)state;`
- *Added* method `- (void)mediaPlayer:(QNMediaPlayer *)player didPlayerEvent:(QNPlayerEvent)event eventInfo:(QNPlayerEventInfo *)info;`
- *Added* method `- (void)mediaPlayer:(QNMediaPlayer *)player didPlayerPositionChanged:(NSUInteger)position;`
```
QNTypeDefines
```
- *Added* `QNMediaPlayerReasonCode`
- *Added* `QNPlayerState`
- *Added* `QNPlayerEvent`
```
Binary file modified Pod/iphoneos/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion Pod/iphoneos/QNRTCKit.framework.dSYM/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>6.3.0</string>
<string>6.4.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
Binary file not shown.

Large diffs are not rendered by default.

Binary file modified Pod/iphoneos/QNRTCKit.framework/.DS_Store
Binary file not shown.
165 changes: 165 additions & 0 deletions Pod/iphoneos/QNRTCKit.framework/Headers/QNMediaPlayer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
//
// QNMediaPlayer.h
// QNRTCKit
//
// Created by ShengQiang'Liu on 2024/6/6.
// Copyright © 2024 Pili Engineering, Qiniu Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "QNVideoGLView.h"
#import "QNTrack.h"
#import "QNTypeDefines.h"

NS_ASSUME_NONNULL_BEGIN

@class QNMediaPlayer;
/**
事件信息
*/
@interface QNPlayerEventInfo : NSObject
/*!
* @abstract 说明信息
*
* @since v6.4.0
*/
@property (nonatomic, strong) NSString *message;
/*!
* @abstract 错误码
*
* @since v6.4.0
*/
@property (nonatomic, assign) int errorCode;
@end

@protocol QNMediaPlayerDelegate <NSObject>
/**
* 状态发生变化的回调
*
* @param state 播放状态
* @see QNPlayerState
*
* @since v6.4.0
*/
- (void)mediaPlayer:(QNMediaPlayer *)player didPlayerStateChanged:(QNPlayerState)state;
/** 事件变化的回调
*
* @param event 播放事件
* @see QNPlayerEvent
* @param info 事件携带的信息
* @see QNPlayerEventInfo
*
* @since v6.4.0
*/
- (void)mediaPlayer:(QNMediaPlayer *)player didPlayerEvent:(QNPlayerEvent)event eventInfo:(QNPlayerEventInfo *)info;
/**
* 播放进度变化的回调
*
* @param position 播放进度,回调频率 1s 一次,单位(ms)
*
* @since v6.4.0
*/
- (void)mediaPlayer:(QNMediaPlayer *)player didPlayerPositionChanged:(NSUInteger)position;

@end

@interface QNMediaSource : NSObject
/*!
* @abstract 设置视频播放地址
*
* @since v6.4.0
*/
@property (nonatomic, strong) NSString *url;
@end

@interface QNMediaPlayer : NSObject

- (instancetype)init NS_UNAVAILABLE;

/**
* 设置监听回调
*/
@property (nonatomic, weak) id<QNMediaPlayerDelegate> delegate;
/**
* 开始播放
*
* @param source QNMediaSource 参数配置
* @see QNMediaSource
*
* @since v6.4.0
*/
- (int)play:(QNMediaSource *)source;
/**
* 暂停播放
*
* @since v6.4.0
*/
- (int)pause;
/**
* 停止播放
*
* @since v6.4.0
*/
- (int)stop;
/**
* 恢复播放
*
* @since v6.4.0
*/
- (int)resume;
/**
* seek 到某一点播放
* @param positionMs seek 位置,单位(ms)
*
* @since v6.4.0
*/
- (int)seek:(NSUInteger)positionMs;
/**
* 获取点播文件总时长,直播流获取返回 0。单位(ms)
*
* @since v6.4.0
*/
- (int)getDuration;
/**
* 获取播放进度
*
* @since v6.4.0
*/
- (int)getCurrentPosition;
/**
* 设置循环播放次数
* @param loopCount 循环次数,默认值为 1,设置 -1,表示一直循环
*
* @since v6.4.0
*/
- (int)setLoopCount:(NSInteger)loopCount;
/**
* 获取播放状态
*
* @since v6.4.0
*/
- (QNPlayerState)getCurrentPlayerState;
/*!
* @abstract 视频渲染
*
* @discussion videoView 会被内部引用,外部销毁时需主动传 nil
*
* @since v6.4.0
*/
- (void)setView:(QNVideoGLView *)videoView;
/**
* 获取需要发布到房间内的 VideoTrack,外部拿到 VideoTrack 之后,由调用方通过调用 destroy 进行释放。
*
* @since v6.4.0
*/
- (QNCustomVideoTrack *)getMediaPlayerVideoTrack;
/**
* 获取需要发布到房间内的 AudioTrack,外部拿到 AudioTrack 之后,由调用方通过调用 destroy 进行释放。
*
* @since v6.4.0
*/
- (QNCustomAudioTrack *)getMediaPlayerAudioTrack;

@end

NS_ASSUME_NONNULL_END
8 changes: 8 additions & 0 deletions Pod/iphoneos/QNRTCKit.framework/Headers/QNRTC.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#import "QNRTCLogConfiguration.h"
#import "QNCDNStreamingClient.h"
#import "QNMediaRecorder.h"
#import "QNMediaPlayer.h"

@class QNRTC;
@class QNRTCConfiguration;
Expand Down Expand Up @@ -172,6 +173,13 @@ NS_ASSUME_NONNULL_BEGIN
*/
+ (QNMediaRecorder *)createMediaRecorder;

/*!
* @abstract 创建媒体播放器
*
* @since v6.4.0
*/
+ (QNMediaPlayer *)createMediaPlayer;

/*!
* @abstract 创建背景音乐混音对象实例
*
Expand Down
41 changes: 41 additions & 0 deletions Pod/iphoneos/QNRTCKit.framework/Headers/QNTypeDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,27 @@ typedef NS_ENUM(NSUInteger, QNMediaRecorderState) {
QNMediaRecorderStateError,
};

/*!
* @abstract 播放器状态
*/
typedef NS_ENUM(NSUInteger, QNPlayerState) {
QNPlayerStateIdle = 0, // kStoped,初始化,停止播放,播放失败等状态
QNPlayerStatePrepare, // 启播过程中状态
QNPlayerStatePlaying, // 播放状态
QNPlayerStatePause // 暂停状态
};

/*!
* @abstract 播放器事件
*/
typedef NS_ENUM(NSUInteger, QNPlayerEvent) {
QNPlayerEventNone = 0,
QNPlayerEventFirstRender, // 首帧视频渲染
QNPlayerEventOpenFileFailed, // 打开文件或者直播流失败
QNPlayerEventDecoderFailed // 初始化解码失败或者解码过程中失败
};


#pragma mark - Media Recorder Error Code
typedef NS_ENUM(NSInteger, QNMediaRecorderReasonCode) {
/*!
Expand Down Expand Up @@ -1047,6 +1068,26 @@ typedef NS_ENUM(NSInteger, QNMediaRecorderReasonCode) {
QNMediaRecorderReasonCodeScaleFailed = 40008,
};

#pragma mark - Media Player Error Code
typedef NS_ENUM(NSInteger, QNMediaPlayerReasonCode) {
/*!
* @abstract 打开文件失败
*/
QNMediaPlayerOpenFileFailed = 50001,
/*!
* @abstract 解码失败
*/
QNMediaPlayerDecoderFailed = 50002,
/*!
* @abstract seek 失败
*/
QNMediaPlayerSeekFailed = 50003,
/*!
* @abstract 无效的播放状态
*/
QNMediaPlayerInvalidState = 50004
};

#pragma mark - callback define

/*!
Expand Down
Binary file modified Pod/iphoneos/QNRTCKit.framework/Info.plist
Binary file not shown.
Binary file modified Pod/iphoneos/QNRTCKit.framework/QNRTCKit
Binary file not shown.
Loading

0 comments on commit 2747515

Please sign in to comment.