Closed alfonsoramosa closed 7 years ago
Have you read the Javadoc for Timeline, Window and Period, and getCurrentPosition? They describe the model used in some detail:
http://google.github.io/ExoPlayer/doc/reference/com/google/android/exoplayer2/Timeline.html http://google.github.io/ExoPlayer/doc/reference/com/google/android/exoplayer2/ExoPlayer.html#getCurrentPosition--
Please let us know whether you're able to answer your question, or whether you're still stuck. If still stuck, perhaps you could provide a concrete example of specific calls that are not working as you expect.
I will try to explain what I need and the problems that I'm having with this special kind of content:
Timeline.Window w1 = new Timeline.Window();
player.getCurrentTimeline().getWindow(player.getCurrentWindowIndex(), w1);
Timeline.Period p1 = new Timeline.Period();
player.getCurrentTimeline().getPeriod(player.getCurrentPeriodIndex(), p1);
I have checked, during the playback, all the fields where I think I can get the value I need, but I can't find it. Only the duration is available for the Period and the Window
The timeline is an instance of SinglePeriodTimeline
player.getCurrentTimeline().getPeriodCount() -> 1
player.getCurrentTimeline().getWindowCount() -> 1
p1.getPositionInWindowMs() -> 0
w1.getDefaultPositionMs()) -> 0
w1.windowStartTimeMs -> TIME_UNSET
w1.presentationStartTimeMs -> TIME_UNSET
w1.getPositionInFirstPeriodMs() -> 0
w1.positionInFirstPeriodUs -> 0
player.getCurrentTimeline().isEmpty() -> false
player.isCurrentWindowSeekable() -> true
Hi,
@ojw28 can you please provide some help with this issue (my previous post).
BR, Alfonso
If you just want elapsed time, couldn't you just time this yourself at the application level? I don't think you need any player support to do this.
Beyond that, it's hard to advise what to do without access to a test stream that's setup in the way you describe.
Hi,
@ojw28 What I need is to get the currentPosition in the interval (0, duration). That works perfectly with other contents. With this contents, I'm getting the currentPosition for example in the interval (14931911990078373, 14931911990078373+duration) and I have no way to translate it to something in the interval (0, duration)
I'm getting the currentPosition within ExoplayerWrapper method: public long getCurrentPosition() { return player.getCurrentPosition(); }
In my first post, you have an example of the manifest
Thanks, Alfonso
It's unclear whether this:
Get the playback position to display it, for example, if Exoplayer has been playing the content for 1 minute and 25 seconds, I would like to display 01:25
and this:
What I need is to get the currentPosition in the interval (0, duration).
are the same thing. They sound like different things to me, so it's still quite unclear what you're asking for. In the Timeline
Javadoc I think you probably have a case that corresponds to the third diagram (live stream with limited availability). Is that correct? If so, are you trying to get:
getCurrentPosition
.Are you trying to get (1), but seeing that getCurrentPosition
isn't giving you that? I think we need working test content to assist. A small snippet of a manifest is not sufficient for us to help in an efficient way. Please provide working test content.
Hi @ojw28
Dont' know if there is a case in the TimeLine Javadoc that describes exactly what I'm trying to do. I will tray to explain more in detail and see if you have any suggestion.
Thanks, Alfonso
Ah, so the problem is that you have a VOD manifest that's actually just a static snapshot of a previously broadcast (and possibly still ongoing) live stream. The timestamps in the VOD manifest don't start at t=0 for this reason, but you want positions reported as though they do. Is that correct?
Please provide working test content, and we'll take a look at figuring out how to do this. We're not going to investigate without. Thanks.
Hi @ojw28,
that's correct. I'm not doing that with ongoing assets, just with ended assets. I will tray to find a content that you can use to test it (without DRM).
BR, Alfonso
It's somewhat ambiguous from the SmoothStreaming specification exactly how this use case is supposed to work. That said, we were definitely doing some things wrong with the timeline construction. I've made some changes and now you should see the window position advancing from 0 as you expect. Please give it a try by using the latest from the dev-v2
branch!
@ojw28 Hi, Thank you, it's working fine now!! do you have an estimation about how is this fix going to be merged in release-v2?
BR, Alfonso
Nope, sorry. We're not going to cut a release just for this, so it'll be ready when it's ready. In the meantime you'll need to patch the change in locally if you want it.
Exoplayer 2.2.0 Device: Nexus player Android 7.1.1
I'm trying to play Smooth Streaming Rolling Buffer CatchUp (CDN buffer) assets with Exoplayer. The time reference for the chanks is not starting at 0, as happens with VOD assets, but for example at 14931911990078373, see manifest example:
I'm having some problems in the Exoplayer wrapper, as it's expecting position received and passed to SimpleExoPlayer in the interval (0, duration), but for this asset it's in the interval (14931911990078373, 14931911990078373+duration), affected methods are:
My questions are: