Skip to content

player.getCurrentPosition() return value is negative when using ClippingMediaSource #4873

@Romantic-LiXuefeng

Description

@Romantic-LiXuefeng

ExoPlayer version: v2.8.4
The sample code is :

 MediaSource[] mediaSources = new MediaSource[uris.length];
 for (int i = 0; i < uris.length; i++) {
     mediaSources[i] = buildMediaSource(uris[i], extensions[i], null);
 }
 if (mediaSources.length == 1){
    ClippingMediaSource content1 = new ClippingMediaSource(mediaSources[0], 0, 15000000,null);
    ClippingMediaSource content2 = new ClippingMediaSource(mediaSources[0], 15000000, C.TIME_END_OF_SOURCE,null);
    mediaSource = new ConcatenatingMediaSource(
          content1,            // content[0~15s]
          content2 );           // content[15s ~ end]
}

I use a ClippingMediaSource to split one video into two video at point 15s, then concatenate them.
When the player begins to play the second video, I pressed home button, then resume to play, I find
that the TimeBar's current position is negative. The logs like this:

  E/EventLogger: player position = [-6421] bufferedPosition = [-1742]
  E/EventLogger:player position = [-5006] bufferedPosition = [4760]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions