You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: flutter_vlc_player/lib/src/vlc_player_controller.dart
+91-26Lines changed: 91 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -35,8 +35,10 @@ class VlcPlayerController extends ValueNotifier<VlcPlayerValue> {
35
35
this.hwAcc =HwAcc.AUTO,
36
36
this.autoPlay =true,
37
37
this.options,
38
-
VoidCallback? onInit,
39
-
RendererCallback? onRendererHandler,
38
+
@Deprecated('Please, use the addOnInitListener method instead.')
39
+
VoidCallback? onInit,
40
+
@Deprecated('Please, use the addOnRendererEventListener method instead.')
41
+
RendererCallback? onRendererHandler,
40
42
}) : _dataSourceType =DataSourceType.asset,
41
43
_onInit = onInit,
42
44
_onRendererHandler = onRendererHandler,
@@ -53,8 +55,10 @@ class VlcPlayerController extends ValueNotifier<VlcPlayerValue> {
53
55
this.hwAcc =HwAcc.AUTO,
54
56
this.autoPlay =true,
55
57
this.options,
56
-
VoidCallback? onInit,
57
-
RendererCallback? onRendererHandler,
58
+
@Deprecated('Please, use the addOnInitListener method instead.')
59
+
VoidCallback? onInit,
60
+
@Deprecated('Please, use the addOnRendererEventListener method instead.')
61
+
RendererCallback? onRendererHandler,
58
62
}) : package =null,
59
63
_dataSourceType =DataSourceType.network,
60
64
_onInit = onInit,
@@ -71,8 +75,10 @@ class VlcPlayerController extends ValueNotifier<VlcPlayerValue> {
71
75
this.hwAcc =HwAcc.AUTO,
72
76
this.autoPlay =true,
73
77
this.options,
74
-
VoidCallback? onInit,
75
-
RendererCallback? onRendererHandler,
78
+
@Deprecated('Please, use the addOnInitListener method instead.')
79
+
VoidCallback? onInit,
80
+
@Deprecated('Please, use the addOnRendererEventListener method instead.')
81
+
RendererCallback? onRendererHandler,
76
82
}) : dataSource ='file://${file.path}',
77
83
package =null,
78
84
_dataSourceType =DataSourceType.file,
@@ -97,6 +103,19 @@ class VlcPlayerController extends ValueNotifier<VlcPlayerValue> {
97
103
/// Initialize vlc player when the platform is ready automatically
98
104
finalbool autoInitialize;
99
105
106
+
/// This is a callback that will be executed once the platform view has been initialized.
107
+
/// If you want the media to play as soon as the platform view has initialized, you could just call
108
+
/// [VlcPlayerController.play] in this callback. (see the example).
109
+
///
110
+
/// This member is deprecated, please, use the [addOnInitListener] method instead.
111
+
finalVoidCallback? _onInit;
112
+
113
+
/// This is a callback that will be executed every time a new renderer cast device attached/detached
114
+
/// It should be defined as "void Function(VlcRendererEventType, String, String)", where the VlcRendererEventType is an enum { attached, detached } and the next two String arguments are unique-id and name of renderer device, respectively.
115
+
///
116
+
/// This member is deprecated, please, use the [addOnRendererEventListener] method instead.
117
+
finalRendererCallback? _onRendererHandler;
118
+
100
119
/// Only set for [asset] videos. The package that the asset was loaded from.
101
120
String? package;
102
121
@@ -117,19 +136,36 @@ class VlcPlayerController extends ValueNotifier<VlcPlayerValue> {
117
136
/// The viewId for this controller
118
137
lateint _viewId;
119
138
120
-
/// This is a callback that will be executed once the platform view has been initialized.
121
-
/// If you want the media to play as soon as the platform view has initialized, you could just call
122
-
/// [VlcPlayerController.play] in this callback. (see the example)
123
-
final _onInit;
139
+
/// List of onInit listeners
140
+
finalList<VoidCallback> _onInitListeners = [];
124
141
125
-
/// This is a callback that will be executed every time a new renderer cast device attached/detached
126
-
/// It should be defined as "void Function(VlcRendererEventType, String, String)", where the VlcRendererEventType is an enum { attached, detached } and the next two String arguments are unique-id and name of renderer device, respectively.
0 commit comments