betterplayer icon indicating copy to clipboard operation
betterplayer copied to clipboard

[BUG] android: BetterPlayer.setupPlayerNotification() seeks to the beggining of the datasource for no reason

Open ptsekov opened this issue 2 years ago • 0 comments

History check #1024 might be related

Describe the bug Use a 'BetterPlayerConfiguration' with 'autoPlay' set to 'false'. Add an event listener which handles 'BetterPlayerEventType.initialized' and 'BetterPlayerEventType.seekTo' events. When 'BetterPlayerEventType.initialized' is received use 'seekTo()' to move to a position greater than 0 into the data source. When 'BetterPlayerEventType.seekTo' is received invoke 'play()'.

The expected result is that playback should start at the specified position, however playback starts at the beginning.

It seems the notification code assumes playback always starts at the beginning which is not always true. In any case I don't see why notification setup code should touch the player position.

Commenting the line exoPlayer.seekTo(0) at the end of BetterPlayer.setupPlayerNotification() fixes the issue.

To Reproduce See above

Expected behavior Playback should start at the specified position.

Flutter doctor Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Version 10.0.19044.1706], locale en-US) [√] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [√] Chrome - develop for the web [√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.2) [√] Android Studio (version 2021.2) [√] Android Studio [√] VS Code (version 1.67.0) [√] Connected device (4 available) [√] HTTP Host Availability

• No issues found!

Better Player version

  • Version: 0.0.81

Smartphone (please complete the following information):

  • Device: Android phone
  • OS: Android

ptsekov avatar Jun 16 '22 00:06 ptsekov