Commit afe8fb36 by zhangyunjie

2.5.4.2

parent d4049c56
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'OffcnLiveSDKiOS' s.name = 'OffcnLiveSDKiOS'
s.version = '2.5.5.0' s.version = '2.5.4.2'
s.summary = 'OffcnLiveSDKiOS.' s.summary = 'OffcnLiveSDKiOS.'
s.description = <<-DESC s.description = <<-DESC
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
//#import "OffcnShareWindow.h" //#import "OffcnShareWindow.h"
static const NSString *OffcnLiveSDKVersion = @"2.5.5.0"; static const NSString *OffcnLiveSDKVersion = @"2.5.4.2";
@interface OffcnPlaybackModel : NSObject @interface OffcnPlaybackModel : NSObject
//口令 //口令
...@@ -34,12 +34,6 @@ typedef NS_ENUM(NSUInteger, OffcnJumpMode) { ...@@ -34,12 +34,6 @@ typedef NS_ENUM(NSUInteger, OffcnJumpMode) {
OffcnJumpModePresent, OffcnJumpModePresent,
}; };
typedef NS_ENUM(NSUInteger, OffcnSDKReachabilityStatus) {
OffcnSDKReachabilityStatusNotReachable = 0,
OffcnSDKReachabilityStatusViaWWAN,
OffcnSDKReachabilityStatusViaWiFi,
};
//直播间退出房间后回调 //直播间退出房间后回调
typedef void(^liveQuitCallBack)(NSString *password); typedef void(^liveQuitCallBack)(NSString *password);
...@@ -53,9 +47,6 @@ typedef void(^liveQuitCallBack)(NSString *password); ...@@ -53,9 +47,6 @@ typedef void(^liveQuitCallBack)(NSString *password);
*/ */
typedef void(^playbackCallBack)(NSString *password, NSInteger recentlyWatchValue, CGFloat maxWatchValue, NSInteger totalValue); typedef void(^playbackCallBack)(NSString *password, NSInteger recentlyWatchValue, CGFloat maxWatchValue, NSInteger totalValue);
//网络监听回调
typedef void(^OffcnSDKReachabilityStatusCallBack)(OffcnSDKReachabilityStatus status);
@interface OffcnLiveSDK : NSObject @interface OffcnLiveSDK : NSObject
...@@ -91,10 +82,6 @@ typedef void(^OffcnSDKReachabilityStatusCallBack)(OffcnSDKReachabilityStatus sta ...@@ -91,10 +82,6 @@ typedef void(^OffcnSDKReachabilityStatusCallBack)(OffcnSDKReachabilityStatus sta
//回放观看过程中进度model(只在观看过程中有数据,退出房间后就被清空了) //回放观看过程中进度model(只在观看过程中有数据,退出房间后就被清空了)
@property (nonatomic, strong) OffcnPlaybackModel *playbackModel; @property (nonatomic, strong) OffcnPlaybackModel *playbackModel;
@property (nonatomic, assign) OffcnSDKReachabilityStatus OffcnReachabilityStatus;
@property (nonatomic, copy) OffcnSDKReachabilityStatusCallBack reachabilityStatusCallBack;
/** /**
使用RealReachability监听网络状态上传用户观看进度统计数据和获取敏感词 使用RealReachability监听网络状态上传用户观看进度统计数据和获取敏感词
*/ */
......
//
// OffcnSmallClassSDK.h
// OffcnLiveSDK
//
// Created by vockey on 2020/7/2.
// Copyright © 2020 中公教育. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
//事件回调枚举
typedef NS_ENUM(NSUInteger, OffcnSmallClassSDKEvent) {
OffcnSmallClassSDKEventUserLogin = 1, //用户登录事件回调
OffcnSmallClassSDKEventUserLogout, //用户退出事件回调
OffcnSmallClassSDKEventJoin, //加入会话事件回调
OffcnSmallClassSDKEventUnJoin, //退出会话事件回调
OffcnSmallClassSDKEventPush, //上台事件回调
OffcnSmallClassSDKEventUnPush, //下台事件回调
OffcnSmallClassSDKEventPub, //用户上台连麦(包含自己)事件回调
OffcnSmallClassSDKEventUnPub, //用户下台断麦(包含自己)事件回调
OffcnSmallClassSDKEventSub, //拉流成功事件回调
OffcnSmallClassSDKEventUnSub, //解除拉流事件回调
OffcnSmallClassSDKEventAudioEnable, //用户设置音频开关(包含自己)事件回调
OffcnSmallClassSDKEventVideoEnable, //用户设置视频开关(包含自己)事件回调
OffcnSmallClassSDKEventMuteAudio, //停止,恢复接受指定音频流事件回调
OffcnSmallClassSDKEventMuteVideo, //停止,恢复接受指定视频流事件回调
OffcnSmallClassSDKEventStartPreview, //开启视频预览事件回调
OffcnSmallClassSDKEventConnect, //长连接状态事件回调
OffcnSmallClassSDKEventOnlineNumberUpdate, //房间实时人数变更事件回调
OffcnSmallClassSDKEventEquipmentUpdate, //用户设备状态改变
OffcnSmallClassSDKEventEndRoom, //结束课程
OffcnSmallClassSDKEventOtherError, //其它异常事件回调
};
//事件回调返回的数据模型
@interface OffcnSmallClassSDKResponseModel : NSObject
//是否成功
@property (nonatomic,assign) BOOL isSuccess;
//昵称
@property (nonatomic,copy) NSString *nickname;
//uuid
@property (nonatomic,copy) NSString *uuid;
//上台成功返回视频渲染视图
@property (nonatomic,strong) UIView *renderView;
//错误码
@property (nonatomic,assign) NSInteger code;
//返回的错误信息
@property (nonatomic,copy) NSString *errorMessage;
//返回的原内容
@property (nonatomic) id responseObject;
-(instancetype)initWithResponseObject:(id)responseObject;
@end
@protocol OffcnSmallClassSDKDelegate <NSObject>
//事件回调
-(void)offcnSmallClassSDKEvent:(OffcnSmallClassSDKEvent)event responseModel:(OffcnSmallClassSDKResponseModel *)responseModel;
@optional
//音量大小回调
-(void)volumeChangedWithUUID:(NSString *)uuid value:(unsigned short)value;
@end
@interface OffcnSmallClassSDK : NSObject
@property(nonatomic, weak) id<OffcnSmallClassSDKDelegate> delegate;
//在线人数
@property (nonatomic, copy) NSString *online_num;
//房间允许最大推流人数
@property (nonatomic, assign) NSInteger max_push;
//设备状态
@property (nonatomic, strong) NSMutableDictionary *userEquipmentDic;
//创建直播单例服务
+(OffcnSmallClassSDK *)defaultService;
//登陆房间
-(void)loginWithUUID:(NSString *)uuid userName:(NSString *)userName password:(NSString *)password extensionDic:(NSDictionary *)extensionDic;
//退出房间
-(void)leaveRoom;
//加入会话
-(void)join;
//退出会话
-(void)unjoin;
//设置是否默认接收音频流
-(void)setDefaultMuteAllRemoteAudioStreams:(BOOL)mute;
//设置是否默认接收视频流
-(void)setDefaultMuteAllRemoteVideoStreams:(BOOL)mute;
//推流上台
-(void)push;
//断流下台
-(void)unpush;
//订阅指定流
-(void)subWithUUID:(NSString *)uuid;
//解除订阅指定流
-(void)unsubWithUUID:(NSString *)uuid;
//开启视频预览
-(void)startPreview;
//停止视频预览
-(void)stopPreview;
//切换前置、后置摄像头
-(void)switchCamera;
//开,关本地音频采集
-(void)enableLocalAudio:(BOOL)enable;
//停止,恢复发送本地音频流
-(void)muteLocalAudioStream:(BOOL)mute;
//停止,恢复接受指定音频流
-(void)muteRemoteAudioStream:(NSString *)uuid mute:(BOOL)mute;
//停止,接收所有远端音频流
-(void)muteAllRemoteAudioStreams:(BOOL)mute;
//开,关本地视频采集
-(void)enableLocalVideo:(BOOL)enable;
//停止,恢复发送本地视频流
-(void)muteLocalVideoStream:(BOOL)mute;
//停止,恢复接受指定视频流
-(void)muteRemoteVideoStream:(NSString *)uuid mute:(BOOL)mute;
//停止,接收所有远端视频流
-(void)muteAllRemoteVideoStreams:(BOOL)mute;
//开启,关闭日志
-(void)setEnableLog:(BOOL)enable;
@end
NS_ASSUME_NONNULL_END
//
// OffcnSmallClassSDKModel.h
// OffcnLiveSDK
//
// Created by vockey on 2020/7/14.
// Copyright © 2020 中公教育. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface OffcnSmallClassSDKEquipmentModel : NSObject
@property (nonatomic, copy) NSString *userID;
@property (nonatomic, assign) BOOL cameraEnabled;
@property (nonatomic, assign) BOOL microphoneEnabled;
@end
NS_ASSUME_NONNULL_END
//
// OffcnVideoView.h
// OffcnLiveSDK
//
// Created by vockey on 2020/7/16.
// Copyright © 2020 中公教育. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef void(^recentlyWatchCallBack)(NSInteger recentlyWatchValue, NSInteger totalValue);
//窗口旋转回调
typedef void(^windowRotationCallBack)(UIInterfaceOrientation interfaceOrientation);
@interface OffcnVideoView : UIView
@property (nonatomic, assign) BOOL isDefaultPlay;//默认是否播放
@property (nonatomic, assign) BOOL isHiddenReturnBtn;//是否隐藏返回按钮
@property (nonatomic, assign) BOOL isHiddenTitle;//是否隐藏标题
@property (nonatomic, assign) BOOL isHiddenNavTool;//是否隐藏顶部工具栏
@property (nonatomic, assign) BOOL isHiddenTabTool;//是否隐藏底部工具栏
//回放开始的时间,单位:秒,默认从0秒开始,根据需求是否从上次观看记录的位置开始播放,如果没有上次观看记录的位置请传0
@property (nonatomic, assign) NSTimeInterval seekTime;
@property (nonatomic, copy) NSString *titleStr;//标题
@property (nonatomic, assign) BOOL isMusic;//是否播放音乐
@property (nonatomic, strong) UIImageView *musicImage;//播放音乐背景
//设置播放地址和解密密HLS需要的Key
@property (nonatomic, copy) NSString *rtmlStr;//播放地址
@property (nonatomic, copy) NSString *keyStr;//没有加密的视频不用传
@property (nonatomic, copy) recentlyWatchCallBack recentlyWatchCallBack;//回放观看进度回调
@property (nonatomic, assign) UIInterfaceOrientation interfaceOrientation;//竖横屏
@property (nonatomic, copy) windowRotationCallBack windowRotationCallBack;//窗口旋转回调
@property (nonatomic, copy) void(^returnBtnActionCallBack)(UIInterfaceOrientation interfaceOrientation, NSInteger recentlyWatchValue, NSInteger totalValue);//返回按钮回调
@end
...@@ -39,7 +39,7 @@ NS_EXTENSION_UNAVAILABLE_IOS("Rendering not available in app extensions.") ...@@ -39,7 +39,7 @@ NS_EXTENSION_UNAVAILABLE_IOS("Rendering not available in app extensions.")
- (instancetype)initWithCoder:(NSCoder *)aDecoder - (instancetype)initWithCoder:(NSCoder *)aDecoder
shader:(id<RTCVideoViewShading>)shader NS_DESIGNATED_INITIALIZER; shader:(id<RTCVideoViewShading>)shader NS_DESIGNATED_INITIALIZER;
- (UIImage*)snapShot:(BOOL)isPreview;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
/*
* Copyright 2014 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#import "RTCSessionDescription+JSON.h"
static NSString const *kRTCSessionDescriptionTypeKey = @"path";
static NSString const *kRTCSessionDescriptionSdpKey = @"sdp";
@implementation RTCSessionDescription (JSON)
+ (RTCSessionDescription *)descriptionFromJSONDictionary:
(NSDictionary *)dictionary {
NSString *typeString = dictionary[kRTCSessionDescriptionTypeKey];
//typeString = [typeString stringByReplacingOccurrencesOfString:@"rtcserver/" withString:@""];
RTCSdpType type = [[self class] typeForString:typeString];
NSString *sdp = dictionary[kRTCSessionDescriptionSdpKey];
return [[RTCSessionDescription alloc] initWithType:type sdp:sdp];
}
- (NSData *)JSONData {
NSString *type = [[self class] stringForType:self.type];
NSDictionary *json = @{
kRTCSessionDescriptionTypeKey : type,
kRTCSessionDescriptionSdpKey : self.sdp
};
return [NSJSONSerialization dataWithJSONObject:json options:0 error:nil];
}
@end
#import "RtcConnection.h"
@implementation RtcConnection
@end
...@@ -174,28 +174,14 @@ static const char *ZGWebrtcVersion = "0.1.20"; ...@@ -174,28 +174,14 @@ static const char *ZGWebrtcVersion = "0.1.20";
- (void)close; - (void)close;
/** /**
获取camera的截图,camera没开启时主动开启并截图 获取camera的截图
通过onSnapshot回调截图
*/ */
- (void)getSnapshot;
/**
开启关闭日志功能 true打开,false 关闭
*/
-(void)logOutput:(BOOL)logEnable;
/**
开启预览
*/
-(void)startPreview;
- (void)getSnapshot;
/** - (void)openCameraForSnapshot;
关闭预览
*/
-(void)stopPreview;
- (void)closeCameraForSnapshot;
@end @end
#import "RtcHandle.h"
@implementation RtcHandle
@end
#import "RtcTransaction.h"
@implementation RtcTransaction
@end
...@@ -76,9 +76,6 @@ typedef enum ZGPlayerType { ...@@ -76,9 +76,6 @@ typedef enum ZGPlayerType {
// 设置播放地址 // 设置播放地址
- (BOOL)setContentURL:(NSURL *)aUrl; - (BOOL)setContentURL:(NSURL *)aUrl;
// 设置播放地址和解密密HLS需要的Key
- (BOOL)setContentURLWithKey:(NSURL *)aUrl key:(NSString*)key;
// 重启 // 重启
- (void)reset; - (void)reset;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment