Skip to content
Product Documentation

Customizing the Player on iOS

The ArcMediaPlayerView can be customized to fit your app’s UI design and features. You can get it from the ArcMediaPlayerViewController’s playerView property.

Buttons

The default button icons are sourced from Icons8 and free to use. The default icons use the IOS Glyphs Style, have a size of 30x30, and have light and dark mode versions. You can use your own icons instead, but keep in mind that if they’re not the same size, the player’s layout will be affected.

Some buttons can be hidden, but unless otherwise specified, the order the buttons appear in, and their positions in the view, cannot be changed.

NameTypeDescription
closedCaptionsButtonUIButtonToggles closed-captioning (if available) on and off.
controlBarPlayButtonUIButtonToggles between playing and pausing the video. The Play icon is used in the button’s .default state, while the Pause icon is used in its .selected state.
fullScreenButtonUIButtonToggles the player between full screen and the its original size and location.
goBackwardButtonUIButtonSkips to the beginning of the video, or rewinds if pressed continuously.
goForwardButtonUIButtonSkips to the end of the video (or the next video), or fast-forwards if pressed continuously.
skipBackwardButtonUIButtonRewinds the video by a certain number of seconds.

playerViewController.playerView.skipBackwardButton.setImage(UIImage(named: “back-60-seconds”), for: .normal) playerViewController.goBackwardInterval = CMTime(seconds: -60.0, preferredTimescale: 1)
skipForwardButtonUIButtonSkips the video ahead by a certain number of seconds.


playerViewController.playerView.skipBackwardButton.setImage(UIImage(named: “forward-20-seconds”), for: .normal) playerViewController.goBackwardInterval = CMTime(seconds: 20.0, preferredTimescale: 1)
useSkipBackwardButtonBoolWhether the skipBackwardButton will be displayed, even if the current video allows skipping.
useSkipForwardButtonBoolWhether the skipForwardButton will be displayed, even if the current video allows skipping.
volumeButtonUIButtonPops up a volume slider. (See mpVolumeView, below.)
Note: The icons used for the various volume levels are not currently customizable.

Labels

NameTypeDescription
timeElapsedLabelUILabelShows the video’s elapsed time.
There are two formats that are used for the times: one with, and one without, the hours. (If alwaysShowHours is true, then the format with hours is always used.)
timeRemainingLabelUILabelShows the video’s remaining time. If the video is a livestream, then the label will display “LIVE” instead of a time.
There are two formats that are used for the times: one with, and one without, the hours. (If alwaysShowHours is true, then the format with hours is always used.)
alwaysShowHoursBoolSet this to true if the time-elapsed & time-remaining labels should always show the hours field. The default is false.
durationFormatStringThe format string for the time-elapsed & time-remaining labels when the time is less than one hour. The default is mm:ss. Examples are 31:20 or 04:32. It should not be prefixed with a “-”, as that’s added automatically by the player.
durationFormatWithHoursStringThe format string for the time-elapsed/time-remaining label when the time one hour or greater. The default is H:mm:ss. Examples are 1:31:20 or 2:04:32. It should not be prefixed with a “-”, as that’s added automatically by the player.

Captions

The ArcMediaPlayerView supports captions in two different ways:

  • Embedded in the video stream
  • Listed in an associated Video Text Track (VTT) file

The appearance and behavior of embedded captions is determined by the operation system or app’s accessibility settings, and are not customizable directly in the ArcMediaPlayerView.

VTT captions are customizable using the following properties:

NameTypeDescription
closedCaptionsButtonUIButtonToggles closed-captioning (if available) on and off.
clientSideCaptionTextColorUIColorThe text color for the client-side caption overlay text. The default value is UIColor.white. The color should contrast with the clientSideCaptionTextShadowColor so that it will show up clearly, no matter what the underlying video content looks like.
clientSideCaptionTextShadowColorUIColorThe text color for the client-side caption overlay text shadow. On iOS, this defaults to UIColor.darkText, but since that property isn’t available on tvOS, the tvOS default is .white. The color should contrast with the clientSideCaptionTextColor so that it will show up clearly, no matter what the underlying video content looks like.

Other Controls & Views

NameTypeDescription
controlBarUIViewThe overlay that displays the playback controls. It cannot be positioned elsewhere inside or outside the view, but its behavior can be customized.
mpVolumeView:MPVolumeViewThe volume slider that appears when the volumeButton is toggled. Note: this appears only on iOS devices, not on the simulator.
secondsBeforeControlBarHidesDoubleThe number of seconds that the control bar is visible after playback starts. If it’s nil, then no timer will be set. Instead, you must call ArcMediaPlayerView.showControlBar() and hideControlBar() manually.