From 5fdf5a9a92db4a01a52e16762ed58191f49005f7 Mon Sep 17 00:00:00 2001 From: "yue7.huang" Date: Fri, 22 Dec 2023 20:33:31 +0800 Subject: [PATCH 1/3] Set display is visible --- packages/video_player_avplay/CHANGELOG.md | 4 ++++ packages/video_player_avplay/README.md | 2 +- packages/video_player_avplay/lib/video_player.dart | 6 +++++- packages/video_player_avplay/pubspec.yaml | 2 +- packages/video_player_avplay/tizen/src/plus_player.cc | 4 ++++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/video_player_avplay/CHANGELOG.md b/packages/video_player_avplay/CHANGELOG.md index 746b6bb8f..381fa139e 100644 --- a/packages/video_player_avplay/CHANGELOG.md +++ b/packages/video_player_avplay/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.3 + +* Fix issue of not display video when start play. + ## 0.1.2 * Replace surface id with resource id for fixing overlap issue. diff --git a/packages/video_player_avplay/README.md b/packages/video_player_avplay/README.md index d7a42cfee..08690f04f 100644 --- a/packages/video_player_avplay/README.md +++ b/packages/video_player_avplay/README.md @@ -12,7 +12,7 @@ To use this package, add `video_player_avplay` as a dependency in your `pubspec. ```yaml dependencies: - video_player_avplay: ^0.1.2 + video_player_avplay: ^0.1.3 ``` Then you can import `video_player_avplay` in your Dart code: diff --git a/packages/video_player_avplay/lib/video_player.dart b/packages/video_player_avplay/lib/video_player.dart index 86548d7bf..971935df1 100644 --- a/packages/video_player_avplay/lib/video_player.dart +++ b/packages/video_player_avplay/lib/video_player.dart @@ -578,7 +578,11 @@ class VideoPlayerController extends ValueNotifier { // This ensures that the correct playback speed is always applied when // playing back. This is necessary because we do not set playback speed // when paused. - await _applyPlaybackSpeed(); + // + // For Tizen, playback speed don't need to set when start play, + // otherwise player will restart buffer. + // The default value is 1.0. + // await _applyPlaybackSpeed(); } else { _timer?.cancel(); await _videoPlayerPlatform.pause(_playerId); diff --git a/packages/video_player_avplay/pubspec.yaml b/packages/video_player_avplay/pubspec.yaml index cb6812495..4b55c1697 100644 --- a/packages/video_player_avplay/pubspec.yaml +++ b/packages/video_player_avplay/pubspec.yaml @@ -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.1.2 +version: 0.1.3 environment: sdk: ">=2.18.0 <4.0.0" diff --git a/packages/video_player_avplay/tizen/src/plus_player.cc b/packages/video_player_avplay/tizen/src/plus_player.cc index ec6085746..834099393 100644 --- a/packages/video_player_avplay/tizen/src/plus_player.cc +++ b/packages/video_player_avplay/tizen/src/plus_player.cc @@ -618,6 +618,10 @@ void PlusPlayer::OnPrepareDone(bool ret, void *user_data) { LOG_INFO("[PlusPlayer] Prepare done, result: %d.", ret); PlusPlayer *self = reinterpret_cast(user_data); + if (!SetDisplayVisible(self->player_, true)) { + LOG_ERROR("[PlusPlayer] Fail to set display visible."); + } + if (!self->is_initialized_ && ret) { self->SendInitialized(); } From 98040c4e22a0e6d08a11fb5357e84b6905ecf7f9 Mon Sep 17 00:00:00 2001 From: "yue7.huang" Date: Mon, 25 Dec 2023 14:04:49 +0800 Subject: [PATCH 2/3] Remove annotation --- packages/video_player_avplay/lib/video_player.dart | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/video_player_avplay/lib/video_player.dart b/packages/video_player_avplay/lib/video_player.dart index 971935df1..2ad55d31a 100644 --- a/packages/video_player_avplay/lib/video_player.dart +++ b/packages/video_player_avplay/lib/video_player.dart @@ -575,10 +575,6 @@ class VideoPlayerController extends ValueNotifier { }, ); - // This ensures that the correct playback speed is always applied when - // playing back. This is necessary because we do not set playback speed - // when paused. - // // For Tizen, playback speed don't need to set when start play, // otherwise player will restart buffer. // The default value is 1.0. From fc90aec5990a7de159e44f75001ba22f6535bd33 Mon Sep 17 00:00:00 2001 From: "yue7.huang" Date: Mon, 25 Dec 2023 18:28:31 +0800 Subject: [PATCH 3/3] Set play speed do not need judge playing state --- packages/video_player_avplay/lib/video_player.dart | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/packages/video_player_avplay/lib/video_player.dart b/packages/video_player_avplay/lib/video_player.dart index 2ad55d31a..f41e1f494 100644 --- a/packages/video_player_avplay/lib/video_player.dart +++ b/packages/video_player_avplay/lib/video_player.dart @@ -574,11 +574,6 @@ class VideoPlayerController extends ValueNotifier { _updatePosition(newPosition); }, ); - - // For Tizen, playback speed don't need to set when start play, - // otherwise player will restart buffer. - // The default value is 1.0. - // await _applyPlaybackSpeed(); } else { _timer?.cancel(); await _videoPlayerPlatform.pause(_playerId); @@ -597,13 +592,6 @@ class VideoPlayerController extends ValueNotifier { return; } - // Setting the playback speed on iOS will trigger the video to play. We - // prevent this from happening by not applying the playback speed until - // the video is manually played from Flutter. - if (!value.isPlaying) { - return; - } - await _videoPlayerPlatform.setPlaybackSpeed( _playerId, value.playbackSpeed,