云会议为您提供Mac端的AliMeeting UI SDK,您可以阅读本文,在本地应用程序中快速集成带有UI界面的音视频会议。
前提条件
开发环境准备。类别 | 说明 |
---|---|
macOS版本 | macOS 10.11及以上 |
Xcode版本 | Xcode 10.3及以上 |
集成操作
- 下载AliMeeting UI SDK并解压。SDK文件压缩包中有AliMeetingUISDK文件。
- AliMeetingUISDK.framework:依赖文件。
- SDKSample:示例Demo(填写入会信息可以直接运行)。
- 创建新项目。
- 在
AppDelegate.h
文件中配置引用的头文件。#import <Cocoa/Cocoa.h> #import <CoreData/CoreData.h> #import <AlimeetingUISDK/AMUISDKGuiConfig.h> #import <AlimeetingUISDK/AMUISDKMeetingConfig.h> #import <AlimeetingUISDK/AMUiSDKMeetingMainWindow.h> #import <AlimeetingUISDK/AMUISDKMeetingEventDelegate.h> #import <AlimeetingUISDK/AMSDKLogger.h> @interface AppDelegate : NSObject <NSApplicationDelegate, AMUISDKMeetingEventDelegate> @property (readonly, strong) NSPersistentContainer *persistentContainer; @end
- 在
AppDelegate.m
文件中编写主程序代码。 - 单击build and run开始编译运行。
枚举回调定义
会议配置枚举
//! 会议初始化配置项类型
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配置枚举
//! 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,
};