Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/video_player/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.10.2+3

* Fix bug where formatHint was not being pass down to network sources.

## 0.10.2+2

* Update and migrate iOS example project.
Expand Down
7 changes: 4 additions & 3 deletions packages/video_player/lib/video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,14 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
};
break;
case DataSourceType.network:
dataSourceDescription = <String, dynamic>{'uri': dataSource};
break;
case DataSourceType.file:
dataSourceDescription = <String, dynamic>{
'uri': dataSource,
'formatHint': _videoFormatStringMap[formatHint]
};
break;
case DataSourceType.file:
dataSourceDescription = <String, dynamic>{'uri': dataSource};
break;
}
final Map<String, dynamic> response =
await _channel.invokeMapMethod<String, dynamic>(
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: video_player
description: Flutter plugin for displaying inline video with other Flutter
widgets on Android and iOS.
author: Flutter Team <[email protected]>
version: 0.10.2+2
version: 0.10.2+3
homepage: https://github.com/flutter/plugins/tree/master/packages/video_player

flutter:
Expand Down
15 changes: 14 additions & 1 deletion packages/video_player/test/video_player_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@ void main() {
expect(
fakeVideoPlayerPlatform.dataSourceDescriptions[0], <String, dynamic>{
'uri': 'https://127.0.0.1',
'formatHint': null,
});
});

test('initialize network with hint', () async {
final VideoPlayerController controller = VideoPlayerController.network(
'https://127.0.0.1',
formatHint: VideoFormat.dash);
await controller.initialize();

expect(
fakeVideoPlayerPlatform.dataSourceDescriptions[0], <String, dynamic>{
'uri': 'https://127.0.0.1',
'formatHint': 'dash',
});
});

Expand All @@ -123,7 +137,6 @@ void main() {
expect(
fakeVideoPlayerPlatform.dataSourceDescriptions[0], <String, dynamic>{
'uri': 'file://a.avi',
'formatHint': null,
});
});
});
Expand Down