Skip to content

Commit

Permalink
Fix falsely starting player service when previewing video
Browse files Browse the repository at this point in the history
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
  • Loading branch information
tobiasKaminsky authored and backportbot[bot] committed Nov 20, 2020
1 parent 4587113 commit 44ae1bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/nextcloud/client/media/PlayerService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.ui.notifications.NotificationUtils
import com.owncloud.android.utils.ThemeUtils
import dagger.android.AndroidInjection
import java.lang.IllegalArgumentException
import javax.inject.Inject

class PlayerService : Service() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ public void onStart() {
mMultiListContainer.setVisibility(View.GONE);
mPreviewContainer.setVisibility(View.VISIBLE);
} else if (MimeTypeUtil.isVideo(file)) {
stopAudio();
if (mMediaPlayerServiceConnection.isConnected() && mMediaPlayerServiceConnection.isPlaying()) {
stopAudio();
}
playVideo();
}
}
Expand Down

0 comments on commit 44ae1bf

Please sign in to comment.