Skip to content

Commit 6979ce0

Browse files
authored
[video_player_avplay] Fix an assertion issue (#911)
1 parent 3aa0b0d commit 6979ce0

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

packages/video_player_avplay/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.7.1
2+
* Fix an assertion issue when getting AD information.
3+
14
## 0.7.0
25
* Add new features for DASH video player
36
1. Support update token before and after player prepare done.

packages/video_player_avplay/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To use this package, add `video_player_avplay` as a dependency in your `pubspec.
1212

1313
```yaml
1414
dependencies:
15-
video_player_avplay: ^0.7.0
15+
video_player_avplay: ^0.7.1
1616
```
1717
1818
Then you can import `video_player_avplay` in your Dart code:

packages/video_player_avplay/lib/src/ad_info_from_dash.dart

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class AdInfoFromDash {
3838

3939
/// Parse the ad information from a map. Returns null if the map is null or empty. Otherwise, returns a new instance of [AdInfoFromDash].
4040
static AdInfoFromDash? fromAdInfoMap(Map<Object?, Object?>? adInfo) {
41-
if (adInfo!.isNotEmpty) {
42-
final int adId = adInfo['id']! as int;
41+
if (adInfo?.isNotEmpty ?? false) {
42+
final int adId = adInfo!['id']! as int;
4343
final int startTime = adInfo['start_ms']! as int;
4444
final int endTime = adInfo['end_ms']! as int;
4545
final int durationTime = adInfo['duration_ms']! as int;
@@ -48,13 +48,12 @@ class AdInfoFromDash {
4848
final bool cancelIndicator = adInfo['cancel_indicator']! as bool;
4949

5050
return AdInfoFromDash(
51-
adId: adId,
52-
cancelIndicator: cancelIndicator,
53-
startTime: startTime,
54-
endTime: endTime,
55-
durationTime: durationTime,
56-
outOfNetworkIndicator: outOfNetworkIndicator,
57-
);
51+
adId: adId,
52+
cancelIndicator: cancelIndicator,
53+
startTime: startTime,
54+
endTime: endTime,
55+
durationTime: durationTime,
56+
outOfNetworkIndicator: outOfNetworkIndicator);
5857
}
5958

6059
return null;
@@ -84,12 +83,6 @@ class AdInfoFromDash {
8483
outOfNetworkIndicator == other.outOfNetworkIndicator;
8584

8685
@override
87-
int get hashCode => Object.hash(
88-
adId,
89-
cancelIndicator,
90-
startTime,
91-
endTime,
92-
durationTime,
93-
outOfNetworkIndicator,
94-
);
86+
int get hashCode => Object.hash(adId, cancelIndicator, startTime, endTime,
87+
durationTime, outOfNetworkIndicator);
9588
}

packages/video_player_avplay/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: video_player_avplay
22
description: Flutter plugin for displaying inline video on Tizen TV devices.
33
homepage: https://github.com/flutter-tizen/plugins
44
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/video_player_avplay
5-
version: 0.7.0
5+
version: 0.7.1
66

77
environment:
88
sdk: ">=3.1.0 <4.0.0"

0 commit comments

Comments
 (0)