aliyun_rtc_plugin

A new Flutter plugin project.

Getting Started

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Integrated

get plugins from pub.dev

aliyun_rtc_plugin: 0.0.6

use plugin Rtc Player At Project

       late RtcPVPlayerController _controller;

       @override
       void initState() {
          super.initState();

          _controller = RtcPVPlayerController.instance();

          final dataSource = DataSource(
            appId: "xxxx",
            nonce: "xxxx",
            timestamp: 1675837679,
            token: "xxxxx",
            channelId: "xxxx",
            userId: "xxxx",
            userName: "xxxx",
            userHeaderImg: 'xxxx',
          );
          _controller.initialize(dataSource);
       }

       VideoPlayerPlatformView(
              controller: _controller,
              videoCall: false,
              stateChanged: (state) {
                if (state == VideoEventType.unknown ||
                    state == VideoEventType.disconnected) {
                  Navigator.of(buildContext).pop();
                  // SystemChannels.platform.invokeMethod('SystemNavigator.pop');
                }
              },
            );
          },
        )),

android integrate

  • 需要在应用中申请打开摄像头权限, 录音权限, 以及存储权限,否则插件运行后会异常断开

iOS integrate

  • add permission description to Info.plist
 <key>NSCameraUsageDescription</key>
	<string>Use Camera</string>
	<key>NSMicrophoneUsageDescription</key>
	<string>Use microphone</string>
	<key>UIRequiresPersistentWiFi</key>
	<true/>
	<key>io.flutter.embedded_views_preview</key>
	<true/>