Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to get getCurrentPosition with playbackControlView.setShowMultiWindowTimeBar(true); of the next video #8375

Closed
pawaom opened this issue Dec 19, 2020 · 1 comment
Assignees

Comments

@pawaom
Copy link

pawaom commented Dec 19, 2020

how can we get the current position of the second, third video with ConcatenatingMediaSource

I had a look at playerview, where the current position text is updated, I want to have a custom implementation of the seekbar and to display the current position text in a similar way.

if (!timeline.isEmpty()) {
                        int currentWindowIndex = player.getCurrentWindowIndex();
                        int firstWindowIndex = multiWindowTimeBar ? 0 : currentWindowIndex;
                        int lastWindowIndex = multiWindowTimeBar ? timeline.getWindowCount() - 1 : currentWindowIndex;
                        for (int i = firstWindowIndex; i <= lastWindowIndex; i++) {
                            if (i == currentWindowIndex) {
                                currentWindowOffset = C.usToMs(durationUs);
                            }

an easier option would be to get currentWindowOffset directly, is it possible.

@pawaom pawaom changed the title how to get getCurrentPosition with playbackControlView.setShowMultiWindowTimeBar(true); of the next how to get getCurrentPosition with playbackControlView.setShowMultiWindowTimeBar(true); of the next video Dec 19, 2020
@marcbaechinger marcbaechinger self-assigned this Dec 29, 2020
@marcbaechinger
Copy link
Contributor

I think I understand you want to get the duration of each item in the ConcatenatingMediaSource. With this you can calculate the total position of the start of any media source in the playlist to display the current position in the entire playlist. If this is what you are trying to achieve, and if you are using progressive media, please refer to #4727.

The duration of progressive media items is available only when the player starts to buffer the media item, not before. This is a known limitation.

Duplicate of #4727.

Please re-open if I misunderstood your issue.

@google google locked and limited conversation to collaborators Feb 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants