From 9b51441a8389d613cfb80e81840ce4b871a585fc Mon Sep 17 00:00:00 2001 From: hetao Date: Sat, 28 Aug 2021 18:05:01 +0800 Subject: [PATCH 01/17] null safety and update libs version --- example/lib/main.dart | 248 +++++++++++++++++++++++------------------- lib/flutter_live.dart | 53 +++++---- pubspec.yaml | 13 ++- 3 files changed, 170 insertions(+), 144 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 1784065..c14a551 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -6,14 +6,14 @@ import 'dart:io' show Platform; import 'package:flutter_live/flutter_live.dart' as flutter_live; import 'package:flutter_webrtc/flutter_webrtc.dart' as webrtc; import 'package:fijkplayer/fijkplayer.dart' as fijkplayer; -import 'package:camera_with_rtmp/camera.dart' as camera; +import 'package:rtmp_publisher_null_safety/camera.dart' as camera; import 'package:shared_preferences/shared_preferences.dart'; import 'privacy.dart'; void main() { runApp(MaterialApp( - debugShowCheckedModeBanner: false, - home: Platform.isAndroid? Privacy() : Home(), + debugShowCheckedModeBanner: false, + home: Platform.isAndroid ? Privacy() : Home(), )); } @@ -34,7 +34,7 @@ class _HomeState extends State { bool _isPublish = false; bool _isPublishing = false; // The controller for publisher. - camera.CameraController _cameraController = null; + camera.CameraController _cameraController; @override Widget build(BuildContext context) { @@ -64,7 +64,9 @@ class _HomeState extends State { _urlController.addListener(_onUserEditUrl); PackageInfo.fromPlatform().then((info) { - setState(() { _info = info; }); + setState(() { + _info = info; + }); }).catchError((e) { print('Platform error $e'); }); @@ -100,7 +102,7 @@ class _HomeState extends State { return _url != null && _url.contains('://'); } - void disposeCamera() async { + Future disposeCamera() async { if (_cameraController == null) { return; } @@ -113,8 +115,8 @@ class _HomeState extends State { void stopPublish() async { await disposeCamera(); - setState(() { }); - print('Stop publish url=$_url, publishing=$_isPublishing, controller=${_cameraController?.value.isInitialized}'); + setState(() {}); + print('Stop publish url=$_url, publishing=$_isPublishing, controller=${_cameraController.value.isInitialized}'); } void _onStartPlayOrPublish(BuildContext context) async { @@ -123,12 +125,12 @@ class _HomeState extends State { return; } - print('${_isPublishing? "Stop":""} ${_isPublish? "Publish":"Play"} url=$_url, publishing=$_isPublishing'); + print('${_isPublishing ? "Stop" : ""} ${_isPublish ? "Publish" : "Play"} url=$_url, publishing=$_isPublishing'); // For player. if (!_isPublish) { Navigator.push(context, MaterialPageRoute(builder: (context) { - return _url.startsWith('webrtc://')? WebRTCStreamingPlayer(_url) : LiveStreamingPlayer(_url); + return _url.startsWith('webrtc://') ? WebRTCStreamingPlayer(_url) : LiveStreamingPlayer(_url); })); return; } @@ -160,7 +162,9 @@ class _HomeState extends State { _cameraController = camera.CameraController(desc, camera.ResolutionPreset.low); _cameraController.addListener(() { - setState(() { print('got camera event'); }); + setState(() { + print('got camera event'); + }); }); await _cameraController.initialize(); @@ -169,7 +173,9 @@ class _HomeState extends State { await _cameraController.startVideoStreaming(_url, bitrate: 300 * 1000); print('Start streaming to $_url'); - setState(() { _isPublishing = true; }); + setState(() { + _isPublishing = true; + }); } } @@ -177,7 +183,9 @@ class _HomeState extends State { if (!v) { stopPublish(); } - setState(() { _isPublish = v; }); + setState(() { + _isPublish = v; + }); } } @@ -189,9 +197,9 @@ class UrlInputDisplay extends StatelessWidget { Widget build(BuildContext context) { return Container( child: TextField( - controller: _controller, autofocus: false, - decoration: InputDecoration(hintText: 'Please select or input url...') - ), + controller: _controller, + autofocus: false, + decoration: InputDecoration(hintText: 'Please select or input url...')), padding: EdgeInsets.fromLTRB(5, 0, 5, 0), ); } @@ -205,80 +213,94 @@ class DemoUrlsDisplay extends StatelessWidget { @override Widget build(BuildContext context) { - return Container(child: - _isPublish? Column(children: [ - ListTile( - title: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('RTMP', style: TextStyle(fontWeight: FontWeight.bold)), - Text(flutter_live.FlutterLive.rtmp_publish, style: TextStyle(color: Colors.grey[500])), - ]), - onTap: () => _onUserSelectUrl(flutter_live.FlutterLive.rtmp_publish), contentPadding: EdgeInsets.zero, - leading: Radio(value: flutter_live.FlutterLive.rtmp_publish, groupValue: _url, onChanged: _onUserSelectUrl), - ), - ListTile( - title: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('RTMP', style: TextStyle(fontWeight: FontWeight.bold)), - Text(flutter_live.FlutterLive.rtmp_publish2, style: TextStyle(color: Colors.grey[500])), - ]), - onTap: () => _onUserSelectUrl(flutter_live.FlutterLive.rtmp_publish2), contentPadding: EdgeInsets.zero, - leading: Radio(value: flutter_live.FlutterLive.rtmp_publish2, groupValue: _url, onChanged: _onUserSelectUrl), - ), - ],) : Column(children: [ - ListTile( - title: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('RTMP', style: TextStyle(fontWeight: FontWeight.bold)), - Text(flutter_live.FlutterLive.rtmp, style: TextStyle(color: Colors.grey[500])), - ]), - onTap: () => _onUserSelectUrl(flutter_live.FlutterLive.rtmp), contentPadding: EdgeInsets.zero, - leading: Radio(value: flutter_live.FlutterLive.rtmp, groupValue: _url, onChanged: _onUserSelectUrl), - ), - ListTile( - title: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('HLS', style: TextStyle(fontWeight: FontWeight.bold)), - Text(flutter_live.FlutterLive.hls, style: TextStyle(color: Colors.grey[500])), - ]), - onTap: () => _onUserSelectUrl(flutter_live.FlutterLive.hls), contentPadding: EdgeInsets.zero, - leading: Radio(value: flutter_live.FlutterLive.hls, groupValue: _url, onChanged: _onUserSelectUrl), - ), - ListTile( - title: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('HTTP-FLV', style: TextStyle(fontWeight: FontWeight.bold)), - Text(flutter_live.FlutterLive.flv, style: TextStyle(color: Colors.grey[500])), - ]), - onTap: () => _onUserSelectUrl(flutter_live.FlutterLive.flv), contentPadding: EdgeInsets.zero, - leading: Radio(value: flutter_live.FlutterLive.flv, groupValue: _url, onChanged: _onUserSelectUrl), - ), - ListTile( - title: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('WebRTC', style: TextStyle(fontWeight: FontWeight.bold)), - Text(flutter_live.FlutterLive.rtc, style: TextStyle(color: Colors.grey[500], fontSize: 15)), - ]), - onTap: () => _onUserSelectUrl(flutter_live.FlutterLive.rtc), contentPadding: EdgeInsets.zero, - leading: Radio(value: flutter_live.FlutterLive.rtc, groupValue: _url, onChanged: _onUserSelectUrl), - ), - ListTile( - title: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('HTTPS-FLV', style: TextStyle(fontWeight: FontWeight.bold)), - Container( - child: Text(flutter_live.FlutterLive.flvs, style: TextStyle(color: Colors.grey[500], fontSize: 15)), - padding: EdgeInsets.only(top: 3, bottom:3), - ), - ]), - onTap: () => _onUserSelectUrl(flutter_live.FlutterLive.flvs), contentPadding: EdgeInsets.zero, - leading: Radio(value: flutter_live.FlutterLive.flvs, groupValue: _url, onChanged: _onUserSelectUrl), - ), - ListTile( - title: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('HTTPS-HLS', style: TextStyle(fontWeight: FontWeight.bold)), - Container( - child: Text(flutter_live.FlutterLive.hlss, style: TextStyle(color: Colors.grey[500], fontSize: 14)), - padding: EdgeInsets.only(top: 3, bottom: 3), - ), - ]), - onTap: () => _onUserSelectUrl(flutter_live.FlutterLive.hlss), contentPadding: EdgeInsets.zero, - leading: Radio(value: flutter_live.FlutterLive.hlss, groupValue: _url, onChanged: _onUserSelectUrl), - ), - ]), + return Container( + child: _isPublish + ? Column( + children: [ + ListTile( + title: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text('RTMP', style: TextStyle(fontWeight: FontWeight.bold)), + Text(flutter_live.FlutterLive.rtmp_publish, style: TextStyle(color: Colors.grey[500])), + ]), + onTap: () => _onUserSelectUrl(flutter_live.FlutterLive.rtmp_publish), + contentPadding: EdgeInsets.zero, + leading: Radio( + value: flutter_live.FlutterLive.rtmp_publish, groupValue: _url, onChanged: _onUserSelectUrl), + ), + ListTile( + title: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text('RTMP', style: TextStyle(fontWeight: FontWeight.bold)), + Text(flutter_live.FlutterLive.rtmp_publish2, style: TextStyle(color: Colors.grey[500])), + ]), + onTap: () => _onUserSelectUrl(flutter_live.FlutterLive.rtmp_publish2), + contentPadding: EdgeInsets.zero, + leading: Radio( + value: flutter_live.FlutterLive.rtmp_publish2, groupValue: _url, onChanged: _onUserSelectUrl), + ), + ], + ) + : Column(children: [ + ListTile( + title: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text('RTMP', style: TextStyle(fontWeight: FontWeight.bold)), + Text(flutter_live.FlutterLive.rtmp, style: TextStyle(color: Colors.grey[500])), + ]), + onTap: () => _onUserSelectUrl(flutter_live.FlutterLive.rtmp), + contentPadding: EdgeInsets.zero, + leading: Radio(value: flutter_live.FlutterLive.rtmp, groupValue: _url, onChanged: _onUserSelectUrl), + ), + ListTile( + title: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text('HLS', style: TextStyle(fontWeight: FontWeight.bold)), + Text(flutter_live.FlutterLive.hls, style: TextStyle(color: Colors.grey[500])), + ]), + onTap: () => _onUserSelectUrl(flutter_live.FlutterLive.hls), + contentPadding: EdgeInsets.zero, + leading: Radio(value: flutter_live.FlutterLive.hls, groupValue: _url, onChanged: _onUserSelectUrl), + ), + ListTile( + title: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text('HTTP-FLV', style: TextStyle(fontWeight: FontWeight.bold)), + Text(flutter_live.FlutterLive.flv, style: TextStyle(color: Colors.grey[500])), + ]), + onTap: () => _onUserSelectUrl(flutter_live.FlutterLive.flv), + contentPadding: EdgeInsets.zero, + leading: Radio(value: flutter_live.FlutterLive.flv, groupValue: _url, onChanged: _onUserSelectUrl), + ), + ListTile( + title: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text('WebRTC', style: TextStyle(fontWeight: FontWeight.bold)), + Text(flutter_live.FlutterLive.rtc, style: TextStyle(color: Colors.grey[500], fontSize: 15)), + ]), + onTap: () => _onUserSelectUrl(flutter_live.FlutterLive.rtc), + contentPadding: EdgeInsets.zero, + leading: Radio(value: flutter_live.FlutterLive.rtc, groupValue: _url, onChanged: _onUserSelectUrl), + ), + ListTile( + title: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text('HTTPS-FLV', style: TextStyle(fontWeight: FontWeight.bold)), + Container( + child: Text(flutter_live.FlutterLive.flvs, style: TextStyle(color: Colors.grey[500], fontSize: 15)), + padding: EdgeInsets.only(top: 3, bottom: 3), + ), + ]), + onTap: () => _onUserSelectUrl(flutter_live.FlutterLive.flvs), + contentPadding: EdgeInsets.zero, + leading: Radio(value: flutter_live.FlutterLive.flvs, groupValue: _url, onChanged: _onUserSelectUrl), + ), + ListTile( + title: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text('HTTPS-HLS', style: TextStyle(fontWeight: FontWeight.bold)), + Container( + child: Text(flutter_live.FlutterLive.hlss, style: TextStyle(color: Colors.grey[500], fontSize: 14)), + padding: EdgeInsets.only(top: 3, bottom: 3), + ), + ]), + onTap: () => _onUserSelectUrl(flutter_live.FlutterLive.hlss), + contentPadding: EdgeInsets.zero, + leading: Radio(value: flutter_live.FlutterLive.hlss, groupValue: _url, onChanged: _onUserSelectUrl), + ), + ]), ); } } @@ -289,7 +311,8 @@ class ControlDisplay extends StatelessWidget { final bool _isPubslish; final bool _isPublishing; final ValueChanged _onSwitchPublish; - ControlDisplay(this._urlAvailable, this._onStartPlayOrPublish, this._isPubslish, this._isPublishing, this._onSwitchPublish); + ControlDisplay( + this._urlAvailable, this._onStartPlayOrPublish, this._isPubslish, this._isPublishing, this._onSwitchPublish); @override Widget build(BuildContext context) { @@ -297,7 +320,7 @@ class ControlDisplay extends StatelessWidget { if (_isPublishing) { return 'Stop'; } - return _isPubslish? 'Publish' : 'Play'; + return _isPubslish ? 'Publish' : 'Play'; }; return Row( @@ -311,9 +334,9 @@ class ControlDisplay extends StatelessWidget { ), Container( width: 120, - child:ElevatedButton( + child: ElevatedButton( child: Text(actionText()), - onPressed: _urlAvailable? _onStartPlayOrPublish : null, + onPressed: _urlAvailable ? _onStartPlayOrPublish : null, ), ), ], @@ -337,15 +360,16 @@ class CameraDisplay extends StatelessWidget { } if (!_cameraController.value.isInitialized) { - return Container(child: Center(child: Text( - 'Camera not available', style: TextStyle(color: Colors.red[500]), + return Container( + child: Center( + child: Text( + 'Camera not available', + style: TextStyle(color: Colors.red[500]), ))); } return AspectRatio( - aspectRatio: _cameraController.value.aspectRatio, - child: camera.CameraPreview(_cameraController) - ); + aspectRatio: _cameraController.value.aspectRatio, child: camera.CameraPreview(_cameraController)); } } @@ -361,10 +385,11 @@ class PlatformDisplay extends StatelessWidget { Text.rich( TextSpan( text: 'SRS/v${_info.version}+${_info.buildNumber}', - recognizer: TapGestureRecognizer() ..onTap = () async { - SharedPreferences prefs = await SharedPreferences.getInstance(); - prefs.setBool("login", false); - }, + recognizer: TapGestureRecognizer() + ..onTap = () async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + prefs.setBool("login", false); + }, ), ), ], @@ -388,9 +413,7 @@ class _LiveStreamingPlayerState extends State { return Scaffold( appBar: AppBar(title: Text('SRS Live Streaming')), body: fijkplayer.FijkView( - player: _player.fijk, panelBuilder: fijkplayer.fijkPanel2Builder(), - fsFit: fijkplayer.FijkFit.fill - ), + player: _player.fijk, panelBuilder: fijkplayer.fijkPanel2Builder(), fsFit: fijkplayer.FijkFit.fill), ); } @@ -430,9 +453,9 @@ class _WebRTCStreamingPlayerState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text('SRS WebRTC Streaming')), - body: GestureDetector(onTap: _switchLoudspeaker, child: Container( - child: webrtc.RTCVideoView(_video), decoration: BoxDecoration(color: Colors.grey[500]) - )), + body: GestureDetector( + onTap: _switchLoudspeaker, + child: Container(child: webrtc.RTCVideoView(_video), decoration: BoxDecoration(color: Colors.grey[500]))), ); } @@ -449,7 +472,9 @@ class _WebRTCStreamingPlayerState extends State { // Render stream when got remote stream. _player.onRemoteStream = (webrtc.MediaStream stream) { // @remark It's very important to use setState to set the srcObject and notify render. - setState(() { _video.srcObject = stream; }); + setState(() { + _video.srcObject = stream; + }); }; // Auto start play WebRTC streaming. @@ -457,7 +482,7 @@ class _WebRTCStreamingPlayerState extends State { } void _switchLoudspeaker() { - print('setSpeakerphoneOn: $_loudspeaker(${_loudspeaker? "Loudspeaker":"Earpiece"})'); + print('setSpeakerphoneOn: $_loudspeaker(${_loudspeaker ? "Loudspeaker" : "Earpiece"})'); flutter_live.FlutterLive.setSpeakerphoneOn(_loudspeaker); _loudspeaker = !_loudspeaker; } @@ -469,4 +494,3 @@ class _WebRTCStreamingPlayerState extends State { _player.dispose(); } } - diff --git a/lib/flutter_live.dart b/lib/flutter_live.dart index 6cd7607..ab3133a 100644 --- a/lib/flutter_live.dart +++ b/lib/flutter_live.dart @@ -110,9 +110,10 @@ class RealtimePlayer { /// streamUrl: "webrtc://d.ossrs.net:11985/live/livestream" class WebRTCUri { /// The api server url for WebRTC streaming. - String api; + String api = ""; + /// The stream url to play or publish. - String streamUrl; + String streamUrl = ""; /// Parse the url to WebRTC uri. static WebRTCUri parse(String url) { @@ -120,21 +121,21 @@ class WebRTCUri { var schema = 'https'; // For native, default to HTTPS if (uri.queryParameters.containsKey('schema')) { - schema = uri.queryParameters['schema']; + schema = uri.queryParameters['schema']!; } else { schema = 'https'; } - var port = (uri.port > 0)? uri.port : 443; + var port = (uri.port > 0) ? uri.port : 443; if (schema == 'https') { - port = (uri.port > 0)? uri.port : 443; + port = (uri.port > 0) ? uri.port : 443; } else if (schema == 'http') { - port = (uri.port > 0)? uri.port : 1985; + port = (uri.port > 0) ? uri.port : 1985; } var api = '/rtc/v1/play/'; if (uri.queryParameters.containsKey('play')) { - api = uri.queryParameters['play']; + api = uri.queryParameters['play']!; } var apiParams = []; @@ -145,7 +146,7 @@ class WebRTCUri { } var apiUrl = '${schema}://${uri.host}:${port}${api}'; - if (!apiParams.isEmpty) { + if (apiParams.isEmpty) { apiUrl += '?' + apiParams.join('&'); } @@ -159,8 +160,8 @@ class WebRTCUri { /// A WebRTC player, using [flutter_webrtc](https://pub.dev/packages/flutter_webrtc) class WebRTCPlayer { - webrtc.AddStreamCallback _onRemoteStream; - webrtc.RTCPeerConnection _pc; + webrtc.AddStreamCallback? _onRemoteStream; + webrtc.RTCPeerConnection? _pc; /// When got a remote stream. set onRemoteStream(webrtc.AddStreamCallback v) { @@ -168,14 +169,13 @@ class WebRTCPlayer { } /// Initialize the player. - void initState() { - } + void initState() {} /// Start play a url. /// [url] must a path parsed by [WebRTCUri.parse] in https://github.com/rtcdn/rtcdn-draft Future play(String url) async { if (_pc != null) { - await _pc.close(); + await _pc!.close(); } // Create the peer connection. @@ -187,36 +187,36 @@ class WebRTCPlayer { print('WebRTC: createPeerConnection done'); // Setup the peer connection. - _pc.onAddStream = (webrtc.MediaStream stream) { + _pc!.onAddStream = (webrtc.MediaStream stream) { print('WebRTC: got stream ${stream.id}'); if (_onRemoteStream == null) { print('Warning: Stream ${stream.id} is leak'); return; } - _onRemoteStream(stream); + _onRemoteStream!(stream); }; - _pc.addTransceiver( - kind: webrtc.RTCRtpMediaType.RTCRtpMediaTypeAudio, - init: webrtc.RTCRtpTransceiverInit(direction: webrtc.TransceiverDirection.RecvOnly), + _pc!.addTransceiver( + kind: webrtc.RTCRtpMediaType.RTCRtpMediaTypeAudio, + init: webrtc.RTCRtpTransceiverInit(direction: webrtc.TransceiverDirection.RecvOnly), ); - _pc.addTransceiver( + _pc!.addTransceiver( kind: webrtc.RTCRtpMediaType.RTCRtpMediaTypeVideo, init: webrtc.RTCRtpTransceiverInit(direction: webrtc.TransceiverDirection.RecvOnly), ); print('WebRTC: Setup PC done, A|V RecvOnly'); // Start SDP handshake. - webrtc.RTCSessionDescription offer = await _pc.createOffer({ + webrtc.RTCSessionDescription offer = await _pc!.createOffer({ 'mandatory': {'OfferToReceiveAudio': true, 'OfferToReceiveVideo': true}, }); - await _pc.setLocalDescription(offer); - print('WebRTC: createOffer, ${offer.type} is ${offer.sdp.replaceAll('\n', '\\n').replaceAll('\r', '\\r')}'); + await _pc!.setLocalDescription(offer); + print('WebRTC: createOffer, ${offer.type} is ${offer.sdp?.replaceAll('\n', '\\n').replaceAll('\r', '\\r')}'); - webrtc.RTCSessionDescription answer = await _handshake(url, offer.sdp); - print('WebRTC: got ${answer.type} is ${answer.sdp.replaceAll('\n', '\\n').replaceAll('\r', '\\r')}'); + webrtc.RTCSessionDescription answer = await _handshake(url, offer.sdp ?? ""); + print('WebRTC: got ${answer.type} is ${answer.sdp?.replaceAll('\n', '\\n').replaceAll('\r', '\\r')}'); - await _pc.setRemoteDescription(answer); + await _pc!.setRemoteDescription(answer); } /// Handshake to exchange SDP, send offer and got answer. @@ -261,8 +261,7 @@ class WebRTCPlayer { /// Dispose the player. void dispose() { if (_pc != null) { - _pc.close(); + _pc!.close(); } } } - diff --git a/pubspec.yaml b/pubspec.yaml index 4d7c961..4cc7c59 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,15 +4,18 @@ description: Live streaming player, iOS+Android, RTMP/HTTP-FLV/HLS/WebRTC, by Fl homepage: https://github.com/ossrs/flutter_live environment: - sdk: ">=2.7.0 <3.0.0" - flutter: ">=1.20.0 <2.0.0" + sdk: ">=2.13.0 <3.0.0" dependencies: flutter: sdk: flutter - fijkplayer: ^0.8.8 - flutter_webrtc: ^0.6.3 - camera_with_rtmp: ^0.3.2 + fijkplayer: ^0.10.0 + flutter_webrtc: ^0.6.5 + rtmp_publisher_null_safety: ^0.3.9 +# camera_with_rtmp: +# git: +# url: https://github.com/babulpatel1309/flutter_rtmppublisher.git +# ref: 963c0b82cd94f09f1e4387d33a89e3b067957c19 dev_dependencies: flutter_test: From 84c814e3eb5b733757fe26737d3fba44064085ba Mon Sep 17 00:00:00 2001 From: hetao Date: Sat, 28 Aug 2021 19:01:43 +0800 Subject: [PATCH 02/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0camera=5Fwith=5Frtmp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/ios/Podfile | 3 +++ example/lib/main.dart | 2 +- pubspec.yaml | 11 ++++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/example/ios/Podfile b/example/ios/Podfile index 9411102..fab83c6 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -37,5 +37,8 @@ end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) + target.build_configurations.each do |config| + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0' + end end end diff --git a/example/lib/main.dart b/example/lib/main.dart index c14a551..d64a2f3 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -6,7 +6,7 @@ import 'dart:io' show Platform; import 'package:flutter_live/flutter_live.dart' as flutter_live; import 'package:flutter_webrtc/flutter_webrtc.dart' as webrtc; import 'package:fijkplayer/fijkplayer.dart' as fijkplayer; -import 'package:rtmp_publisher_null_safety/camera.dart' as camera; +import 'package:camera_with_rtmp/camera.dart' as camera; import 'package:shared_preferences/shared_preferences.dart'; import 'privacy.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index 4cc7c59..0bd29f6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,6 +2,7 @@ name: flutter_live version: 1.0.17 description: Live streaming player, iOS+Android, RTMP/HTTP-FLV/HLS/WebRTC, by Flutter+SRS. homepage: https://github.com/ossrs/flutter_live +publish_to: 'none' environment: sdk: ">=2.13.0 <3.0.0" @@ -11,11 +12,11 @@ dependencies: sdk: flutter fijkplayer: ^0.10.0 flutter_webrtc: ^0.6.5 - rtmp_publisher_null_safety: ^0.3.9 -# camera_with_rtmp: -# git: -# url: https://github.com/babulpatel1309/flutter_rtmppublisher.git -# ref: 963c0b82cd94f09f1e4387d33a89e3b067957c19 + #rtmp_publisher_null_safety: ^0.3.9 + camera_with_rtmp: + git: + url: https://github.com/babulpatel1309/flutter_rtmppublisher.git + ref: 963c0b82cd94f09f1e4387d33a89e3b067957c19 dev_dependencies: flutter_test: From 92d122328cde38456baa9fb4ed37b983e5317b74 Mon Sep 17 00:00:00 2001 From: hetao Date: Mon, 30 Aug 2021 22:35:03 +0800 Subject: [PATCH 03/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0rtmp=20publisher?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 0bd29f6..6603a62 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,8 +15,8 @@ dependencies: #rtmp_publisher_null_safety: ^0.3.9 camera_with_rtmp: git: - url: https://github.com/babulpatel1309/flutter_rtmppublisher.git - ref: 963c0b82cd94f09f1e4387d33a89e3b067957c19 + url: https://github.com/hetao29/flutter_rtmppublisher.git + ref: f9048093c98f6176b240d528495cd8b813a06021 dev_dependencies: flutter_test: From a2074d8ad78be32ed655d5506826e114196248f8 Mon Sep 17 00:00:00 2001 From: hetao Date: Mon, 30 Aug 2021 23:10:56 +0800 Subject: [PATCH 04/17] change to 1.9.5 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 6603a62..0b636c8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: camera_with_rtmp: git: url: https://github.com/hetao29/flutter_rtmppublisher.git - ref: f9048093c98f6176b240d528495cd8b813a06021 + ref: ce58d5abee819b79dcdb73a9d55ee90b8ca163ea dev_dependencies: flutter_test: From bd88f2097a12a0ffe2ccd9555788f0a35fd1ff92 Mon Sep 17 00:00:00 2001 From: hetao Date: Mon, 30 Aug 2021 23:26:50 +0800 Subject: [PATCH 05/17] to 1.9.9 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 0b636c8..14eda07 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: camera_with_rtmp: git: url: https://github.com/hetao29/flutter_rtmppublisher.git - ref: ce58d5abee819b79dcdb73a9d55ee90b8ca163ea + ref: 7160b7a63c712f806db031831e8450a431b9e0ff dev_dependencies: flutter_test: From a5a76184ff1970706b0a1038cfde0c69badda380 Mon Sep 17 00:00:00 2001 From: hetao Date: Mon, 30 Aug 2021 23:40:50 +0800 Subject: [PATCH 06/17] 2.0.7 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 14eda07..86f46ff 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: camera_with_rtmp: git: url: https://github.com/hetao29/flutter_rtmppublisher.git - ref: 7160b7a63c712f806db031831e8450a431b9e0ff + ref: 9de85f784d68ed419685ae1464c9e2a0c8c8b40b dev_dependencies: flutter_test: From 25c2391a227b81771edd3f040febcbb37b979c25 Mon Sep 17 00:00:00 2001 From: hetao Date: Mon, 30 Aug 2021 23:44:21 +0800 Subject: [PATCH 07/17] 2.0.6 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 86f46ff..cb61c20 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: camera_with_rtmp: git: url: https://github.com/hetao29/flutter_rtmppublisher.git - ref: 9de85f784d68ed419685ae1464c9e2a0c8c8b40b + ref: e2af882a7d91edb78c02bfb46a0b0961b33d4285 dev_dependencies: flutter_test: From 4811615ea11f47fd2aea53c15ab759799a96154f Mon Sep 17 00:00:00 2001 From: hetao Date: Mon, 30 Aug 2021 23:49:04 +0800 Subject: [PATCH 08/17] 2.0.0 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index cb61c20..7afb7ed 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: camera_with_rtmp: git: url: https://github.com/hetao29/flutter_rtmppublisher.git - ref: e2af882a7d91edb78c02bfb46a0b0961b33d4285 + ref: 9d1b3c0b492f0649c2c145a27559763087ebebe2 dev_dependencies: flutter_test: From e29beda5dba55ad2581f3aacc52a2b799425212b Mon Sep 17 00:00:00 2001 From: hetao Date: Mon, 30 Aug 2021 23:59:42 +0800 Subject: [PATCH 09/17] 2.0.4 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 7afb7ed..9c72fc7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: camera_with_rtmp: git: url: https://github.com/hetao29/flutter_rtmppublisher.git - ref: 9d1b3c0b492f0649c2c145a27559763087ebebe2 + ref: f97cfc631a59726b11df72231670cee51db40aa5 dev_dependencies: flutter_test: From 528500cf41b60e7f72144db4539ca33669f5e34a Mon Sep 17 00:00:00 2001 From: hetao Date: Tue, 31 Aug 2021 00:07:45 +0800 Subject: [PATCH 10/17] 2.0.3 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 9c72fc7..ec7c943 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: camera_with_rtmp: git: url: https://github.com/hetao29/flutter_rtmppublisher.git - ref: f97cfc631a59726b11df72231670cee51db40aa5 + ref: 7e3f099a3191952189944725acba5dcbf504a891 dev_dependencies: flutter_test: From e489c56e7ffc310fa23be3c1ee967c5c4e474242 Mon Sep 17 00:00:00 2001 From: hetao Date: Tue, 31 Aug 2021 00:18:11 +0800 Subject: [PATCH 11/17] 2.0.2 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index ec7c943..e8d70b0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: camera_with_rtmp: git: url: https://github.com/hetao29/flutter_rtmppublisher.git - ref: 7e3f099a3191952189944725acba5dcbf504a891 + ref: e291afb1c95756b735902bea213931b5100ba79c dev_dependencies: flutter_test: From a34e161d7f75ae42e9fa39096b7954d8a51f544e Mon Sep 17 00:00:00 2001 From: hetao Date: Tue, 31 Aug 2021 00:24:14 +0800 Subject: [PATCH 12/17] 2.0.1 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index e8d70b0..cafe596 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: camera_with_rtmp: git: url: https://github.com/hetao29/flutter_rtmppublisher.git - ref: e291afb1c95756b735902bea213931b5100ba79c + ref: 79010b3724574f79b60974b64982aad751b56803 dev_dependencies: flutter_test: From e2347a7f45a4a0a997e1993b7af1cca0f1da8503 Mon Sep 17 00:00:00 2001 From: hetao Date: Tue, 31 Aug 2021 10:45:27 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=AF=94=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pubspec.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index cafe596..ff39d01 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,11 +12,18 @@ dependencies: sdk: flutter fijkplayer: ^0.10.0 flutter_webrtc: ^0.6.5 - #rtmp_publisher_null_safety: ^0.3.9 - camera_with_rtmp: - git: - url: https://github.com/hetao29/flutter_rtmppublisher.git - ref: 79010b3724574f79b60974b64982aad751b56803 + rtmp_publisher: + git: + url: git@github.com:hetao29/flutter_rtmp_publisher.git + ref: ef7a7b80e49c933009429c5f0c93bd093bd97c70 + #camera_with_rtmp: + #path: ../flutter_rtmppublisher_hetao29 + # git: + # url: git@github.com:babulpatel1309/flutter_rtmppublisher.git + + #git: + # url: https://github.com/hetao29/flutter_rtmppublisher.git + # ref: 79010b3724574f79b60974b64982aad751b56803 dev_dependencies: flutter_test: From 9f6378cdf3e3a08679b18e7457f3066d1084f5a7 Mon Sep 17 00:00:00 2001 From: hetao Date: Tue, 31 Aug 2021 13:56:41 +0800 Subject: [PATCH 14/17] fix 1.4.x kotlin error --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index ff39d01..c2c7567 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: rtmp_publisher: git: url: git@github.com:hetao29/flutter_rtmp_publisher.git - ref: ef7a7b80e49c933009429c5f0c93bd093bd97c70 + ref: cec26cc1b53c4bf495c81be8f4b54a1db3c8ea72 #camera_with_rtmp: #path: ../flutter_rtmppublisher_hetao29 # git: From f7f187b53ce7f378395ef74df960f5ef83616a22 Mon Sep 17 00:00:00 2001 From: hetao Date: Tue, 31 Aug 2021 16:32:09 +0800 Subject: [PATCH 15/17] 1.9.9 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index c2c7567..189c5f0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: rtmp_publisher: git: url: git@github.com:hetao29/flutter_rtmp_publisher.git - ref: cec26cc1b53c4bf495c81be8f4b54a1db3c8ea72 + ref: 4fb5819440d480ca64693c1418ddc41213cce616 #camera_with_rtmp: #path: ../flutter_rtmppublisher_hetao29 # git: From 10568c6b1f264b433c68a6b90e84af9773c5b41a Mon Sep 17 00:00:00 2001 From: HeTao Date: Thu, 2 Sep 2021 14:51:35 +0800 Subject: [PATCH 16/17] support switch camera --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 189c5f0..ff50215 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: rtmp_publisher: git: url: git@github.com:hetao29/flutter_rtmp_publisher.git - ref: 4fb5819440d480ca64693c1418ddc41213cce616 + ref: ad21c2eb003854b195745f87df7ed38f7ab18010 #camera_with_rtmp: #path: ../flutter_rtmppublisher_hetao29 # git: From f8a32d65a657d4a473f3d556f73729c18c93e28e Mon Sep 17 00:00:00 2001 From: hetao Date: Thu, 2 Sep 2021 17:25:32 +0800 Subject: [PATCH 17/17] add camera switch --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index ff50215..9345643 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: rtmp_publisher: git: url: git@github.com:hetao29/flutter_rtmp_publisher.git - ref: ad21c2eb003854b195745f87df7ed38f7ab18010 + ref: 172c092a9d23aab1d873a67963d625a98ab7c21f #camera_with_rtmp: #path: ../flutter_rtmppublisher_hetao29 # git: