@@ -17,9 +17,7 @@ VideoPlayerInstanceApi _productionApiProvider(int playerId) {
1717}
1818
1919/// The non-test implementation of `_videoEventStreamProvider` .
20- Stream <PlatformVideoEvent > _productionVideoEventStreamProvider (
21- String streamIdentifier,
22- ) {
20+ Stream <PlatformVideoEvent > _productionVideoEventStreamProvider (String streamIdentifier) {
2321 return pigeon.videoEvents (instanceName: streamIdentifier);
2422}
2523
@@ -29,8 +27,7 @@ class AndroidVideoPlayer extends VideoPlayerPlatform {
2927 /// Creates a new Android video player implementation instance.
3028 AndroidVideoPlayer ({
3129 @visibleForTesting AndroidVideoPlayerApi ? pluginApi,
32- @visibleForTesting
33- VideoPlayerInstanceApi Function (int playerId)? playerApiProvider,
30+ @visibleForTesting VideoPlayerInstanceApi Function (int playerId)? playerApiProvider,
3431 Stream <PlatformVideoEvent > Function (String streamIdentifier)?
3532 videoEventStreamProvider,
3633 }) : _api = pluginApi ?? AndroidVideoPlayerApi (),
@@ -90,14 +87,9 @@ class AndroidVideoPlayer extends VideoPlayerPlatform {
9087 case DataSourceType .asset:
9188 final String ? asset = dataSource.asset;
9289 if (asset == null ) {
93- throw ArgumentError (
94- '"asset" must be non-null for an asset data source' ,
95- );
90+ throw ArgumentError ('"asset" must be non-null for an asset data source' );
9691 }
97- final String key = await _api.getLookupKeyForAsset (
98- asset,
99- dataSource.package,
100- );
92+ final String key = await _api.getLookupKeyForAsset (asset, dataSource.package);
10193 uri = 'asset:///$key ' ;
10294 case DataSourceType .network:
10395 uri = dataSource.uri;
@@ -213,9 +205,7 @@ class AndroidVideoPlayer extends VideoPlayerPlatform {
213205 final VideoPlayerViewState viewState = _playerWith (id: playerId).viewState;
214206
215207 return switch (viewState) {
216- VideoPlayerTextureViewState (: final int textureId) => Texture (
217- textureId: textureId,
218- ),
208+ VideoPlayerTextureViewState (: final int textureId) => Texture (textureId: textureId),
219209 VideoPlayerPlatformViewState () => PlatformViewPlayer (playerId: playerId),
220210 };
221211 }
@@ -237,8 +227,8 @@ class AndroidVideoPlayer extends VideoPlayerPlatform {
237227 for (final ExoPlayerAudioTrackData track in nativeData.exoPlayerTracks! ) {
238228 tracks.add (
239229 VideoAudioTrack (
240- groupIndex: track.groupIndex! ,
241- trackIndex: track.trackIndex! ,
230+ groupIndex: track.groupIndex,
231+ trackIndex: track.trackIndex,
242232 label: track.label,
243233 language: track.language,
244234 isSelected: track.isSelected,
@@ -257,9 +247,7 @@ class AndroidVideoPlayer extends VideoPlayerPlatform {
257247 @override
258248 Future <void > selectAudioTrack (int playerId, VideoAudioTrack track) {
259249 // Extract groupIndex and trackIndex from the track object for Android's ExoPlayer
260- return _playerWith (
261- id: playerId,
262- ).selectAudioTrack (track.groupIndex, track.trackIndex);
250+ return _playerWith (id: playerId).selectAudioTrack (track.groupIndex, track.trackIndex);
263251 }
264252
265253 @override
@@ -273,9 +261,7 @@ class AndroidVideoPlayer extends VideoPlayerPlatform {
273261 return player ?? (throw StateError ('No active player with ID $id .' ));
274262 }
275263
276- PlatformVideoFormat ? _platformVideoFormatFromVideoFormat (
277- VideoFormat ? format,
278- ) {
264+ PlatformVideoFormat ? _platformVideoFormatFromVideoFormat (VideoFormat ? format) {
279265 return switch (format) {
280266 VideoFormat .dash => PlatformVideoFormat .dash,
281267 VideoFormat .hls => PlatformVideoFormat .hls,
@@ -459,9 +445,7 @@ class _PlayerInstance {
459445 // should be synchronous with the state change.
460446 break ;
461447 case PlatformPlaybackState .ended:
462- _eventStreamController.add (
463- VideoEvent (eventType: VideoEventType .completed),
464- );
448+ _eventStreamController.add (VideoEvent (eventType: VideoEventType .completed));
465449 case PlatformPlaybackState .unknown:
466450 // Ignore unknown states. This isn't an error since the media
467451 // framework could add new states in the future.
0 commit comments