Programmable Media

iOS video player

Last updated: Mar-20-2024

The iOS SDK includes a Cloudinary native video player based on AVPlayer. This makes it easy to use the various Cloudinary video capabilities and deliver your videos as well as capturing video analytics by default.

On this page:

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

Once you have the player instance, you can embed that into an AVPlayerViewController to use in your view.

Here's an example:

Transformations

You can include video transformations as part of your CLDVideoPlayer instance in the same way as when using the createUrl method. The transformations are defined when initializing the player. For example:

Note

Automatic streaming profile selection is disabled by default. To enable it, set the automaticStreamingProfile parameter to true when initializing the player. For example:

This feature currently has a limited set of transformations 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 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:

or to disable:

Help us improve our SDK
We'd love to hear your thoughts on using our iOS SDK. Please take a moment to complete this short survey.
Thanks for your time!

✔️ Feedback sent!

Rate this page: