flutter_wowza 0.1.4 copy "flutter_wowza: ^0.1.4" to clipboard
flutter_wowza: ^0.1.4 copied to clipboard

outdated

Flutter WOWZA plugin for iOS/Android. The project is based on Wowza GoCoder SDK

example/lib/main.dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_wowza/gocoder/wowza_gocoder.dart';

void main() => runApp(MyApp());

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

class _MyAppState extends State<MyApp> {
  WOWZCameraController controller = WOWZCameraController();

  bool flashLight = false;

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: SingleChildScrollView(
          child: Stack(
            children: <Widget>[
              SizedBox(
                height: 720,
                width: 1280,
                child: WOWZCameraView(
                  apiLicenseKey: (defaultTargetPlatform == TargetPlatform.android)
                      ? "GOSK-xxxx-xxxx-xxxx-xxxx-xxxx"
                  : "GOSK-xxxx-xxxx-xxxx-xxxx-xxxx",
                  controller: controller,
                  hostAddress: "xxx.xxx.xxx.xxx",
                  portNumber: 1935,
                  applicationName: "xxxxxx",
                  streamName: "xxxxx",
                  username: "xxxx",
                  password: "xxxx",
                  scaleMode: ScaleMode.FILL_VIEW,
                  statusCallback: (status) {
                    print(
                        "status: ${status.mState} | ${status.isStarting()} | ${status.isReady()}");
                  },
                  broadcastStatusCallback: (broadcastStatus) {
                    print(
                        "status: ${broadcastStatus.state.toString()} | ${broadcastStatus.message}");
                  },
                ),
              ),
              Wrap(
                children: <Widget>[
                  _action('start preview', () {
                    controller.startPreview();
                  }),
                  _action('resume preview', () {
                    controller.continuePreview();
                  }),
                  _action('pause preview', () {
                    controller.pausePreview();
                  }),
                  _action('switch camera', () {
                    controller.switchCamera();
                  }),
                  _action('flashlight', () {
                    controller.flashLight(!flashLight);
                    flashLight = !flashLight;
                  }),
                  _action('Start Live Stream', () {
                    controller.startBroadcast();
                  }),
                  _action('End Live Stream', () {
                    controller.endBroadcast();
                  }),
                ],
              )
            ],
          ),
        ),
      ),
    );
  }

  _action(text, Function function) =>
      RaisedButton(child: Text(text), onPressed: function);
}
18
likes
0
pub points
0%
popularity

Publisher

verified publishersmew.tech

Flutter WOWZA plugin for iOS/Android. The project is based on Wowza GoCoder SDK

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_wowza