패키지, 저장소 및 앱 카테고리 검색

패키지 상세v3.17.0

flutter_voximplant

Flutter 애플리케이션에 음성 및 비디오 통신을 내장하기 위한 Voximplant 플러그인.

AndroidiOS
30일 다운로드
3.3천
좋아요
35
Pub 점수
140

패키지 설치

flutter pub add flutter_voximplant

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

flutter_voximplant 패키지는 Flutter 애플리케이션에 실시간 음성 및 비디오 통신을 원활하게 통합할 수 있게 해줍니다. Voximplant에서 개발한 이 패키지는 피어 투 피어 통화 설정, 오디오 및 비디오 스트림 관리, 통화 이벤트 처리를 위한 간단한 인터페이스를 제공합니다. 이 플러그인은 Android와 iOS 플랫폼을 모두 지원하여 라이브 커뮤니케이션 기능이 필요한 크로스플랫폼 앱에 이상적입니다. 신뢰할 수 있는 연결과 고품질 미디어 전송을 보장하기 위해 Voximplant 클라우드 인프라를 활용합니다. 개발자는 최소한의 설정으로 원격 진료, 고객 지원 또는 가상 회의 앱을 구축할 수 있습니다. 이 패키지는 오픈소스이며 지속적으로 유지보수되고 있습니다.

사용 사례

  • 앱 내 영상 통화
  • 고객 서비스 채팅 앱
  • 원격의료 플랫폼
  • 가상 강의실
  • 원격 협업 도구

주요 기능

  • 실시간 음성 및 비디오 통화
  • 크로스 플랫폼 지원 (Android 및 iOS)
  • Voximplant 클라우드와의 간편한 통합
  • 미디어 스트림 관리
  • 이벤트 처리 호출

적합한 대상

  • 실시간 통신 앱을 개발하는 개발자
  • 빠른 VoIP 통합이 필요한 스타트업
  • 안전한 피어 투 피어 통화가 필요한 앱
  • Voximplant 백엔드 서비스를 사용하는 팀

고려 사항

  • Voximplant 계정 및 API 키가 필요합니다
  • 안정적인 인터넷 연결에 의존합니다
  • 고급 기능을 사용하려면 네이티브 SDK 구성이 필요할 수 있습니다
  • Voximplant의 인프라에 제한됨

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

flutter_voximplant

Voximplant Flutter SDK for embedding voice and video communication into Flutter applications.

Supported platforms

Platform Minimum version
Android 5.0 (API 21)
iOS 12.0

Requirements

  • Flutter >= 3.24.0
  • Dart SDK ^3.5.0
  • Android: JDK 17, Android Gradle Plugin and Kotlin versions that support compileSdk 35 (AGP 8.6+, Kotlin 2.x are recommended)
  • iOS: Xcode 15+, Swift 5.9+

Installation

Add the dependency to your application's pubspec.yaml:

dependencies:
  flutter_voximplant: ^3.17.0

Then run:

flutter pub get
iOS setup
Info.plist

Add NSMicrophoneUsageDescription and NSCameraUsageDescription entries to your application's Info.plist:

<key>NSMicrophoneUsageDescription</key>
<string>Microphone is required to make audio calls</string>
<key>NSCameraUsageDescription</key>
<string>Camera is required to make video calls</string>
Android setup

It is required to add Java 11 support in android/app/build.gradle:

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
}

Usage

To get started, you'll need to register a free Voximplant developer account.

Initialization

Client is the main class of the SDK that provides access to Voximplant’s functions, the Voximplant().getClient() method is used to get its instance:

import 'package:flutter_voximplant/flutter_voximplant.dart';


VIClient client = Voximplant().getClient();
Connect and log in to the Voximplant Cloud

The VIClient.getClientState() method is used to get the current state of connection to the Voximplant cloud and perform the actions according to it.

When initializing and connecting the SDK to the Voximplant cloud, you need to specify the node to connect to. Your node is bound to your Voximplant account. To find which node your account belongs to, log in to your control panel and see the Credentials for working with API, SDK, SIP section on the main dashboard.

  const accountNode = VINode.NodeX;
  Future<String> loginWithPassword(String username, String password) async {
    VIClientState clientState = await _client.getClientState();
    if (clientState == VIClientState.LoggedIn) {
      return _displayName;
    }
    if (clientState == VIClientState.Disconnected) {
      await _client.connect(node: accountNode);
    }
    VIAuthResult authResult = await _client.login(username, password);
    _displayName = authResult.displayName;
    return _displayName;
  }
Make calls

To initiate a call we need the VIClient.call method. There is a VICallSettings class which could contain custom data and extra headers (SIP headers).

Since the call can behave in different ways, there is a group of call events. They can be triggered by the VICall class instance as the class contains all the functionality for call management.

  Future<VICall> makeAudioCall(String number) async {
     VICall call = await _client.call(number);
     call.onCallDisconnected = _onCallDisconnected;
     call.onCallFailed = _onCallFailed;
     call.onCallConnected = _onCallConnected;
     call.onCallRinging = _onCallRinging;
     call.onCallAudioStarted = _onCallAudioStarted;
     return call;
  }
   
  _onCallConnected(VICall call, Map<String, String>? headers) {
      print('Call connected');
  }
Receiving calls

Client.onIncomingCall is used to get incoming calls.

There are three methods for an incoming call: answer, decline and reject. An audio stream can be sent only after the answer method call.

  CallService._() {
    _client = Voximplant().getClient();
    _client.onIncomingCall = _onIncomingCall;
  }

  _onIncomingCall(VIClient client, VICall call, bool video, Map<String, String>? headers) async {
    await call.answer();
  }
Mid-call operations

Audio call can be put on/off hold

  _hold() async {
    try {
      await _call.hold(!_isOnHold);
      setState(() {
        _isOnHold = !_isOnHold;
      });
    } catch (e) {
      
    }

  }
Audio device management

VIAudioDeviceManager class API allow to:

  • get all available audio devices
  • get currently selected audio device
  • select audio device
  • handle active audio device changes and new audio devices (for example, Bluetooth headset or wired headset connection). These changes trigger the appropriate events.

All types of audio devices are represented in the VIAudioDevice enum.

Note that there are platform specific nuances in audio device management.

To select an audio device:

  _selectAudioDevice(VIAudioDevice device) async{
    VIAudioDeviceManager audioDeviceManager = Voximplant().getAudioDeviceManager();
    audioDeviceManager.onAudioDeviceChanged = _onAudioDeviceChange;
    await audioDeviceManager.selectAudioDevice(device);
  }

  _onAudioDeviceChange(VIAudioDeviceManager audioDeviceManager, AudioDevice audioDevice) {
    // audio device is changed
  }

Demo

https://github.com/voximplant/flutter_demos

Example

A sample application is available in example/. To run it:

cd example
flutter pub get
flutter run

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.