> ## Documentation Index
> Fetch the complete documentation index at: https://cloudinary.com/documentation/llms.txt
> Use this file to discover all available pages before exploring further.

# Android video player


The Android SDK includes a Cloudinary native video player based on [ExoPlayer](https://exoplayer.dev/). This makes it easy to use the various Cloudinary video capabilities and deliver your videos, as well as capturing [video analytics](video_analytics) by default.

To create a player, use the `CldVideoPlayer` class to initialize it, providing either the public ID for the video or the full Cloudinary URL:

```android
//Public ID
CldVideoPlayer player = new CldVideoPlayer(this,"dog");

//URL 
CldVideoPlayer player = new CldVideoPlayer(this,"https://res.cloudinary.com/demo/video/upload/sp_auto/dog.m3u8");


```

Once you have the player instance, you can add that into a view.

Here's an example:

```android
CldVideoPlayer player = new CldVideoPlayer(this,"dog");
binding.playerView.setPlayer(player.getPlayer());

```

> **NOTE**: As the `CldVideoPlayer` is a container for the actual ExoPlayer instance, you need to call the `getPlayer()` method (as shown in the example) to include it in the view.

## Transformations

You can include video transformations as part of your `CLDVideoPlayer` instance in the same way as when using the [url](android_video_manipulation#deliver_videos) method. The transformations are defined when initializing the player. For example:

```android
CldVideoPlayer player = new CldVideoPlayer(this,"dog", new Transformation().effect("loop"));
```

> **NOTE**: [Automatic streaming profile selection](adaptive_bitrate_streaming#automatic_streaming_profile_selection) is disabled by default. To enable it, set the streaming profile transformation to `auto` when initializing your player, for example:

  ```android
  CldVideoPlayer player = new CldVideoPlayer(this, "dog.m3u8", new Transformation().streamingProfile("auto"));

  ```

This feature currently has a [limited set of transformations](adaptive_bitrate_streaming#combining_transformations_with_automatic_streaming_profile_selection) that you can combine with it, therefore when using any transformations ensure that they are compatible before including with automatic streaming profile selection enabled.

## Analytics

By default, Cloudinary [video analytics](video_analytics) are enabled when using the Cloudinary native video player. This automatically sends a variety of metrics to Cloudinary to allow you to assess the performance of your video assets. Use the `setAnalytics` function of your player instance to switch to manual collection or disable the analytics entirely. Manual collection allows you to specify a cloud name or public ID instead of the player automatically detecting this.

For example:

```android
player.setAnalytics(AnalyticsType.MANUAL, "demo", "sea_turtle");
```

or to disable:

```android
player.setAnalytics(AnalyticsType.DISABLED, null, null);
```

