Skip to content

Allow MediaSource instances to be reused #3498

@stoleruedgar

Description

@stoleruedgar

Issue description

Passing the same DynamicConcatenatingMediaSource to a new SimpleExoPlayer instance doubles the internal mediaSourceHolders which in turn breaks the Player behaviour

Reproduction steps

public class TestActivity extends Activity {

	private DynamicConcatenatingMediaSource playlist = null
	private SimpleExoPlayer player = null

	protected onCreate(Bundle savedInstance) {
		super.onCreate(savedInstance)
		playlist = ....init with mediasources       
	}	

	protected onStart() {
		super.onStart()      
		if (player == null) {
			player = ...init player
			if (playlist != null) {
				player.prepare(playlist, false, true)
			}
		} 
	}

	protected onStop() {
		super.onStop()
		player = ...release player
	}	
}

Put the activity in background and then bring the app in the foreground.

Version of ExoPlayer being used

r2.5.4

Device(s) and version(s) of Android being used

Samsung Galaxy S7, Android 7.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions