1--- 2title: Progressive 3--- 4 5{% include_relative _page_fragments/supported-formats-progressive.md %} 6 7## Using MediaItem ## 8 9To play a progressive stream, create a `MediaItem` with the media URI and pass 10it to the player. 11 12~~~ 13// Create a player instance. 14ExoPlayer player = new ExoPlayer.Builder(context).build(); 15// Set the media item to be played. 16player.setMediaItem(MediaItem.fromUri(progressiveUri)); 17// Prepare the player. 18player.prepare(); 19~~~ 20{: .language-java} 21 22## Using ProgressiveMediaSource ## 23 24For more customization options, you can create a `ProgressiveMediaSource` and 25directly to the player instead of a `MediaItem`. 26 27~~~ 28// Create a data source factory. 29DataSource.Factory dataSourceFactory = new DefaultHttpDataSource.Factory(); 30// Create a progressive media source pointing to a stream uri. 31MediaSource mediaSource = new ProgressiveMediaSource.Factory(dataSourceFactory) 32 .createMediaSource(MediaItem.fromUri(progressiveUri)); 33// Create a player instance. 34ExoPlayer player = new ExoPlayer.Builder(context).build(); 35// Set the media source to be played. 36player.setMediaSource(mediaSource); 37// Prepare the player. 38player.prepare(); 39~~~ 40{: .language-java} 41 42## Customizing playback ## 43 44ExoPlayer provides multiple ways for you to tailor playback experience to your 45app's needs. See the [Customization page][] for examples. 46 47[Customization page]: {{ site.baseurl }}/customization.html 48