aliyun_live 0.0.7
aliyun_live: ^0.0.7 copied to clipboard

轻度封装阿里云直播SDK.

example/lib/main.dart

import 'package:aliyun_live_example/live_page.dart';
import 'package:aliyun_live_example/player_page.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MainPage(),
    );
  }
}

class MainPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(title: Text("阿里云直播SDK演示")),
      body: Row(
        children: [
          MaterialButton(
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(builder: (BuildContext context) {
                    return LivePage();
                  }),
                );
              },
              child: Text("推流")),
          MaterialButton(
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(builder: (BuildContext context) {
                    return PlayerPage();
                  }),
                );
              },
              child: Text("拉流")),
        ],
      ),
    );
  }
}