云视频会议Mac UI-SDK提供了一套用于入视频会议的接口集合,开发者可以通过调用Alimeeting UI SDK(下面统一简称SDK),可以在自己的Mac软件中快速集成带UI的云视频会议。
SDK主要功能点包括:
1.加入音视频会议
2.会议UI界面定制
3.会议信息&&SLS定制
4.会议状态回调
5.人员入离会状态回调
本文面向有一定Cocoa以及objectiveC基础的开发者,旨在引导读者快速接入SDK。
SDK&&SDK-Sample附件下载地址:
首先,下载解压SDK文件压缩包,可以看到以下文件:
AliMeetingUISDK.framework:UI-SDK库
SDKSample:使用AliMeetingUISDK.framework的Demo代码
在接入SDK前需要以下环境:
名称 | 要求 |
---|---|
macOS版本 | macOS 10.11及以上 |
Xcode版本 | Xcode 10.3及以上 |
注:如果确实需要Hardened Runtime模式,可以进行如下设置
构建入会信息,添加各项入会参数,详细信息请参考3.5.1会议配置枚举或SDK中的头文件AMUISDKMeetingConfig.h
NSDictionary *meetingConfig = @{
AMUISDKMeetingConfigClientAppId:clientAppId,
AMUISDKMeetingConfigSlsInfo:slsInfo,
AMUISDKMeetingConfigMeetingUUID:meetingUUID,
AMUISDKMeetingConfigMemberUUID:memberUUID,
AMUISDKMeetingConfigMeetingToken:meetingToken,
AMUISDKMeetingConfigMeetingDomain:meetingDomain,
AMUISDKMeetingConfigUserId:userId
};
注:meetingConfig以下参数需要从ISV服务端获取:
(关于云视频会议的开发流程请参考文档:https://help.aliyun.com/document_detail/145896.html )
AMUISDKMeetingConfigClientAppId
AMUISDKMeetingConfigSlsInfo
AMUISDKMeetingConfigMeetingUUID
AMUISDKMeetingConfigMemberUUID
AMUISDKMeetingConfigMeetingToken
AMUISDKMeetingConfigMeetingDomain
构建界面定制信息,添加各项界面参数,详细信息请参考3.5.2UI配置枚举或参考SDK中的头文件AMUISDKGUIConfig.h
NSDictionary *uiConfig = @{
AMUISDKGuiConfigLogoBanner:logoBannerName,
AMUISDKGuiConfigMeetingTopic:meetingTopic,
AMUISDKGuiConfigMeetingCode:meetingCode,
AMUISDKGuiConfigMeetingRateUrl:meetingRateUrl
};
详细信息请参考3.5.3回调状态码枚举或SDK中的头文件AMUISDKMeetingEventDelegate.h
@interface MeetingCallBack : NSObject <AMUISDKMeetingEventDelegate>
@end
@implementation MeetingCallBack
//已成功进入会议回调
- (void) onMeetingJoined{
NSLog(@"onMeetingJoined");
//DO SOMETHING
}
// 会议正常结束回调
- (void) onMeetingFinish:(AMUISDKMeetingFinishCode) code reason:(NSString*) reason{
NSLog(@"onMeetingFinish");
//DO SOMETHING
}
// 入会异常回调
- (void) onError:(AMUISDKMeetingErrorCode) code reason:(NSString*) reason{
NSLog(@"onError");
//DO SOMETHING
}
// (可选)邀请成员回调
- (void) onInviteClicked:(NSString*) reason{
NSLog(@"onInviteClicked");
//DO SOMETHING
}
// (可选)成员加入/离开消息回调
- (void) onMeetingUserStatusChange:(AMSDKMeetingUser *)meetingUser event:(AMSDKUserStatusEvent)event{
NSLog(@"onMeetingUserStatusChange");
//DO SOMETHING
}
@interface demoLogger : NSObject <AMSDKLoggerProtocol>
@end
@implementation demoLogger
+ (void)action:(nonnull NSString *)module point:(nonnull NSString *)monitorPoint params:(NSDictionary * _Nullable)params {
}
+ (void)debug:(nonnull NSString *)tag msg:(nonnull NSString *)msg {
NSLog(@"%@ : %@", tag, msg);
}
+ (void)error:(nonnull NSString *)tag msg:(nonnull NSString *)msg {
NSLog(@"%@ : %@", tag, msg);
}
+ (void)error:(nonnull NSString *)module point:(nonnull NSString *)monitorPoint params:(NSDictionary * _Nullable)params {
}
+ (void)event:(nonnull NSString *)module point:(nonnull NSString *)monitorPoint params:(NSDictionary * _Nullable)params {
}
+ (void)info:(nonnull NSString *)tag msg:(nonnull NSString *)msg {
NSLog(@"%@ : %@", tag, msg);
}
+ (void)warn:(nonnull NSString *)tag msg:(nonnull NSString *)msg {
NSLog(@"%@ : %@", tag, msg);
}
@end
//新建主窗体,传入各项参数和回调
_win = [[AMUISDKMeetingMainWindow alloc] initWithUIConfig:uiConfig meetingConfig:meetingConfig delegate:self];
//设置日志回调
[AMSDKLogger setLoggerPrinter:[demoLogger class]];
//加入会议
[_win joinMeeting];
//! 会议初始化配置项类型
typedef NSString *AMUISDKMeetingConfigKey;
//! 【Required】产品ID,类型NSString
extern AMUISDKMeetingConfigKey const AMUISDKMeetingConfigClientAppId;
//! 【Required】SLS信息,类型NSString
extern AMUISDKMeetingConfigKey const AMUISDKMeetingConfigSlsInfo;
//! 【Required】设置会议UUID,类型NSString
extern AMUISDKMeetingConfigKey const AMUISDKMeetingConfigMeetingUUID;
//! 【Required】设置会议 Publisher UUID,类型NSString
extern AMUISDKMeetingConfigKey const AMUISDKMeetingConfigMemberUUID;
//! 【Required】设置会议Token,类型NSString
extern AMUISDKMeetingConfigKey const AMUISDKMeetingConfigMeetingToken;
//! 【Required】设置会议域名,类型NSString
extern AMUISDKMeetingConfigKey const AMUISDKMeetingConfigMeetingDomain;
//! 【Required】设置人员UserId,类型NSString
extern AMUISDKMeetingConfigKey const AMUISDKMeetingConfigUserId;
//! 【Optional】入会时是否静音,类型BOOL,默认NO
extern AMUISDKMeetingConfigKey const AMUISDKMeetingConfigMuteAudio;
//! 【Optional】入会时是否开启扬声器,类型BOOL,默认YES
extern AMUISDKMeetingConfigKey const AMUISDKMeetingConfigSpeakerEnabled;
//! 【Optional】入会时是否默认关闭本地摄像头,类型BOOL,默认NO
extern AMUISDKMeetingConfigKey const AMUISDKMeetingConfigMuteVideo;
//! 【Optional】入会是不开视频,只需要音频,不需要视频
AMUISDKMeetingConfigKey const AMUISDKMeetingConfigAudioOnly = @"audioOnly";
//! 【Optional】入会时没有检测到麦克风是否允许入会,类型BOOL,默认 YES
AMUISDKMeetingConfigKey const AMUISDKMeetingConfigAllowNoMic = @"allowNoMic";
//! UI初始化配置项类型
typedef NSString *AMUISDKGuiConfigKey;
//! 【Optional】会议产品Logo文件地址,类型NSString
extern AMUISDKGuiConfigKey const AMUISDKGuiConfigAppLogo;
//! 【Optional】企业Logo文件地址,类型NSString
extern AMUISDKGuiConfigKey const AMUISDKGuiConfigLogoBanner;
//! 【Optional】本场会议名称,类型NSString
extern AMUISDKGuiConfigKey const AMUISDKGuiConfigMeetingTopic;
//! 【Optional】本场会议时间区间,类型NSString
extern AMUISDKGuiConfigKey const AMUISDKGuiConfigMeetingTime;
//! 【Optional】本场会议口令信息,类型NSString
extern AMUISDKGuiConfigKey const AMUISDKGuiConfigMeetingCode;
//! 【Optional】本场会议分享URL,类型NSString
extern AMUISDKGuiConfigKey const AMUISDKGuiConfigMeetingUrl;
//! 【Optional】 会议结束后的评价页开放URL,需要传入一个评价页的h5
extern AMUISDKGuiConfigKey const AMUISDKGuiConfigMeetingRateUrl;
//! 【Optional】入会时是否开启会议成员邀请回调,类型BOOL,默认NO
extern AMUISDKGuiConfigKey const AMUISDKGuiConfigInviteMember;
typedef NS_ENUM(NSInteger, AMUISDKMeetingErrorCode)
{
//! 非法参数,接口调用参数不正确
AMUISDKMeetingErrorCodeIllegalParameters = 0,
//! 会议初始化失败,如无法获取会议信息,拉去配置
AMUISDKMeetingErrorCodeInitializedFailed = 1,
//! 设备无权限
AMUISDKMeetingErrorCodeDevicePermissionNotGranted = 2,
//! 无麦克风设备
AMUISDKMeetingErrorCodeNoDevice = 3,
//! 无法连接媒体服务
AMUISDKMeetingErrorCodeMediaServerConnectFailed = 4,
//! 会议并发满了
AMUISDKMeetingErrorCodeRoomFull = 5,
//! 入会超时
AMUISDKMeetingErrorCodeJoinMeetingTimeout = 6,
//!网络不可用
AMUISDKMeetingErrorCodeNetworkUnAvailable = 7,
//!媒体协商失败
AMUISDKMeetingErrorCodeMediaNegotiationFailed = 8
};
typedef NS_ENUM(NSInteger, AMUISDKMeetingFinishCode)
{
//!主动退出会议
AMUISDKMeetingFinishCodeLeaveBySelf = 0,
//!被动退出会议
AMUISDKMeetingFinishCodeLeaveByKick = 1,
//!挂断所有人
AMUISDKMeetingFinishCodeLeaveByHangupAll = 2,
//!同一个UserID的用户进入了会议
AMUISDKMeetingFinishCodeOtherClientJoined = 3,
//!会议评价完成
AMUISDKMeetingFinishCodeMeetingRateComplete = 4,
//!系统挂起
AMUISDKMeetingFinishCodeSystemWillSleep = 5
};
typedef NS_ENUM(NSInteger, AMSDKUserStatusEvent) {
//! 成员上线
AMSDKUserStatusEventOnline = 0,
//! 成员离线
AMSDKUserStatusEventOffline = 1,
//!静音
AMSDKUserStatusEventAudioMute = 2,
//!取消静音
AMSDKUserStatusEventAudioUnMute = 3,
//!禁视频
AMSDKUserStatusEventVideoMute = 4,
//!打开视频
AMSDKUserStatusEventVideoUnMute = 5,
//!说话中
AMSDKUserStatusEventStartTalking = 6,
//!结束说话
AMSDKUserStatusEventStopTalking = 7,
//!主讲人切换
AMSDKUserStatusEventMainSpeaker = 8,
};
sdk 初始化版本
增加成员加入、离开消息回调
增加可配置邀请成员回调
增加无麦克风可入会
关闭摄像头时关摄像头灯
修复了会议token无效的问题
在文档使用中是否遇到以下问题
更多建议
匿名提交