Skip to content
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_avplay/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.7.7

* Fix black line issue when playing video.

## 0.7.6
* Fix video doesn't scale issue.

Expand Down
2 changes: 1 addition & 1 deletion packages/video_player_avplay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To use this package, add `video_player_avplay` as a dependency in your `pubspec.

```yaml
dependencies:
video_player_avplay: ^0.7.6
video_player_avplay: ^0.7.7
```
Then you can import `video_player_avplay` in your Dart code:
Expand Down
37 changes: 20 additions & 17 deletions packages/video_player_avplay/lib/video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1246,26 +1246,29 @@ class _VideoPlayerState extends State<VideoPlayer> {
WidgetsBinding.instance.addPostFrameCallback(_afterFrameLayout);
}

bool _isInvalid(double value) {
return value.isInfinite || value.isNaN;
}

void _afterFrameLayout(_) {
if (widget.controller.value.isInitialized) {
final Rect currentRect = _getCurrentRect();
if (currentRect != Rect.zero && _playerRect != currentRect) {
final Rect rect = _getCurrentRect();
if (rect != Rect.zero && _playerRect != rect) {
final double offsetLeft = rect.left - rect.left.floor();
final double offsetTop = rect.top - rect.top.floor();
final double offsetWidth = rect.width.ceil() - rect.width;
final double offsetHeight = rect.height.ceil() - rect.height;
final int left = _isInvalid(rect.left) ? 0 : rect.left.floor();
final int top = _isInvalid(rect.top) ? 0 : rect.top.floor();
final int width = _isInvalid(rect.width)
? 1
: rect.width.ceil() + ((offsetLeft > offsetWidth) ? 1 : 0);
final int height = _isInvalid(rect.height)
? 1
: rect.height.ceil() + ((offsetTop > offsetHeight) ? 1 : 0);
_videoPlayerPlatform.setDisplayGeometry(
_playerId,
(currentRect.left.isInfinite || currentRect.left.isNaN)
? 0
: currentRect.left.toInt(),
(currentRect.top.isInfinite || currentRect.top.isNaN)
? 0
: currentRect.top.toInt(),
(currentRect.width.isInfinite || currentRect.width.isNaN)
? 1
: currentRect.width.toInt(),
(currentRect.height.isInfinite || currentRect.height.isNaN)
? 1
: currentRect.height.toInt(),
);
_playerRect = currentRect;
_playerId, left, top, width, height);
_playerRect = rect;
}
}
WidgetsBinding.instance.addPostFrameCallback(_afterFrameLayout);
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player_avplay/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: video_player_avplay
description: Flutter plugin for displaying inline video on Tizen TV devices.
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/video_player_avplay
version: 0.7.6
version: 0.7.7

environment:
sdk: ">=3.1.0 <4.0.0"
Expand Down