Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
689a92c9
authored
Oct 28, 2021
by
ibaker
Committed by
bachinger
Oct 29, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Update the UI Components dev guide page to use MediaItem API
#minor-release PiperOrigin-RevId: 406163529
parent
dcdcb919
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
docs/ui-components.md
docs/ui-components.md
View file @
689a92c9
...
@@ -73,8 +73,8 @@ When a player has been initialized, it can be attached to the view by calling
...
@@ -73,8 +73,8 @@ When a player has been initialized, it can be attached to the view by calling
player = new ExoPlayer.Builder(context).build();
player = new ExoPlayer.Builder(context).build();
// Attach player to the view.
// Attach player to the view.
playerView.setPlayer(player);
playerView.setPlayer(player);
// Set the media
source
to be played.
// Set the media
item
to be played.
player.setMedia
Source(createMediaSource()
);
player.setMedia
Item(mediaItem
);
// Prepare the player.
// Prepare the player.
player.prepare();
player.prepare();
~~~
~~~
...
@@ -160,8 +160,10 @@ private void initializePlayer() {
...
@@ -160,8 +160,10 @@ private void initializePlayer() {
player = new ExoPlayer.Builder(context).build();
player = new ExoPlayer.Builder(context).build();
// Attach player to the view.
// Attach player to the view.
playerControlView.setPlayer(player);
playerControlView.setPlayer(player);
// Prepare the player with the dash media source.
// Set the media item to be played.
player.prepare(createMediaSource());
player.setMediaItem(mediaItem);
// Prepare the player.
player.prepare();
}
}
~~~
~~~
{: .language-java}
{: .language-java}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment