flutter_wowza 0.1.11

  • Readme
  • Changelog
  • Example
  • Installing
  • 77

The project is redeveloping so that it doesn't depend on Wowza gocoder SDK #

Wowza Player, Wowza GoCoder SDK, & the technology powering the Ultra Low Latency service in Wowza Streaming Cloud will no longer be available January 5, 2021. Learn more .

flutter_wowza #

The project is based on Wowza GoCoder SDK

Learn more about using GoCoder here Android | IOS

Get the Free License Free License

Connect the Wowza GoCoder encoding app to Wowza Streaming Engine Docs | Youtube

Usage #

Add flutter-wowza as a dependency in your pubspec.yaml file.

iOS #

Add the following entry to your Info.plist file, located in <project root>/ios/Runner/Info.plist:

<key>NSCameraUsageDescription</key>
<string>The camera will be used to capture video for live streaming</string>
<key>NSMicrophoneUsageDescription</key>
<string>The microphone will be used to capture live audio for streaming</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
   <string>armv7</string>
</array>
<key>io.flutter.embedded_views_preview</key>
<true/>

Android #

Ensure the following permission is present in your Android Manifest file, located in <project root>/android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-feature android:name="android.hardware.camera.any" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.camera.flash" android:required="false" />
<uses-feature android:name="android.hardware.microphone" android:required="false" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />

Example #

WOWZCameraView(
    androidLicenseKey: "GOSK-9C47-010C-2895-D225-9FEF",
    iosLicenseKey: "GOSK-9C47-010C-A9B9-EB78-3FBD",
    controller: controller,
    statusCallback: (status) {
        print("status: ${status.mState} | ${status.isStarting()} | ${status.isReady()}");
    },
    broadcastStatusCallback: (broadcastStatus) {
        print("status: ${broadcastStatus.state.toString()} | ${broadcastStatus.message}");
    },
)

Control live streams

WOWZCameraController controller = WOWZCameraController();

configuration wowza

controller.setWOWZConfig(
              hostAddress: "xxx.xxx.xxx.xxx",
              portNumber: 1935,
              applicationName: "xxxxxx",
              streamName: "xxxxx",
              username: "xxxx",
              password: "xxxx",
              scaleMode: ScaleMode.FILL_VIEW
          );

Functionality supported #

WOWZMediaConfig

FeatureAndroidiOS
WOWZMediaConfig.FRAME_SIZE_176x144✔️
WOWZMediaConfig.FRAME_SIZE_320x240✔️
WOWZMediaConfig.FRAME_SIZE_352x288✔️✔️
WOWZMediaConfig.FRAME_SIZE_640x480✔️✔️
WOWZMediaConfig.FRAME_SIZE_960x540✔️
WOWZMediaConfig.FRAME_SIZE_1280x720✔️✔️
WOWZMediaConfig.FRAME_SIZE_1440x1080✔️
WOWZMediaConfig.FRAME_SIZE_1920x1080✔️✔️
WOWZMediaConfig.FRAME_SIZE_3840x2160✔️✔️

scaleMode

FeatureAndroidiOS
ScaleMode.FILL_VIEW✔️✔️
ScaleMode.RESIZE_TO_ASPECT✔️✔️
IOSAndroidFlutter
hostAddresshostAddresshostAddress
portNumberportNumberportNumber
applicationNameapplicationNameapplicationName
streamNamestreamNamestreamName
usernameusernameusername
passwordpasswordpassword
videoFrameRatevideoFrameRatefps
videoBitratevideoBitratebps
audioSampleRateaudioSampleRatekhz
cameraView.start()WOWZCameraView.startPreview()startPreview
cameraView.stop()WOWZCameraView.stopPreview()stopPreview
cameraView.start()WOWZCameraView.continuePreview()continuePreview
cameraView.stop()WOWZCameraView.pausePreview()pausePreview
cameraView.switchCamera()WOWZCameraView.switchCamera()switchCamera
cameraView.camera.isTorchOnWOWZCameraView.camera.isTorchOnflashLight
GoCoder.isAudioMutedWOWZAudioDevice.isMutedmuted
cameraView.isSwitchCameraAvailableWOWZCameraView.isSwitchCameraAvailableisSwitchCameraAvailable
GoCoder.isStreamingWowzaGoCoder.isInitializedisInitialized
GoCoder.startStreamingWOWZBroadcast.startBroadcaststartBroadcast
GoCoder.endStreamingWOWZBroadcast.endBroadcastendBroadcast

Project that is still being developed #

0.1.11 #

  • update readme

0.1.10 #

  • add AutomaticKeepAliveClientMixin

0.1.9 #

  • new state for broadcast stream
  • IDLE_ERROR,
  • READY_ERROR,
  • BROADCASTING_ERROR

0.1.8 #

  • Update Readme.md

0.1.7 #

  • I split 2 license key for 2 platforms for easy management
  • androidLicenseKey and iosLicenseKey
  • change example readme.md

0.1.6 #

  • No configuration required WOWZA when constructing WOWZCameraView

0.1.5 #

  • fix Android permission not working

0.1.4 #

  • fix userName vs Password is null object reference

0.1.3 #

  • The package description is too short. (-20 points)

0.1.2 #

  • fix README.MD

0.1.1 #

  • Change description and image preview

0.1.0 #

  • Initial Open Source release.

example/lib/main.dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.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();
    SchedulerBinding.instance.addPostFrameCallback((_) {
      controller.setWOWZConfig(
          hostAddress: "xxx.xxx.xxx.xxx",
          portNumber: 1935,
          applicationName: "xxxxxx",
          streamName: "xxxxx",
          username: "xxxx",
          password: "xxxx",
          scaleMode: ScaleMode.FILL_VIEW);
    });
  }

  @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(
                  androidLicenseKey: "GOSK-xxxx-xxxx-xxxx-xxxx-xxxx",
                  iosLicenseKey: "GOSK-xxxx-xxxx-xxxx-xxxx-xxxx",
                  controller: controller,
                  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);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_wowza: ^0.1.11

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_wowza/generated/i18n.dart';
import 'package:flutter_wowza/gocoder/src/events.dart';
import 'package:flutter_wowza/gocoder/src/wowz_camera_controller.dart';
import 'package:flutter_wowza/gocoder/src/wowz_camera_view.dart';
import 'package:flutter_wowza/gocoder/wowza_gocoder.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
54
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
77
Learn more about scoring.

We analyzed this package on Jul 9, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because:

  • package:flutter_wowza/generated/i18n.dart that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because:

  • package:flutter_wowza/generated/i18n.dart that declares support for platforms: android, ios

Package does not support Flutter platform web

Because:

  • package:flutter_wowza/generated/i18n.dart that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because:

  • package:flutter_wowza/generated/i18n.dart that declares support for platforms: android, ios

Package not compatible with SDK dart

Because:

  • flutter_wowza that is a package requiring null.

Health suggestions

Format lib/generated/i18n.dart.

Run flutter format to format lib/generated/i18n.dart.

Format lib/gocoder/src/events.dart.

Run flutter format to format lib/gocoder/src/events.dart.

Format lib/gocoder/src/wowz_camera_controller.dart.

Run flutter format to format lib/gocoder/src/wowz_camera_controller.dart.

Format lib/gocoder/src/wowz_camera_view.dart.

Run flutter format to format lib/gocoder/src/wowz_camera_view.dart.

Format lib/gocoder/wowza_gocoder.dart.

Run flutter format to format lib/gocoder/wowza_gocoder.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test