From 91602c122372942fab0a7a969b1fc89022b16663 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Tue, 15 Feb 2022 08:48:33 +0200 Subject: [PATCH] FEC-11963 - if player is paused playbackrate should be reported 0 to youbora (#89) * if player is paused playbackrate should be reported 0 to youbora * simplify logic * - Extra space removed Co-authored-by: Gourav Saxena --- .../playkit/plugins/youbora/PKYouboraPlayerAdapter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 06d11d0..5009545 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -475,7 +475,10 @@ public Integer getDroppedFrames() { @Override public double getPlayrate() { - double currentPlaybackRate = (getPlayer() != null) ? getPlayer().getPlaybackRate() : 1.0; + double currentPlaybackRate = 0; + if (getPlayer() != null && getPlayer().isPlaying()) { + currentPlaybackRate = getPlayer().getPlaybackRate(); + } log.d("getPlayrate currentPlaybackRate = " + currentPlaybackRate + " isNullPlayer = " + (getPlayer() == null)); return currentPlaybackRate; }