1. 22 Nov, 2022 14 commits
  2. 16 Nov, 2022 11 commits
  3. 14 Nov, 2022 11 commits
  4. 10 Nov, 2022 4 commits
    • Fix bug where streamOffsetUs is passed instead of streamPositionUs · c9fe52bf
      Also make order of streamStartPositionUs and streamOffsetUs consistent
      
      PiperOrigin-RevId: 487511633
      kimvde committed
    • Ensure listener invocations use final state variable. · 33bea391
      The MediaControllerImplBase listener invocations currently use the
      class member state that can change if one of the listener method
      implementations changes the state recursively.
      
      Updating the listener invocations to use a final local variable
      ensures all listeners get consistent updates.
      
      PiperOrigin-RevId: 487503373
      tonihei committed
    • Split test methods more clearly in arrange, act, assert. · c6a0ba25
      The tests in MediaControllerCompatCallbackWithMediaSessionTest
      don't follow this pattern very consistently at the moment.
      
      PiperOrigin-RevId: 487501913
      tonihei committed
    • Align PlaybackStateCompat states with logic in MediaSessionConnector · c5e071e5
      Creating the PlaybackStateCompat from a media3 Player state is done
      already by the MediaSessionConnector (and used widely). The media3
      session module should set the same states under the same circumstances
      to ensure compatiblity and consistency.
      
      PlaybackStateCompat changes made in media3 session:
       - Use STATE_STOPPED when player is ended instead of STATE_PAUSED
       - Use STATE_PLAYING when playback is suppressed temporarily.
       - Set the playback speed to 0 if the player is not playing.
       - Add extras for mediaId and user-set playback speed.
      
      Part of the problem was that Player.isPlaying() was used to check
      the state. Unfortunately, MockPlayer.isPlaying() is implemented in
      a way that makes it hard to test these changes, because the value
      is set independently of playbackState, playWhenReady and suppression
      reason. To be able to write consistent, logical tests, this change
      also removes the independent setting of isPlaying in MockPlayer to
      align it better with a real player. This requires to update some
      other tests to use alternative methods.
      
      PiperOrigin-RevId: 487500859
      tonihei committed