3.3.3. SDK總體介紹?

3.3.3.1. 引擎提供的方法?

  • var  AVDEngine = ModuleBase.use(ModulesEnum.avdEngine);
    var  avdEngine =new AVDEngine();
    
    avdEngine
    │
    └──getVersion()   (獲取當前引擎版本)
    │
    └──checkWebrtcSupported()              (檢查當前瀏覽器支不支持Webrtc)
    │
    └──getResolutionEnum()     (初始化視頻分辯率列表)
    │
    └──setLog ()     (設置日志級別)
    │
    └──init(serverURI, accessToken).   (引擎初始化)
    │
    └──.cameraMap   (已加載的攝像頭設備,可以是多個)
    │
    └──.microphoneMap   (已加載的麥克風設備,當前只能一個,可以另選擇)
    │
    └──refreshDevice()   (熱插拔設備后,更新獲取設備)
    │
    └──setRecordingMicrophone()   (設置選定的麥克風設備)
    │
    └──room = avdEngine.obtainRoom(roomId)  (創建房間)
          │
          ├──join(userId, userName, userData, password)   (加會)
          │
          └──registerRoomCallback() (注冊房間級別的回調,*見房間的回調)
          │
          └──getRoomInfo () (獲取房間相關信息,*見房間提供的方法)
          │
          └──getParticipants() () (參會者列表)
                 │
                 user     (參會者列表中的每個用戶)
                   │
                   ├──getUserInfo ()      (獲取用戶相關信息,*見用戶提供的方法)
                   │
                   └──registerUserCallback() (注冊用戶級別的回調,*見用戶的回調)
    

3.3.3.2. 房間提供的方法?

  • room
          ├──.id
          └──getRoomTopic()
          └──getOwnerId()
          └──getMaxAudio()
          └──getMaxVideo()
          └──getMaxAttendee()
          └──getParticipants()
          └──.selfUser
                └.nodeId
                └.userId
                └.name
    

3.3.3.3. 用戶提供的方法?

  • user
     ├──.id
     └──.nodeId
     └──.name
     └──.role
     └──.videos
        ├──setLevel ()
        └──setDescription()
        └──setResolution()
        └──setFrameRate()
        └──preview()
        ├──unpreview ()
        └──publish ()
     └──.audio
        ├──openMicrophone ()
        └──closeMicrophone ()
        └──muteMicrophone ()
        └──unmuteMicrophone ()
        └──ismuteMicrophone ()
    

3.3.3.4. 房間的回調?

  • room
         ├──addCallback(RoomCallback.connection_status, onConnectionStatus);
         └──addCallback(RoomCallback.room_status_notify, onRoomStatusNotify);
         └──addCallback(RoomCallback.user_join_notify, onUserJoinNotify);
         └──addCallback(RoomCallback.room_status_notify, onRoomStatusNotify);
         └──addCallback(RoomCallback.leave_indication, onLeaveIndication);
         └──addCallback(RoomCallback.app_data_notify, onAppdataNotify);
         └──addCallback(RoomCallback.user_data_notify, onUserDataNotify);
         └──addCallback(RoomCallback.public_message, onPublicMessage);
         └──addCallback(RoomCallback.private_message, onPrivateMessage);
         └──addCallback(RoomCallback.public_data, onPublicData);
         └──addCallback(RoomCallback.private_data, onPrivateData);
    

3.3.3.5. 用戶的回調?

  • user
     ├─addCallback(UserCallback.microphone_status_notify, onMicrophoneStatusNotify);
     └─addCallback(UserCallback.camera_status_notify, onCameraStatusNotify);
     └─addCallback(UserCallback.screen_status_notify, onScreenStatusNotify);
     └─addCallback(UserCallback.camera_data_notify, onCameraDataNotify)
     └─addCallback(UserCallback.screen_data_notify, onScreenDataNotify)
     └─addCallback(UserCallback.publish_camera_notify, onPublishCameraNotify);
     └─addCallback(UserCallback.unpublish_camera_notify, onUnpublishCameraNotify);
     └─addCallback(UserCallback.subscrible_camera_result, onSubscribleCameraResult);
     └─addCallback(UserCallback.unsubscrible_camera_result, onUnsubscribleCameraResult);
     └─addCallback(UserCallback.subscrible_microphone_result, onSubscribleMicrophoneResult);
     └─addCallback(UserCallback.unsubscrible_microphone_result, onUnsubscribleMicrophoneResult);