Skip to content

Commit 8cc2bbd

Browse files
committed
2 parents 9ce9d89 + 0d94e63 commit 8cc2bbd

File tree

17 files changed

+483
-252
lines changed

17 files changed

+483
-252
lines changed

Prj-iOS/AR-Live-Tutorial/AR-Live-Tutorial/VideoPlayer/ArPlayerViewController.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ArPlayerViewController: UIViewController {
1414
@IBOutlet var modeLabel: UILabel!
1515

1616
fileprivate var liveStatus: ARLivePlayStatus = .stopped
17-
fileprivate var renderMode: ARLiveRenderMode = .hidden
17+
fileprivate var renderMode: ARLiveRenderMode = .fit
1818
/// 拉流url
1919
var pullUrl: String!
2020

@@ -44,6 +44,8 @@ class ArPlayerViewController: UIViewController {
4444
/// 设置播放器的视频渲染 View
4545
livePlayer.setRenderView(renderView)
4646
livePlayer.setRenderFill(renderMode)
47+
/// 设置视频播放模式
48+
livePlayer.setPlayMode(.live)
4749

4850
/// 设置播放器缓存自动调整的最小和最大时间 ( 单位:秒 )
4951
livePlayer.setCacheParams(1.0, maxTime: 100)

Prj-iOS/ARLiveKit/ARLiveEnumerates.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,18 @@ typedef NS_ENUM(NSInteger, ARLiveVideoScaleMode) {
365365
ARLiveVideoScaleModeAuto
366366
};
367367

368+
/**
369+
* @brief 视频播放模式。
370+
*/
371+
typedef NS_ENUM(NSInteger, ARLivePlayMode) {
372+
373+
/// 直播模式 - 暂停的过程中,数据会丢失,保证实时性
374+
ARLivePlayModeLive,
375+
376+
/// 点播模式 - 暂停的过程中,数据不会丢失,恢复后会继续播放
377+
ARLivePlayModeVod
378+
};
379+
368380

369381

370382
#endif /* ARLiveEnumerates_h */

Prj-iOS/ARLiveKit/ARLivePlayer.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ NS_ASSUME_NONNULL_BEGIN
7070
*/
7171
- (int)stopPlay;
7272

73+
/**
74+
* 设置视频播放模式
75+
*
76+
* @param mode 播放模式,详见 ARLivePlayMode。
77+
* @return 0方法调用成功,<0方法调用失败
78+
*/
79+
- (int)setPlayMode:(ARLivePlayMode)mode;
80+
7381
/**
7482
* 播放器是否正在播放中。
7583
*

Prj-iOS/ARLiveKit/ARLivePlayer.mm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,14 @@ - (int)stopPlay {
292292
return -1;
293293
}
294294

295+
- (int)setPlayMode:(ARLivePlayMode)mode {
296+
/// 设置视频播放模式
297+
if (_livePlayer) {
298+
return _livePlayer->setPlayMode((anyrtc::ArLivePlayMode)mode);
299+
}
300+
return -1;
301+
}
302+
295303
- (int)isPlaying {
296304
/// 播放器是否正在播放中
297305
if (_livePlayer) {

Prj-iOS/ARLiveLibrary.xcodeproj/project.pbxproj

Lines changed: 14 additions & 250 deletions
Large diffs are not rendered by default.
Binary file not shown.

Prj-iOS/WebRTC.framework/.DS_Store

-6 KB
Binary file not shown.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ anyLive 是 [anyRTC](https://www.anyrtc.io/) 开源的推拉流项目。采用
3131
| 系统 | 编译环境 | CPU架构 |
3232
| ----------------- | ------------------- | ---------------------- |
3333
| Android 4.4及以上 | Android Studio、NDK | armeabi-v7a、arm64-v8a |
34-
| iOS 9.0及以上 | XCode11 | arm64、armv7 |
34+
| iOS 9.0及以上 | Xcode14 | arm64 |
3535
| Windows 7及以上 | VS2015,VS2017 | x86、x86-64 |
3636

3737
### 第三方库

third_lib/ffmpeg_ios/libavcodec.a

423 KB
Binary file not shown.

third_lib/ffmpeg_ios/libavdevice.a

93.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)