Skip to content

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

@edgars-supe

Description

@edgars-supe

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions