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

Video jumps back when switching sources for the same media #2369

Closed
edgars-supe opened this issue Jan 24, 2017 · 0 comments
Closed

Video jumps back when switching sources for the same media #2369

edgars-supe opened this issue Jan 24, 2017 · 0 comments
Assignees
Labels

Comments

@edgars-supe
Copy link

edgars-supe commented Jan 24, 2017

bugreport-NPF26K-2017-01-24-11-02-28.zip
Hello!
We've encountered an issue, wherein upon switching to a different media source, the player jumps back to the position of the last seekTo(). E.g., I'm watching a movie, skip 30 seconds ahead, after a while I decide to change the language, have to change streams (we don't have master playlists for our HLS streams, unfortunately), and then it jumps back to where I had skipped to previously.
This issue happens in r2.1.1, but not in r2.0.4, and on all devices we tested (including Android TV devices).
Relevant code:

//wherever we switch languages, quality, subtitles, etc.
videoPlayer.prepare(getMediaSource(), false, true);

protected MediaSource getMediaSource() {
	MediaSource videoSource = new HlsMediaSource(Uri.parse(video.getUrl()), dataSourceFactory, handler, null);
	if(video.getSubtitle() != null) {
		StreamSubtitle s = video.getSubtitle();
		Format format = Format.createTextSampleFormat(s.getId(), MimeTypes.TEXT_VTT, null, Format.NO_VALUE, C.SELECTION_FLAG_DEFAULT, s.getCode(), null);
		MediaSource subtitleSource = new SingleSampleMediaSource(Uri.parse(s.getUrl()), dataSourceFactory, format, videoPlayer.getDuration());
		return new MergingMediaSource(videoSource, subtitleSource);
	}
	return videoSource;
}

Also, I tried it with resetTimeline set to false, didn't help. What did help was switching back to r2.0.4.
I made a bugreport, too, but I don't know where to/how to attach it, so if you need it, please tell me how. I learnt how to read.
Here's a stream you can test:
http://195.13.206.155/vod/mp4:hn_domnica_1_1_030815_lv_hd.mp4/playlist.m3u8?resource_id=kino_domnica_2015_08_03&auth_token=app_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE0ODUyNDU4NTAsImV4cCI6NDY5MjcxNTMxMTAsInVzZXJfaWQiOm51bGwsInJpZ2h0cyI6bnVsbCwidWlkIjoiMTIzIn0.SW3qItmcTaOlVbYan_o-arhZ5IIa7ApV6MbGbzDdZH0
Unfortunately, I can't provide links for different languages.

@AquilesCanta AquilesCanta self-assigned this Jan 24, 2017
ojw28 pushed a commit that referenced this issue Jan 30, 2017
@ojw28 ojw28 closed this as completed Jan 30, 2017
@google google locked and limited conversation to collaborators Jun 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants