Skip to content

Commit

Permalink
Fix up the video size details
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkfish committed May 18, 2020
1 parent f52565b commit d1765b8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.1.6

* Fix the resolution in the android side to correctly stream with the camera
size itself.

## 0.1.5

* Add in retries and disconnect processing for android on errors.
Expand Down
13 changes: 8 additions & 5 deletions android/src/main/kotlin/com/whelksoft/camera_with_rtmp/Camera.kt
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,14 @@ class Camera(

rtmpCamera!!.prepareAudio()
rtmpCamera!!.prepareVideo(
streamSize.width,
streamSize.height,
//1280,
// 720,
recordingProfile.videoFrameWidth,
recordingProfile.videoFrameHeight,
recordingProfile.videoFrameRate,

1200 * 1024,
false,
true,
mediaOrientation)
publishUrl = url
}
Expand Down Expand Up @@ -456,9 +459,9 @@ class Camera(
recordingRtmp = true
result.success(null)
} catch (e: CameraAccessException) {
result.error("videoRecordingFailed", e.message, null)
result.error("videoStreamingFailed", e.message, null)
} catch (e: IOException) {
result.error("videoRecordingFailed", e.message, null)
result.error("videoStreamingFailed", e.message, null)
}
}

Expand Down
3 changes: 2 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
VoidCallback videoPlayerListener;
bool enableAudio = true;
TextEditingController _textFieldController = TextEditingController(
text: "rtmp://34.70.40.166:1935/LiveApp/womble");
text: "rtmp://34.70.40.166:1935/LiveApp/815794454132232781694481");

Timer _timer;

Expand Down Expand Up @@ -308,6 +308,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
if (mounted) setState(() {});
if (controller.value.hasError) {
showInSnackBar('Camera error ${controller.value.errorDescription}');
_timer.cancel();
}
});

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: camera_with_rtmp
description: Controlling the camera on Android and iOS plus rtmp live streaming support. Based off the Camera plugin.
version: 0.1.5
version: 0.1.6
homepage: https://github.com/pinkfish/flutter_rtmppublisher

environment:
Expand Down

0 comments on commit d1765b8

Please sign in to comment.