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.3

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');
                }
              },
            );
          },
        )),

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/>