diff --git a/flutter_vlc_player/CHANGELOG.md b/flutter_vlc_player/CHANGELOG.md index f55c3d53..76cae255 100644 --- a/flutter_vlc_player/CHANGELOG.md +++ b/flutter_vlc_player/CHANGELOG.md @@ -1,9 +1,13 @@ +## 6.0.4 +* Added VLC http options +Credits to Alireza Setayesh (https://github.com/alr2413). + ## 6.0.3 -* Added Vlc Recording feature +* Added VLC recording feature Credits to Alireza Setayesh (https://github.com/alr2413). ## 6.0.2 -* Fix issue with vlc error event +* Fix issue with VLC error event * Added onInit & onRenderer listeners Credits to Alireza Setayesh (https://github.com/alr2413) and solid-vovabeloded (https://github.com/solid-vovabeloded). @@ -16,7 +20,7 @@ Credits to Mitch Ross (https://github.com/mitchross) Credits to Mitch Ross (https://github.com/mitchross) ## 5.0.5 -* Added Vlc Subtitle Styling. +* Added VLC Subtitle Styling. * Split ios swift code into multiple files for better readability. Credits to Alireza Setayesh (https://github.com/alr2413) and Yurii Prykhodko (https://github.com/solid-yuriiprykhodko). diff --git a/flutter_vlc_player/example/lib/single_tab.dart b/flutter_vlc_player/example/lib/single_tab.dart index acd7958e..6ecfad77 100644 --- a/flutter_vlc_player/example/lib/single_tab.dart +++ b/flutter_vlc_player/example/lib/single_tab.dart @@ -94,6 +94,9 @@ class _SingleTabState extends State { // works only on externally added subtitles VlcSubtitleOptions.color(VlcSubtitleColor.navy), ]), + http: VlcHttpOptions([ + VlcHttpOptions.httpReconnect(true), + ]), rtp: VlcRtpOptions([ VlcRtpOptions.rtpOverRtsp(true), ]), diff --git a/flutter_vlc_player/lib/flutter_vlc_player.dart b/flutter_vlc_player/lib/flutter_vlc_player.dart index 2fbf751c..62c02ede 100644 --- a/flutter_vlc_player/lib/flutter_vlc_player.dart +++ b/flutter_vlc_player/lib/flutter_vlc_player.dart @@ -15,6 +15,7 @@ export 'package:flutter_vlc_player_platform_interface/flutter_vlc_player_platfor VlcPlayerOptions, VlcAdvancedOptions, VlcAudioOptions, + VlcHttpOptions, VlcRtpOptions, VlcStreamOutputOptions, VlcVideoOptions, diff --git a/flutter_vlc_player/pubspec.yaml b/flutter_vlc_player/pubspec.yaml index 74129400..8c10b47b 100644 --- a/flutter_vlc_player/pubspec.yaml +++ b/flutter_vlc_player/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_vlc_player description: A VLC-powered alternative to Flutter's video_player. Supports multiple players on one screen. -version: 6.0.3 +version: 6.0.4 homepage: https://github.com/solid-software/flutter_vlc_player/ environment: @@ -21,7 +21,7 @@ dependencies: sdk: flutter meta: ^1.3.0 - flutter_vlc_player_platform_interface: ^1.0.6 + flutter_vlc_player_platform_interface: ^1.0.7 dev_dependencies: flutter_test: diff --git a/flutter_vlc_player_platform_interface/CHANGELOG.md b/flutter_vlc_player_platform_interface/CHANGELOG.md index 76fc98a4..874f3da6 100644 --- a/flutter_vlc_player_platform_interface/CHANGELOG.md +++ b/flutter_vlc_player_platform_interface/CHANGELOG.md @@ -1,6 +1,10 @@ +## 1.0.7 + +- Add VLC http options + ## 1.0.6 -- Added Vlc Recording feature +- Added VLC recording feature ## 1.0.5 @@ -8,7 +12,7 @@ ## 1.0.4 -- Add vlc subtitle options +- Add VLC subtitle options ## 1.0.3 diff --git a/flutter_vlc_player_platform_interface/lib/flutter_vlc_player_platform_interface.dart b/flutter_vlc_player_platform_interface/lib/flutter_vlc_player_platform_interface.dart index 5ed6e33a..ff072a1d 100644 --- a/flutter_vlc_player_platform_interface/lib/flutter_vlc_player_platform_interface.dart +++ b/flutter_vlc_player_platform_interface/lib/flutter_vlc_player_platform_interface.dart @@ -11,6 +11,7 @@ export 'src/events/renderer_event.dart'; export 'src/utils/options/vlc_advanced_options.dart'; export 'src/utils/options/vlc_audio_options.dart'; +export 'src/utils/options/vlc_http_options.dart'; export 'src/utils/options/vlc_player_options.dart'; export 'src/utils/options/vlc_rtp_options.dart'; export 'src/utils/options/vlc_stream_output_options.dart'; diff --git a/flutter_vlc_player_platform_interface/lib/src/utils/options/vlc_http_options.dart b/flutter_vlc_player_platform_interface/lib/src/utils/options/vlc_http_options.dart new file mode 100644 index 00000000..119709a9 --- /dev/null +++ b/flutter_vlc_player_platform_interface/lib/src/utils/options/vlc_http_options.dart @@ -0,0 +1,35 @@ +class VlcHttpOptions { + final List options; + + VlcHttpOptions(this.options); + + /// Automatically try to reconnect to the stream in case of a sudden disconnect. + /// (default disabled) + static String httpReconnect(bool enable) { + return enable ? '--http-reconnect' : '--no-http-reconnect'; + } + + /// Keep reading a resource that keeps being updated. + /// (default disabled) + static String httpContinuous(bool enable) { + return enable ? '--http-continuous' : '--no-http-continuous'; + } + + /// Forward cookies across HTTP redirections. + /// (default enabled) + static String httpForwardCookies(bool enable) { + return enable ? '--http-forward-cookies' : '--no-http-forward-cookies'; + } + + /// Provide the referral URL, i.e. HTTP "Referer" (sic). + static String httpReferrer(String referrer) { + return '--http-referrer=' + referrer; + } + + /// Override the name and version of the application as provided to the + /// HTTP server, i.e. the HTTP "User-Agent". Name and version must be + /// separated by a forward slash, e.g. "FooBar/1.2.3". + static String httpUserAgent(String userAgent) { + return '--http-user-agent=' + userAgent; + } +} diff --git a/flutter_vlc_player_platform_interface/lib/src/utils/options/vlc_player_options.dart b/flutter_vlc_player_platform_interface/lib/src/utils/options/vlc_player_options.dart index 3fa1d579..1f4fdb67 100644 --- a/flutter_vlc_player_platform_interface/lib/src/utils/options/vlc_player_options.dart +++ b/flutter_vlc_player_platform_interface/lib/src/utils/options/vlc_player_options.dart @@ -1,5 +1,6 @@ import 'vlc_advanced_options.dart'; import 'vlc_audio_options.dart'; +import 'vlc_http_options.dart'; import 'vlc_rtp_options.dart'; import 'vlc_stream_output_options.dart'; import 'vlc_subtitle_options.dart'; @@ -9,6 +10,7 @@ class VlcPlayerOptions { VlcPlayerOptions({ this.advanced, this.audio, + this.http, this.video, this.subtitle, this.rtp, @@ -18,6 +20,7 @@ class VlcPlayerOptions { final VlcAdvancedOptions? advanced; final VlcAudioOptions? audio; + final VlcHttpOptions? http; final VlcVideoOptions? video; final VlcSubtitleOptions? subtitle; final VlcRtpOptions? rtp; @@ -28,6 +31,7 @@ class VlcPlayerOptions { var options = []; if (advanced != null) options.addAll(advanced!.options); if (audio != null) options.addAll(audio!.options); + if (http != null) options.addAll(http!.options); if (video != null) options.addAll(video!.options); if (subtitle != null) options.addAll(subtitle!.options); if (rtp != null) options.addAll(rtp!.options); diff --git a/flutter_vlc_player_platform_interface/pubspec.yaml b/flutter_vlc_player_platform_interface/pubspec.yaml index 77413b8c..b3bc8545 100644 --- a/flutter_vlc_player_platform_interface/pubspec.yaml +++ b/flutter_vlc_player_platform_interface/pubspec.yaml @@ -1,7 +1,7 @@ name: flutter_vlc_player_platform_interface description: A common platform interface for the flutter vlc player plugin. homepage: https://github.com/solid-software/flutter_vlc_player -version: 1.0.6 +version: 1.0.7 environment: sdk: '>=2.12.0 <3.0.0'