Giter Site home page Giter Site logo

caiojesu / flutter_larix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from claudiooliveira/flutter_larix

0.0 0.0 0.0 48.53 MB

License: Other

Ruby 0.11% C++ 23.71% C 11.64% Objective-C 22.56% Java 8.23% Kotlin 0.08% Dart 2.07% Swift 31.27% Metal 0.33%

flutter_larix's Introduction

flutter_larix

In this Flutter package you can broadcast using RTMP, SRT, RTSP, RIST protocols based on Larix Broadcaster SDK, package includes platform implementation code for Android and/or iOS.

Getting Started

First steps to start the package

Add package import in your pubspec.yaml

dependencies:
  flutter_larix:
   git:
      url: https://github.com/claudiooliveira/flutter_larix.git
      ref:  main

Adding Larix SDK import inside android/app in build.gradle

dependencies {
    implementation files('libs/libstream-release.aar')
    implementation files('libs/libudpsender-release.aar')
}

Add in your AndroidManifest.xml

    <uses-feature android:name="android.hardware.camera.any" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />

In your widget you need to make a call to FlutterLarix passing in the property the method that will start along with the widget

FlutterLarix(
    cameraResolution: CAMERA_RESOLUTION.HD,
    cameraType: CAMERA_TYPE.BACK, // camera default
    url: "rtmp://teste.com:1935/origin/AAAAA-bbb-cccc-dddd-111111111111", // 
    onCameraViewCreated: onCameraViewCreated,
    listener: _flutterLarixListener,
),

Getting FlutterLarixController instance and requesting camera permission and starting

 void onCameraViewCreated(FlutterLarixController controller) async {
    setState(() {
      this.controller = controller;
      initialCamera();
    });
  }
  initialCamera() async {
    var requestPermissions = await controller!.getPermissions();
    if (requestPermissions.hasAudioPermission && requestPermissions.hasCameraPermission) {
      var cameraStatus = await controller!.initCamera();
      print("response ${cameraStatus}");
    } else {
      var permissionsResult = await controller!.requestPermissions();
      if (permissionsResult.hasCameraPermission) {
        var cameraStatus = await controller!.initCamera();
        print("response ${cameraStatus}");
      }
    }
  }
void _flutterLarixListener() {
  if (mounted) {
    setState(() {});
  }
}

If you have any questions, you can refer to the example.

flutter_larix's People

Contributors

claudiooliveira avatar leandro-pereira avatar caiojesu avatar paulovofonseca avatar caiovini64 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.