Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ video_player_avplay] Make startPosition support int32_t #778

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.5.6

* Make startPosition support int32_t type.

## 0.5.5

* Fix select audio channel failed 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.5.5
video_player_avplay: ^0.5.6
```

Then you can import `video_player_avplay` in your Dart code:
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.5.5
version: 0.5.6

environment:
sdk: ">=3.1.0 <4.0.0"
Expand Down
8 changes: 8 additions & 0 deletions packages/video_player_avplay/tizen/src/plus_player.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ int64_t PlusPlayer::Create(const std::string &uri,

int64_t start_position = flutter_common::GetValue(
create_message.player_options(), "startPosition", (int64_t)0);
if (start_position == 0) {
// if startPosition is in the range of int32_t, it will convert as int32_t.
// if startPosition >= INT32_MAX, it will convert as int64_t.
// TODO we will implement a new function for long type, no need call two
// times.
start_position = flutter_common::GetValue(create_message.player_options(),
"startPosition", (int32_t)0);
JSUYA marked this conversation as resolved.
Show resolved Hide resolved
}
if (start_position > 0) {
LOG_INFO("[PlusPlayer] Start position: %lld", start_position);
if (!Seek(player_, start_position)) {
Expand Down