Skip to content

Commit 3c77e84

Browse files
alr2413GuillermoDLCOmitchrosssolid-yuriiprykhodko
authored
Add VLC Http Options (#252)
* updated vlc event handling code * fix vlc error description * renamed error const strings * fixed a minor bug * Avoid FlutterVlcPlayerFactory new instances onAttachedToActivity (#214) * Avoid FlutterVlcPlayerFactory new instances onAttachedToActivity * Avoid FlutterVlcPlayerFactory instances in registerWith * fix error description docs * Added onInit & onRenderer listeners * updated docs mark onInit & onRendererHandler as deprecated. * updated documentation * fix initialization value of renderer variables * fixed vlc error on adding a local subtitle/audio * Added recording feature * fix a minor issue * updated platform recording methods * updated ios recording methods * updated pubspec * Update flutter_vlc_player/ios/Classes/VlcViewBuilder.swift Co-authored-by: Yuri Prykhodko <[email protected]> * Update flutter_vlc_player/example/lib/vlc_player_with_controls.dart Co-authored-by: Yuri Prykhodko <[email protected]> * Update flutter_vlc_player/example/lib/single_tab.dart Co-authored-by: Yuri Prykhodko <[email protected]> * Update flutter_vlc_player/example/lib/single_tab.dart Co-authored-by: Yuri Prykhodko <[email protected]> * Update flutter_vlc_player/example/lib/single_tab.dart Co-authored-by: Yuri Prykhodko <[email protected]> * Update flutter_vlc_player/example/lib/vlc_player_with_controls.dart Co-authored-by: Yuri Prykhodko <[email protected]> * fixed mentioned issues migrated from pedantic to lint package updated readme * added http options updated readme * updated readme * removed http options updated readme * added vlc http options Co-authored-by: Guillermo Jeremy De La Cruz Onton <[email protected]> Co-authored-by: Mitch Ross <[email protected]> Co-authored-by: Yuri Prykhodko <[email protected]>
1 parent 6527d03 commit 3c77e84

File tree

9 files changed

+60
-8
lines changed

9 files changed

+60
-8
lines changed

flutter_vlc_player/CHANGELOG.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
## 6.0.4
2+
* Added VLC http options
3+
Credits to Alireza Setayesh (https://github.com/alr2413).
4+
15
## 6.0.3
2-
* Added Vlc Recording feature
6+
* Added VLC recording feature
37
Credits to Alireza Setayesh (https://github.com/alr2413).
48

59
## 6.0.2
6-
* Fix issue with vlc error event
10+
* Fix issue with VLC error event
711
* Added onInit & onRenderer listeners
812
Credits to Alireza Setayesh (https://github.com/alr2413) and solid-vovabeloded (https://github.com/solid-vovabeloded).
913

@@ -16,7 +20,7 @@ Credits to Mitch Ross (https://github.com/mitchross)
1620
Credits to Mitch Ross (https://github.com/mitchross)
1721

1822
## 5.0.5
19-
* Added Vlc Subtitle Styling.
23+
* Added VLC Subtitle Styling.
2024
* Split ios swift code into multiple files for better readability.
2125
Credits to Alireza Setayesh (https://github.com/alr2413) and Yurii Prykhodko (https://github.com/solid-yuriiprykhodko).
2226

flutter_vlc_player/example/lib/single_tab.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ class _SingleTabState extends State<SingleTab> {
9494
// works only on externally added subtitles
9595
VlcSubtitleOptions.color(VlcSubtitleColor.navy),
9696
]),
97+
http: VlcHttpOptions([
98+
VlcHttpOptions.httpReconnect(true),
99+
]),
97100
rtp: VlcRtpOptions([
98101
VlcRtpOptions.rtpOverRtsp(true),
99102
]),

flutter_vlc_player/lib/flutter_vlc_player.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export 'package:flutter_vlc_player_platform_interface/flutter_vlc_player_platfor
1515
VlcPlayerOptions,
1616
VlcAdvancedOptions,
1717
VlcAudioOptions,
18+
VlcHttpOptions,
1819
VlcRtpOptions,
1920
VlcStreamOutputOptions,
2021
VlcVideoOptions,

flutter_vlc_player/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_vlc_player
22
description: A VLC-powered alternative to Flutter's video_player. Supports multiple players on one screen.
3-
version: 6.0.3
3+
version: 6.0.4
44
homepage: https://github.com/solid-software/flutter_vlc_player/
55

66
environment:
@@ -21,7 +21,7 @@ dependencies:
2121
sdk: flutter
2222

2323
meta: ^1.3.0
24-
flutter_vlc_player_platform_interface: ^1.0.6
24+
flutter_vlc_player_platform_interface: ^1.0.7
2525

2626
dev_dependencies:
2727
flutter_test:

flutter_vlc_player_platform_interface/CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
## 1.0.7
2+
3+
- Add VLC http options
4+
15
## 1.0.6
26

3-
- Added Vlc Recording feature
7+
- Added VLC recording feature
48

59
## 1.0.5
610

711
- Upgrade to Null Safety
812

913
## 1.0.4
1014

11-
- Add vlc subtitle options
15+
- Add VLC subtitle options
1216

1317
## 1.0.3
1418

flutter_vlc_player_platform_interface/lib/flutter_vlc_player_platform_interface.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export 'src/events/renderer_event.dart';
1111

1212
export 'src/utils/options/vlc_advanced_options.dart';
1313
export 'src/utils/options/vlc_audio_options.dart';
14+
export 'src/utils/options/vlc_http_options.dart';
1415
export 'src/utils/options/vlc_player_options.dart';
1516
export 'src/utils/options/vlc_rtp_options.dart';
1617
export 'src/utils/options/vlc_stream_output_options.dart';
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
class VlcHttpOptions {
2+
final List<String> options;
3+
4+
VlcHttpOptions(this.options);
5+
6+
/// Automatically try to reconnect to the stream in case of a sudden disconnect.
7+
/// (default disabled)
8+
static String httpReconnect(bool enable) {
9+
return enable ? '--http-reconnect' : '--no-http-reconnect';
10+
}
11+
12+
/// Keep reading a resource that keeps being updated.
13+
/// (default disabled)
14+
static String httpContinuous(bool enable) {
15+
return enable ? '--http-continuous' : '--no-http-continuous';
16+
}
17+
18+
/// Forward cookies across HTTP redirections.
19+
/// (default enabled)
20+
static String httpForwardCookies(bool enable) {
21+
return enable ? '--http-forward-cookies' : '--no-http-forward-cookies';
22+
}
23+
24+
/// Provide the referral URL, i.e. HTTP "Referer" (sic).
25+
static String httpReferrer(String referrer) {
26+
return '--http-referrer=' + referrer;
27+
}
28+
29+
/// Override the name and version of the application as provided to the
30+
/// HTTP server, i.e. the HTTP "User-Agent". Name and version must be
31+
/// separated by a forward slash, e.g. "FooBar/1.2.3".
32+
static String httpUserAgent(String userAgent) {
33+
return '--http-user-agent=' + userAgent;
34+
}
35+
}

flutter_vlc_player_platform_interface/lib/src/utils/options/vlc_player_options.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'vlc_advanced_options.dart';
22
import 'vlc_audio_options.dart';
3+
import 'vlc_http_options.dart';
34
import 'vlc_rtp_options.dart';
45
import 'vlc_stream_output_options.dart';
56
import 'vlc_subtitle_options.dart';
@@ -9,6 +10,7 @@ class VlcPlayerOptions {
910
VlcPlayerOptions({
1011
this.advanced,
1112
this.audio,
13+
this.http,
1214
this.video,
1315
this.subtitle,
1416
this.rtp,
@@ -18,6 +20,7 @@ class VlcPlayerOptions {
1820

1921
final VlcAdvancedOptions? advanced;
2022
final VlcAudioOptions? audio;
23+
final VlcHttpOptions? http;
2124
final VlcVideoOptions? video;
2225
final VlcSubtitleOptions? subtitle;
2326
final VlcRtpOptions? rtp;
@@ -28,6 +31,7 @@ class VlcPlayerOptions {
2831
var options = <String>[];
2932
if (advanced != null) options.addAll(advanced!.options);
3033
if (audio != null) options.addAll(audio!.options);
34+
if (http != null) options.addAll(http!.options);
3135
if (video != null) options.addAll(video!.options);
3236
if (subtitle != null) options.addAll(subtitle!.options);
3337
if (rtp != null) options.addAll(rtp!.options);

flutter_vlc_player_platform_interface/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: flutter_vlc_player_platform_interface
22
description: A common platform interface for the flutter vlc player plugin.
33
homepage: https://github.com/solid-software/flutter_vlc_player
4-
version: 1.0.6
4+
version: 1.0.7
55

66
environment:
77
sdk: '>=2.12.0 <3.0.0'

0 commit comments

Comments
 (0)