Skip to content

Commit

Permalink
docs(README): move Player views section to Usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee committed Oct 24, 2023
1 parent 5f29006 commit f3b0f14
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ your app.
- [Getting started](#getting-started)
- [Installation](#installation)
- [Gradle](#gradle)
- [Permissions](#permissions)
- [Permissions](#permissions)
- [Retrieve your video Id](#retrieve-your-video-id)
- [Usage](#usage)
- [Supported player views](#supported-player-views)
- [Play your api.video video with ExoPlayer, MediaPlayer and VideoView](#play-your-apivideo-video-with-exoplayer-mediaplayer-and-videoview)
- [Player views](#player-views)
- [Sample application](#sample-application)
- [Documentation](#documentation)
- [Dependencies](#dependencies)
Expand Down Expand Up @@ -83,8 +81,8 @@ analytics of [your viewers usage](https://api.video/product/video-analytics/).
app:show_subtitles="true" />
```

You can also use an ExoPlayer `StyledPlayerView` or a `SurfaceView` according to your requirements.
See [Player views](#player-views) for more details.
You can also use an ExoPlayer `PlayerView` or a `SurfaceView` according to your requirements.
See [Supported player views](#supported-player-views) for more details.

2. Implements the `ApiVideoPlayerController.Listener` interface:

Expand Down Expand Up @@ -121,6 +119,21 @@ If you requires a fullscreen video. You will have to implement
the `ApiVideoPlayerController.ViewListener` interface.
Check out for the implementation in the [Sample application](#sample-application).

### Supported player views

The api.video Android player comes with a specific view `ApiVideoExoPlayerView` to display the video
and its controller. If you require a customization of this view such as changing a button color,...,
you can contact [us](https://github.com/apivideo/api.video-android-player/issues).

Otherwise, in the `ApiVideoPlayerController`, you can also use the following views:

* [`PlayerView`](https://developer.android.com/reference/androidx/media3/ui/PlayerView): ExoPlayer
views from `media3`
* [`SurfaceView`](https://developer.android.com/reference/android/view/SurfaceView)
* [`Surface`](https://developer.android.com/reference/android/view/Surface)

The `SurfaceView` and the `Surface` require more work to be used.

## Play your api.video video with ExoPlayer, MediaPlayer and VideoView

If you want to use the ExoPlayer directly, you can use the api.video Android extensions:
Expand Down Expand Up @@ -157,18 +170,6 @@ val videoView = binding.videoView // You already have that in your code
videoView.setVideo(videoOptions)
```

## Player views

The api.video Android player comes with a specific view `ApiVideoExoPlayerView` to display the video
and its controller. If you require a customization of the view such as changing a button color,...,
you can contact [us](https://github.com/apivideo/api.video-android-player/issues).
Otherwise, you can also directly use the ExoPlayer views
from `media3`: [`PlayerView`](https://developer.android.com/reference/androidx/media3/ui/PlayerView).
The `ApiVideoPlayerController` also supports other type of views such
as [`SurfaceView`](https://developer.android.com/reference/android/view/SurfaceView)
and [`Surface`](https://developer.android.com/reference/android/view/Surface) but it requires far
more work.

# Sample application

A demo application demonstrates how to use player.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import video.api.player.interfaces.IExoPlayerBasedPlayerView


/**
* The api.video player view class based on an ExoPlayer [StyledPlayerView].
* The api.video player view class based on an ExoPlayer [PlayerView].
*
* @param context the application context
* @param attrs the attributes of the XML tag that is inflating the view.
Expand Down

0 comments on commit f3b0f14

Please sign in to comment.