Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues for Gradle 8 support & update/replace dependencies #27

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## TBD

* Updated Dependencies
* Bumped Flutter min Version to 3.22.0 and Dart SDK min Version to 3.4.0
* Gradle: Bumped compileSdkVersion to 33
* Gradle: Specified buildToolsVersion to 33.0.1
* Gradle: Replaced jcenter with mavenCentral
* Gradle: Specified source/targetCompatibility and jvmTarget to 1.8


## 2.2.6

* Fixed SDK contraints for Flutter 4.0.0
Expand Down
16 changes: 12 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
ext.kotlin_version = '1.8.20'
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
Expand All @@ -17,7 +17,7 @@ buildscript {
rootProject.allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Expand All @@ -26,8 +26,16 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28

namespace 'com.app.rtmp_publisher'
compileSdkVersion 33
buildToolsVersion "33.0.1"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
import io.flutter.plugin.common.BinaryMessenger
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugin.common.PluginRegistry.Registrar
import io.flutter.view.TextureRegistry
import io.flutter.embedding.engine.FlutterEngine

Expand Down
21 changes: 8 additions & 13 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';
import 'package:rtmp_broadcaster/camera.dart';
import 'package:video_player/video_player.dart';
import 'package:wakelock/wakelock.dart';
import 'package:wakelock_plus/wakelock_plus.dart';

class CameraExampleHome extends StatefulWidget {
@override
Expand Down Expand Up @@ -50,15 +50,10 @@ class _CameraExampleHomeState extends State<CameraExampleHome> with WidgetsBindi
bool isVisible = true;

bool get isControllerInitialized => controller?.value.isInitialized ?? false;

bool get isStreamingVideoRtmp => controller?.value.isStreamingVideoRtmp ?? false;

bool get isRecordingVideo => controller?.value.isRecordingVideo ?? false;

bool get isRecordingPaused => controller?.value.isRecordingPaused ?? false;

bool get isStreamingPaused => controller?.value.isStreamingPaused ?? false;

bool get isTakingPicture => controller?.value.isTakingPicture ?? false;

@override
Expand All @@ -70,7 +65,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome> with WidgetsBindi
@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
Wakelock.disable();
WakelockPlus.disable();
super.dispose();
}

Expand Down Expand Up @@ -152,7 +147,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome> with WidgetsBindi
);
}

/// Display the preview from the camera (or a message if the preview is not available).
/// Display camera preview (or a message if the preview is not available).
Widget _cameraPreviewWidget() {
if (controller == null || !isControllerInitialized) {
return const Text(
Expand Down Expand Up @@ -259,7 +254,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome> with WidgetsBindi
);
}

/// Display a row of toggle to select the camera (or a message if no camera is available).
/// Display a row of toggles to select the camera (or a message if no camera is available).
Widget _cameraTogglesRowWidget() {
final List<Widget> toggles = <Widget>[];

Expand Down Expand Up @@ -356,23 +351,23 @@ class _CameraExampleHomeState extends State<CameraExampleHome> with WidgetsBindi
startVideoRecording().then((String? filePath) {
if (mounted) setState(() {});
showInSnackBar('Saving video to $filePath');
Wakelock.enable();
WakelockPlus.enable();
});
}

void onVideoStreamingButtonPressed() {
startVideoStreaming().then((String? url) {
if (mounted) setState(() {});
showInSnackBar('Streaming video to $url');
Wakelock.enable();
WakelockPlus.enable();
});
}

void onRecordingAndVideoStreamingButtonPressed() {
startRecordingAndVideoStreaming().then((String? url) {
if (mounted) setState(() {});
showInSnackBar('Recording streaming video to $url');
Wakelock.enable();
WakelockPlus.enable();
});
}

Expand All @@ -388,7 +383,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome> with WidgetsBindi
showInSnackBar('Video recorded to: $videoPath');
});
}
Wakelock.disable();
WakelockPlus.disable();
}

void onPauseButtonPressed() {
Expand Down
Loading