-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): Bump video_player_platform_interface from 5.1.4 to 6.0.1…
… in /flutter_news_example/packages/news_blocks_ui (#671) * chore(deps): Bump video_player_platform_interface Bumps [video_player_platform_interface](https://github.com/flutter/plugins/tree/main/packages/video_player) from 5.1.4 to 6.0.1. - [Release notes](https://github.com/flutter/plugins/releases) - [Commits](https://github.com/flutter/plugins/commits/video_player_platform_interface-v6.0.1/packages/video_player) --- updated-dependencies: - dependency-name: video_player_platform_interface dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * fix video player tests * fix flutter_news_example tests --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: matiasleyba <[email protected]> Co-authored-by: Kaicey Dettmann <[email protected]>
- Loading branch information
1 parent
dbba780
commit bb474ff
Showing
11 changed files
with
253 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
flutter_news_example/packages/news_blocks_ui/test/helpers/fake_video_player_platform.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
import 'package:video_player_platform_interface/video_player_platform_interface.dart'; | ||
|
||
class FakeVideoPlayerPlatform extends VideoPlayerPlatform { | ||
Completer<bool> initialized = Completer<bool>(); | ||
List<String> calls = <String>[]; | ||
List<DataSource> dataSources = <DataSource>[]; | ||
final Map<int, StreamController<VideoEvent>> streams = | ||
<int, StreamController<VideoEvent>>{}; | ||
bool forceInitError = false; | ||
int nextTextureId = 0; | ||
final Map<int, Duration> _positions = <int, Duration>{}; | ||
|
||
@override | ||
Future<int?> create(DataSource dataSource) async { | ||
calls.add('create'); | ||
final stream = StreamController<VideoEvent>(); | ||
streams[nextTextureId] = stream; | ||
if (forceInitError) { | ||
stream.addError( | ||
PlatformException( | ||
code: 'VideoError', | ||
message: 'Video player had error XYZ', | ||
), | ||
); | ||
} else { | ||
stream.add( | ||
VideoEvent( | ||
eventType: VideoEventType.initialized, | ||
size: const Size(100, 100), | ||
duration: const Duration(seconds: 1), | ||
), | ||
); | ||
} | ||
dataSources.add(dataSource); | ||
return nextTextureId++; | ||
} | ||
|
||
@override | ||
Future<void> dispose(int textureId) async { | ||
calls.add('dispose'); | ||
} | ||
|
||
@override | ||
Future<void> init() async { | ||
calls.add('init'); | ||
initialized.complete(true); | ||
} | ||
|
||
@override | ||
Stream<VideoEvent> videoEventsFor(int textureId) { | ||
return streams[textureId]!.stream; | ||
} | ||
|
||
@override | ||
Future<void> pause(int textureId) async { | ||
calls.add('pause'); | ||
} | ||
|
||
@override | ||
Future<void> play(int textureId) async { | ||
calls.add('play'); | ||
} | ||
|
||
@override | ||
Future<Duration> getPosition(int textureId) async { | ||
calls.add('position'); | ||
return _positions[textureId] ?? Duration.zero; | ||
} | ||
|
||
@override | ||
Future<void> seekTo(int textureId, Duration position) async { | ||
calls.add('seekTo'); | ||
_positions[textureId] = position; | ||
} | ||
|
||
@override | ||
Future<void> setLooping(int textureId, bool looping) async { | ||
calls.add('setLooping'); | ||
} | ||
|
||
@override | ||
Future<void> setVolume(int textureId, double volume) async { | ||
calls.add('setVolume'); | ||
} | ||
|
||
@override | ||
Future<void> setPlaybackSpeed(int textureId, double speed) async { | ||
calls.add('setPlaybackSpeed'); | ||
} | ||
|
||
@override | ||
Future<void> setMixWithOthers(bool mixWithOthers) async { | ||
calls.add('setMixWithOthers'); | ||
} | ||
|
||
@override | ||
Widget buildView(int textureId) { | ||
return Texture(textureId: textureId); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
flutter_news_example/packages/news_blocks_ui/test/helpers/helpers.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
flutter_news_example/test/article/helpers/fake_video_player_platform.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
import 'package:video_player_platform_interface/video_player_platform_interface.dart'; | ||
|
||
class FakeVideoPlayerPlatform extends VideoPlayerPlatform { | ||
Completer<bool> initialized = Completer<bool>(); | ||
List<String> calls = <String>[]; | ||
List<DataSource> dataSources = <DataSource>[]; | ||
final Map<int, StreamController<VideoEvent>> streams = | ||
<int, StreamController<VideoEvent>>{}; | ||
bool forceInitError = false; | ||
int nextTextureId = 0; | ||
final Map<int, Duration> _positions = <int, Duration>{}; | ||
|
||
@override | ||
Future<int?> create(DataSource dataSource) async { | ||
calls.add('create'); | ||
final stream = StreamController<VideoEvent>(); | ||
streams[nextTextureId] = stream; | ||
if (forceInitError) { | ||
stream.addError( | ||
PlatformException( | ||
code: 'VideoError', | ||
message: 'Video player had error XYZ', | ||
), | ||
); | ||
} else { | ||
stream.add( | ||
VideoEvent( | ||
eventType: VideoEventType.initialized, | ||
size: const Size(100, 100), | ||
duration: const Duration(seconds: 1), | ||
), | ||
); | ||
} | ||
dataSources.add(dataSource); | ||
return nextTextureId++; | ||
} | ||
|
||
@override | ||
Future<void> dispose(int textureId) async { | ||
calls.add('dispose'); | ||
} | ||
|
||
@override | ||
Future<void> init() async { | ||
calls.add('init'); | ||
initialized.complete(true); | ||
} | ||
|
||
@override | ||
Stream<VideoEvent> videoEventsFor(int textureId) { | ||
return streams[textureId]!.stream; | ||
} | ||
|
||
@override | ||
Future<void> pause(int textureId) async { | ||
calls.add('pause'); | ||
} | ||
|
||
@override | ||
Future<void> play(int textureId) async { | ||
calls.add('play'); | ||
} | ||
|
||
@override | ||
Future<Duration> getPosition(int textureId) async { | ||
calls.add('position'); | ||
return _positions[textureId] ?? Duration.zero; | ||
} | ||
|
||
@override | ||
Future<void> seekTo(int textureId, Duration position) async { | ||
calls.add('seekTo'); | ||
_positions[textureId] = position; | ||
} | ||
|
||
@override | ||
Future<void> setLooping(int textureId, bool looping) async { | ||
calls.add('setLooping'); | ||
} | ||
|
||
@override | ||
Future<void> setVolume(int textureId, double volume) async { | ||
calls.add('setVolume'); | ||
} | ||
|
||
@override | ||
Future<void> setPlaybackSpeed(int textureId, double speed) async { | ||
calls.add('setPlaybackSpeed'); | ||
} | ||
|
||
@override | ||
Future<void> setMixWithOthers(bool mixWithOthers) async { | ||
calls.add('setMixWithOthers'); | ||
} | ||
|
||
@override | ||
Widget buildView(int textureId) { | ||
return Texture(textureId: textureId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export 'fake_video_player_platform.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters