Commit c8e23b49 by ibaker Committed by Ian Baker

Remove references to Player(Control)View from the dev guide

Remove most of the customisation documentation, since StyledPlayerView
isn't really designed to be customised as deeply as PlayerView.

Also remove most documentation around StyledPlayerControlView,
especially as a standalone controller class - since it doesn't work
well for this use-case.

#minor-release

PiperOrigin-RevId: 426090762
parent 4112a99f
...@@ -64,9 +64,8 @@ Internally, `DefaultMediaSourceFactory` will wrap the content media source in an ...@@ -64,9 +64,8 @@ Internally, `DefaultMediaSourceFactory` will wrap the content media source in an
`AdsLoader.Provider` and use it to insert ads as defined by the media item's ad `AdsLoader.Provider` and use it to insert ads as defined by the media item's ad
tag. tag.
ExoPlayer's `StyledPlayerView` and `PlayerView` UI components both ExoPlayer's `StyledPlayerView` implements `AdViewProvider`. The IMA extension
implement `AdViewProvider`. The IMA extension provides an easy to use provides an easy to use `AdsLoader`, as described below.
`AdsLoader`, as described below.
### Playlists with ads ### ### Playlists with ads ###
...@@ -123,11 +122,11 @@ VAST/VMAP ad tags in the sample list. ...@@ -123,11 +122,11 @@ VAST/VMAP ad tags in the sample list.
#### UI considerations #### #### UI considerations ####
`StyledPlayerView` and `PlayerView` hide controls during playback of ads `StyledPlayerView` hides its transport controls during playback of ads by
by default, but apps can toggle this behavior by calling default, but apps can toggle this behavior by calling
`setControllerHideDuringAds`, which is defined on both views. The IMA SDK will `setControllerHideDuringAds`. The IMA SDK will show additional views on top of
show additional views on top of the player while an ad is playing (e.g., a 'more the player while an ad is playing (e.g., a 'more info' link and a skip button,
info' link and a skip button, if applicable). if applicable).
Since advertisers expect a consistent experience across apps, the IMA SDK does Since advertisers expect a consistent experience across apps, the IMA SDK does
not allow customization of the views that it shows while an ad is playing. It is not allow customization of the views that it shows while an ad is playing. It is
...@@ -139,9 +138,9 @@ The IMA SDK may report whether ads are obscured by application provided views ...@@ -139,9 +138,9 @@ The IMA SDK may report whether ads are obscured by application provided views
rendered on top of the player. Apps that need to overlay views that are rendered on top of the player. Apps that need to overlay views that are
essential for controlling playback must register them with the IMA SDK so that essential for controlling playback must register them with the IMA SDK so that
they can be omitted from viewability calculations. When using `StyledPlayerView` they can be omitted from viewability calculations. When using `StyledPlayerView`
or `PlayerView` as the `AdViewProvider`, they will automatically register as the `AdViewProvider`, it will automatically register its control overlays.
their control overlays. Apps that use a custom player UI must register overlay Apps that use a custom player UI must register overlay views by returning them
views by returning them from `AdViewProvider.getAdOverlayInfos`. from `AdViewProvider.getAdOverlayInfos`.
For more information about overlay views, see For more information about overlay views, see
[Open Measurement in the IMA SDK][]. [Open Measurement in the IMA SDK][].
......
...@@ -130,6 +130,5 @@ The following guidelines apply specifically for live streams: ...@@ -130,6 +130,5 @@ The following guidelines apply specifically for live streams:
[HlsMediaSource]: {{ site.exo_sdk }}/source/hls/HlsMediaSource.html [HlsMediaSource]: {{ site.exo_sdk }}/source/hls/HlsMediaSource.html
[HTTP Live Streaming]: https://tools.ietf.org/html/rfc8216 [HTTP Live Streaming]: https://tools.ietf.org/html/rfc8216
[UI components]: {{ site.baseurl }}/ui-components.html
[Customization page]: {{ site.baseurl }}/customization.html [Customization page]: {{ site.baseurl }}/customization.html
[Medium post about HLS playback in ExoPlayer]: https://medium.com/google-exoplayer/hls-playback-in-exoplayer-a33959a47be7 [Medium post about HLS playback in ExoPlayer]: https://medium.com/google-exoplayer/hls-playback-in-exoplayer-a33959a47be7
...@@ -112,20 +112,20 @@ gets from the libgav1 decoder: ...@@ -112,20 +112,20 @@ gets from the libgav1 decoder:
* GL rendering using GL shader for color space conversion * GL rendering using GL shader for color space conversion
* If you are using `ExoPlayer` with `PlayerView` or `StyledPlayerView`, * If you are using `ExoPlayer` with `StyledPlayerView`, enable this option
enable this option by setting `surface_type` of view to be by setting the `surface_type` of the view to be
`video_decoder_gl_surface_view`. `video_decoder_gl_surface_view`.
* Otherwise, enable this option by sending `Libgav1VideoRenderer` a * Otherwise, enable this option by sending `Libgav1VideoRenderer` a
message of type `Renderer.MSG_SET_VIDEO_OUTPUT` with an instance of message of type `Renderer.MSG_SET_VIDEO_OUTPUT` with an instance of
`VideoDecoderOutputBufferRenderer` as its object. `VideoDecoderOutputBufferRenderer` as its object.
`VideoDecoderGLSurfaceView` is the concrete `VideoDecoderGLSurfaceView` is the concrete
`VideoDecoderOutputBufferRenderer` implementation used by `PlayerView` `VideoDecoderOutputBufferRenderer` implementation used by
and `StyledPlayerView`. `StyledPlayerView`.
* Native rendering using `ANativeWindow` * Native rendering using `ANativeWindow`
* If you are using `ExoPlayer` with `PlayerView` or `StyledPlayerView`, * If you are using `ExoPlayer` with `StyledPlayerView`, this option is
this option is enabled by default. enabled by default.
* Otherwise, enable this option by sending `Libgav1VideoRenderer` a * Otherwise, enable this option by sending `Libgav1VideoRenderer` a
message of type `Renderer.MSG_SET_VIDEO_OUTPUT` with an instance of message of type `Renderer.MSG_SET_VIDEO_OUTPUT` with an instance of
`SurfaceView` as its object. `SurfaceView` as its object.
......
...@@ -125,20 +125,20 @@ gets from the libvpx decoder: ...@@ -125,20 +125,20 @@ gets from the libvpx decoder:
* GL rendering using GL shader for color space conversion * GL rendering using GL shader for color space conversion
* If you are using `ExoPlayer` with `PlayerView` or `StyledPlayerView`, * If you are using `ExoPlayer` with `StyledPlayerView`, enable this option
enable this option by setting `surface_type` of view to be by setting the `surface_type` of the view to be
`video_decoder_gl_surface_view`. `video_decoder_gl_surface_view`.
* Otherwise, enable this option by sending `LibvpxVideoRenderer` a message * Otherwise, enable this option by sending `LibvpxVideoRenderer` a message
of type `Renderer.MSG_SET_VIDEO_OUTPUT` with an instance of of type `Renderer.MSG_SET_VIDEO_OUTPUT` with an instance of
`VideoDecoderOutputBufferRenderer` as its object. `VideoDecoderOutputBufferRenderer` as its object.
`VideoDecoderGLSurfaceView` is the concrete `VideoDecoderGLSurfaceView` is the concrete
`VideoDecoderOutputBufferRenderer` implementation used by `PlayerView` `VideoDecoderOutputBufferRenderer` implementation used by
and `StyledPlayerView`. `StyledPlayerView`.
* Native rendering using `ANativeWindow` * Native rendering using `ANativeWindow`
* If you are using `ExoPlayer` with `PlayerView` or `StyledPlayerView`, * If you are using `ExoPlayer` with `StyledPlayerView`, this option is
this option is enabled by default. enabled by default.
* Otherwise, enable this option by sending `LibvpxVideoRenderer` a message * Otherwise, enable this option by sending `LibvpxVideoRenderer` a message
of type `Renderer.MSG_SET_VIDEO_OUTPUT` with an instance of of type `Renderer.MSG_SET_VIDEO_OUTPUT` with an instance of
`SurfaceView` as its object. `SurfaceView` as its object.
......
...@@ -89,8 +89,7 @@ import java.util.concurrent.CopyOnWriteArrayList; ...@@ -89,8 +89,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
* A view for controlling {@link Player} instances. * A view for controlling {@link Player} instances.
* *
* <p>A StyledPlayerControlView can be customized by setting attributes (or calling corresponding * <p>A StyledPlayerControlView can be customized by setting attributes (or calling corresponding
* methods), overriding drawables, overriding the view's layout file, or by specifying a custom view * methods), or overriding drawables.
* layout file.
* *
* <h2>Attributes</h2> * <h2>Attributes</h2>
* *
...@@ -188,123 +187,6 @@ import java.util.concurrent.CopyOnWriteArrayList; ...@@ -188,123 +187,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
* <li><b>{@code exo_styled_controls_shuffle_on}</b> - The shuffle icon when shuffling is enabled. * <li><b>{@code exo_styled_controls_shuffle_on}</b> - The shuffle icon when shuffling is enabled.
* <li><b>{@code exo_styled_controls_vr}</b> - The VR icon. * <li><b>{@code exo_styled_controls_vr}</b> - The VR icon.
* </ul> * </ul>
*
* <h2>Overriding the layout file</h2>
*
* To customize the layout of StyledPlayerControlView throughout your app, or just for certain
* configurations, you can define {@code exo_styled_player_control_view.xml} layout files in your
* application {@code res/layout*} directories. But, in this case, you need to be careful since the
* default animation implementation expects certain relative positions between children. See also <a
* href="CustomLayout">Specifying a custom layout file</a>.
*
* <p>The layout files in your {@code res/layout*} will override the one provided by the library,
* and will be inflated for use by StyledPlayerControlView. The view identifies and binds its
* children by looking for the following ids:
*
* <ul>
* <li><b>{@code exo_play_pause}</b> - The play and pause button.
* <ul>
* <li>Type: {@link ImageView}
* </ul>
* <li><b>{@code exo_rew}</b> - The rewind button.
* <ul>
* <li>Type: {@link View}
* </ul>
* <li><b>{@code exo_rew_with_amount}</b> - The rewind button with rewind amount.
* <ul>
* <li>Type: {@link TextView}
* <li>Note: StyledPlayerControlView will programmatically set the text with the rewind
* amount in seconds. Ignored if an {@code exo_rew} exists. Otherwise, it works as the
* rewind button.
* </ul>
* <li><b>{@code exo_ffwd}</b> - The fast forward button.
* <ul>
* <li>Type: {@link View}
* </ul>
* <li><b>{@code exo_ffwd_with_amount}</b> - The fast forward button with fast forward amount.
* <ul>
* <li>Type: {@link TextView}
* <li>Note: StyledPlayerControlView will programmatically set the text with the fast
* forward amount in seconds. Ignored if an {@code exo_ffwd} exists. Otherwise, it works
* as the fast forward button.
* </ul>
* <li><b>{@code exo_prev}</b> - The previous button.
* <ul>
* <li>Type: {@link View}
* </ul>
* <li><b>{@code exo_next}</b> - The next button.
* <ul>
* <li>Type: {@link View}
* </ul>
* <li><b>{@code exo_repeat_toggle}</b> - The repeat toggle button.
* <ul>
* <li>Type: {@link ImageView}
* <li>Note: StyledPlayerControlView will programmatically set the drawable on the repeat
* toggle button according to the player's current repeat mode. The drawables used are
* {@code exo_styled_controls_repeat_off}, {@code exo_styled_controls_repeat_one} and
* {@code exo_styled_controls_repeat_all}. See the section above for information on
* overriding these drawables.
* </ul>
* <li><b>{@code exo_shuffle}</b> - The shuffle button.
* <ul>
* <li>Type: {@link ImageView}
* <li>Note: StyledPlayerControlView will programmatically set the drawable on the shuffle
* button according to the player's current repeat mode. The drawables used are {@code
* exo_styled_controls_shuffle_off} and {@code exo_styled_controls_shuffle_on}. See the
* section above for information on overriding these drawables.
* </ul>
* <li><b>{@code exo_vr}</b> - The VR mode button.
* <ul>
* <li>Type: {@link View}
* </ul>
* <li><b>{@code exo_subtitle}</b> - The subtitle button.
* <ul>
* <li>Type: {@link ImageView}
* </ul>
* <li><b>{@code exo_fullscreen}</b> - The fullscreen button.
* <ul>
* <li>Type: {@link ImageView}
* </ul>
* <li><b>{@code exo_minimal_fullscreen}</b> - The fullscreen button in minimal mode.
* <ul>
* <li>Type: {@link ImageView}
* </ul>
* <li><b>{@code exo_position}</b> - Text view displaying the current playback position.
* <ul>
* <li>Type: {@link TextView}
* </ul>
* <li><b>{@code exo_duration}</b> - Text view displaying the current media duration.
* <ul>
* <li>Type: {@link TextView}
* </ul>
* <li><b>{@code exo_progress_placeholder}</b> - A placeholder that's replaced with the inflated
* {@link DefaultTimeBar}. Ignored if an {@code exo_progress} view exists.
* <ul>
* <li>Type: {@link View}
* </ul>
* <li><b>{@code exo_progress}</b> - Time bar that's updated during playback and allows seeking.
* {@link DefaultTimeBar} attributes set on the StyledPlayerControlView will not be
* automatically propagated through to this instance. If a view exists with this id, any
* {@code exo_progress_placeholder} view will be ignored.
* <ul>
* <li>Type: {@link TimeBar}
* </ul>
* </ul>
*
* <p>All child views are optional and so can be omitted if not required, however where defined they
* must be of the expected type.
*
* <h2 id="CustomLayout">Specifying a custom layout file</h2>
*
* Defining your own {@code exo_styled_player_control_view.xml} is useful to customize the layout of
* StyledPlayerControlView throughout your application. It's also possible to customize the layout
* for a single instance in a layout file. This is achieved by setting the {@code
* controller_layout_id} attribute on a StyledPlayerControlView. This will cause the specified
* layout to be inflated instead of {@code exo_styled_player_control_view.xml} for only the instance
* on which the attribute is set.
*
* <p>You need to be careful when you set the {@code controller_layout_id}, because the default
* animation implementation expects certain relative positions between children.
*/ */
public class StyledPlayerControlView extends FrameLayout { public class StyledPlayerControlView extends FrameLayout {
......
...@@ -75,8 +75,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -75,8 +75,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
* during playback, and displays playback controls using a {@link StyledPlayerControlView}. * during playback, and displays playback controls using a {@link StyledPlayerControlView}.
* *
* <p>A StyledPlayerView can be customized by setting attributes (or calling corresponding methods), * <p>A StyledPlayerView can be customized by setting attributes (or calling corresponding methods),
* overriding drawables, overriding the view's layout file, or by specifying a custom view layout * or overriding drawables.
* file.
* *
* <h2>Attributes</h2> * <h2>Attributes</h2>
* *
...@@ -175,81 +174,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -175,81 +174,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
* The drawables used by {@link StyledPlayerControlView} (with its default layout file) can be * The drawables used by {@link StyledPlayerControlView} (with its default layout file) can be
* overridden by drawables with the same names defined in your application. See the {@link * overridden by drawables with the same names defined in your application. See the {@link
* StyledPlayerControlView} documentation for a list of drawables that can be overridden. * StyledPlayerControlView} documentation for a list of drawables that can be overridden.
*
* <h2>Overriding the layout file</h2>
*
* To customize the layout of StyledPlayerView throughout your app, or just for certain
* configurations, you can define {@code exo_styled_player_view.xml} layout files in your
* application {@code res/layout*} directories. These layouts will override the one provided by the
* library, and will be inflated for use by StyledPlayerView. The view identifies and binds its
* children by looking for the following ids:
*
* <ul>
* <li><b>{@code exo_content_frame}</b> - A frame whose aspect ratio is resized based on the video
* or album art of the media being played, and the configured {@code resize_mode}. The video
* surface view is inflated into this frame as its first child.
* <ul>
* <li>Type: {@link AspectRatioFrameLayout}
* </ul>
* <li><b>{@code exo_shutter}</b> - A view that's made visible when video should be hidden. This
* view is typically an opaque view that covers the video surface, thereby obscuring it when
* visible. Obscuring the surface in this way also helps to prevent flicker at the start of
* playback when {@code surface_type="surface_view"}.
* <ul>
* <li>Type: {@link View}
* </ul>
* <li><b>{@code exo_buffering}</b> - A view that's made visible when the player is buffering.
* This view typically displays a buffering spinner or animation.
* <ul>
* <li>Type: {@link View}
* </ul>
* <li><b>{@code exo_subtitles}</b> - Displays subtitles.
* <ul>
* <li>Type: {@link SubtitleView}
* </ul>
* <li><b>{@code exo_artwork}</b> - Displays album art.
* <ul>
* <li>Type: {@link ImageView}
* </ul>
* <li><b>{@code exo_error_message}</b> - Displays an error message to the user if playback fails.
* <ul>
* <li>Type: {@link TextView}
* </ul>
* <li><b>{@code exo_controller_placeholder}</b> - A placeholder that's replaced with the inflated
* {@link StyledPlayerControlView}. Ignored if an {@code exo_controller} view exists.
* <ul>
* <li>Type: {@link View}
* </ul>
* <li><b>{@code exo_controller}</b> - An already inflated {@link StyledPlayerControlView}. Allows
* use of a custom extension of {@link StyledPlayerControlView}. {@link
* StyledPlayerControlView} and {@link DefaultTimeBar} attributes set on the StyledPlayerView
* will not be automatically propagated through to this instance. If a view exists with this
* id, any {@code exo_controller_placeholder} view will be ignored.
* <ul>
* <li>Type: {@link StyledPlayerControlView}
* </ul>
* <li><b>{@code exo_ad_overlay}</b> - A {@link FrameLayout} positioned on top of the player which
* is used to show ad UI (if applicable).
* <ul>
* <li>Type: {@link FrameLayout}
* </ul>
* <li><b>{@code exo_overlay}</b> - A {@link FrameLayout} positioned on top of the player which
* the app can access via {@link #getOverlayFrameLayout()}, provided for convenience.
* <ul>
* <li>Type: {@link FrameLayout}
* </ul>
* </ul>
*
* <p>All child views are optional and so can be omitted if not required, however where defined they
* must be of the expected type.
*
* <h2>Specifying a custom layout file</h2>
*
* Defining your own {@code exo_styled_player_view.xml} is useful to customize the layout of
* StyledPlayerView throughout your application. It's also possible to customize the layout for a
* single instance in a layout file. This is achieved by setting the {@code player_layout_id}
* attribute on a StyledPlayerView. This will cause the specified layout to be inflated instead of
* {@code exo_styled_player_view.xml} for only the instance on which the attribute is set.
*/ */
public class StyledPlayerView extends FrameLayout implements AdViewProvider { public class StyledPlayerView extends FrameLayout implements AdViewProvider {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment