VLCMediaPlayer Class Reference

`#import <VLCMediaPlayer.h>`

Inheritance diagram for VLCMediaPlayer:

## Instance Methods

(instancetype) | - initWithVideoView:
(instancetype) | - initWithVideoLayer:
(instancetype) | - initWithOptions:
(instancetype) | - initWithLibVLCInstance:andLibrary:
(void) | - setVideoView:
(void) | - setVideoLayer:
(void) | - saveVideoSnapshotAt:withWidth:andHeight:
(void) | - setDeinterlaceFilter:
(float framesPerSecond) | - __attribute__
(BOOL) | - openVideoSubTitlesFromFile:
(typedef) | - NS_ENUM
(int) | - addPlaybackSlave:type:enforce:
(void) | - previousChapter
(void) | - nextChapter
(int) | - numberOfChaptersForTitle:
(NSArray *) | - chaptersForTitleIndex:
(NSArray *) | - chapterDescriptionsOfTitle:
(NSUInteger countOfTitles) | - __attribute__
(NSArray *titles) | - __attribute__
(void) | - resetEqualizerFromProfile:
(CGFloat) | - frequencyOfBandAtIndex:
(void) | - setAmplification:forBand:
(CGFloat) | - amplificationOfBand:
(void) | - play
(void) | - pause
(void) | - stop
(void) | - gotoNextFrame
(void) | - fastForward
(void) | - fastForwardAtRate:
(void) | - rewind
(void) | - rewindAtRate:
(void) | - jumpBackward:
(void) | - jumpForward:
(void) | - extraShortJumpBackward
(void) | - extraShortJumpForward
(void) | - shortJumpBackward
(void) | - shortJumpForward
(void) | - mediumJumpBackward
(void) | - mediumJumpForward
(void) | - longJumpBackward
(void) | - longJumpForward
(void) | - performNavigationAction:
(BOOL) | - updateViewpoint:pitch:roll:fov:absolute:

## Public Attributes

NSString *const | VLCChapterDescriptionName
NSString *const | VLCChapterDescriptionTimeOffset
NSString *const | VLCChapterDescriptionDuration
NSString *const | VLCTitleDescriptionDuration
NSString *const | VLCTitleDescriptionIsMenu

## Properties

VLCLibrary * | libraryInstance
id< VLCMediaPlayerDelegate > | delegate
id | drawable
char * | videoAspectRatio
char * | videoCropGeometry
float | scaleFactor
BOOL | adjustFilterEnabled
float | contrast
float | brightness
float | hue
float | saturation
float | gamma
float | rate
VLCAudio * | audio
CGSize | videoSize
BOOL | hasVideoOut
VLCTime * | time
VLCTime * | remainingTime
int | currentVideoTrackIndex
NSArray * | videoTrackNames
NSArray * | videoTrackIndexes
int | numberOfVideoTracks
int | currentVideoSubTitleIndex
NSArray * | videoSubTitlesNames
NSArray * | videoSubTitlesIndexes
int | numberOfSubtitlesTracks
NSInteger | currentVideoSubTitleDelay
int | currentChapterIndex
int | currentTitleIndex
int | numberOfTitles
NSString *const | VLCTitleDescriptionName
NSArray * | titleDescriptions
int | indexOfLongestTitle
int | currentAudioTrackIndex
NSArray * | audioTrackNames
NSArray * | audioTrackIndexes
int | numberOfAudioTracks
int | audioChannel
NSInteger | currentAudioPlaybackDelay
NSArray * | equalizerProfiles
BOOL | equalizerEnabled
CGFloat | preAmplification
unsigned | numberOfBands
VLCMedia * | media
BOOL | playing
BOOL | willPlay
VLCMediaPlayerState | state
float | position
BOOL | seekable
BOOL | canPause

## Detailed Description

The player base class needed to do any playback

## Method Documentation

## __attribute__() [1/3]

- (float framesPerSecond) __attribute__ |  | ((deprecated)) |  |

Frames per second

Deprecated:
  provided for API compatibility only, to retrieve a media's FPS, use VLCMediaTracksInformationFrameRate.

Returns
  0

Implemented in VLCStreamSession, VLCStreamSession, and VLCStreamSession.

## __attribute__() [2/3]

- (NSUInteger countOfTitles) __attribute__ |  | ((deprecated)) |  |

count of titles

Deprecated:
  Use numberOfTitles instead

Implemented in VLCStreamSession, VLCStreamSession, and VLCStreamSession.

## __attribute__() [3/3]

- (NSArray* titles) __attribute__ |  | ((deprecated)) |  |

array of available titles

Deprecated:
  Use titleDescriptions instead

Implemented in VLCStreamSession, VLCStreamSession, and VLCStreamSession.

## addPlaybackSlave:type:enforce:()

- (int) addPlaybackSlave: |  | (NSURL *) | slaveURL
type: |  | (VLCMediaPlaybackSlaveType) | slaveType
enforce: |  | (BOOL) | enforceSelection

Add additional input sources to a playing media item This way, you can add subtitles or audio files to an existing input stream For the user, it will appear as if they were part of the existing stream

Parameters

  slaveURL | of the content to be added
  slaveType | content type
  enforceSelection | switch to the added accessory content

## amplificationOfBand:()

- (CGFloat) amplificationOfBand: |  | (unsigned) | index |

amplification of band

Parameters

  index | of the band

Returns
  current amplification value (clamped to the -20.0 to +20.0 range)

## chapterDescriptionsOfTitle:()

- (NSArray *) chapterDescriptionsOfTitle: |  | (int) | titleIndex |

chapter descriptions an array of all chapters of the given title including information about chapter name, time offset and duration

Note
  if no title value is provided, information about the chapters of the current title is returned

Returns
  array describing the titles in details

See also
  VLCChapterDescriptionName
  VLCChapterDescriptionTimeOffset
  VLCChapterDescriptionDuration

## chaptersForTitleIndex:()

- (NSArray *) chaptersForTitleIndex: |  | ((deprecated)) | __attribute__ |

Chapters of a given title index

Deprecated:
  Use chapterDescriptionsOfTitle instead

## extraShortJumpBackward()

- (void) extraShortJumpBackward |  |  |

Jumps shortly backward in current stream if seeking is supported.

## extraShortJumpForward()

- (void) extraShortJumpForward |  |  |

Jumps shortly forward in current stream if seeking is supported.

## fastForward()

- (void) fastForward |  |  |

Fast forwards through the feed at the standard 1x rate.

## fastForwardAtRate:()

- (void) fastForwardAtRate: |  | (float) | rate |

Fast forwards through the feed at the rate specified.

Parameters

  rate | Rate at which the feed should be fast forwarded.

## frequencyOfBandAtIndex:()

- (CGFloat) frequencyOfBandAtIndex: |  | (unsigned) | index |

frequency of equalizer band

Parameters

  index | the band index

Returns
  frequency of the requested equalizer band

## gotoNextFrame()

- (void) gotoNextFrame |  |  |

Advance one frame.

## initWithLibVLCInstance:andLibrary:()

- (instancetype) initWithLibVLCInstance: |  | (void *) | playerInstance
andLibrary: |  | (VLCLibrary *) | library

initialize player with a certain libvlc instance and VLCLibrary

Parameters

  playerInstance | the libvlc instance
  library | the library instance

Note
  This is an advanced initializer for very specialized environments

## initWithOptions:()

- (instancetype) initWithOptions: |  | (NSArray *) | options |

initialize player with a given set of options

Parameters

  options | an array of private options

Note
  This will allocate a new libvlc and VLCLibrary instance, which will have a memory impact

## initWithVideoLayer:()

- (instancetype) initWithVideoLayer: |  | (VLCVideoLayer *) | aVideoLayer |

initialize player with a given video layer

Parameters

  aVideoLayer | an instance of VLCVideoLayer

Note
  This initializer is for macOS only

## initWithVideoView:()

- (instancetype) initWithVideoView: |  | (VLCVideoView *) | aVideoView |

initialize player with a given video view

Parameters

  aVideoView | an instance of VLCVideoView

Note
  This initializer is for macOS only

## jumpBackward:()

- (void) jumpBackward: |  | (int) | interval |

Jumps shortly backward in current stream if seeking is supported.

Parameters

  interval | to skip, in sec.

## jumpForward:()

- (void) jumpForward: |  | (int) | interval |

Jumps shortly forward in current stream if seeking is supported.

Parameters

  interval | to skip, in sec.

## longJumpBackward()

- (void) longJumpBackward |  |  |

Jumps shortly backward in current stream if seeking is supported.

## longJumpForward()

- (void) longJumpForward |  |  |

Jumps shortly forward in current stream if seeking is supported.

## mediumJumpBackward()

- (void) mediumJumpBackward |  |  |

Jumps shortly backward in current stream if seeking is supported.

## mediumJumpForward()

- (void) mediumJumpForward |  |  |

Jumps shortly forward in current stream if seeking is supported.

## nextChapter()

- (void) nextChapter |  |  |

switch to the next chapter

## NS_ENUM()

- (typedef) NS_ENUM |  | (unsigned) |
|  | (VLCMediaPlaybackSlaveType) |

VLCMediaPlaybackNavigationAction describes actions which can be performed to navigate an interactive title

## numberOfChaptersForTitle:()

- (int) numberOfChaptersForTitle: |  | (int) | titleIndex |

returns the number of chapters for a given title

Parameters

  titleIndex | the index of the title you are requesting the chapters for

## openVideoSubTitlesFromFile:()

- (BOOL) openVideoSubTitlesFromFile: |  | ((deprecated)) | __attribute__ |

Load and set a specific video subtitle, from a file.

Deprecated:
  use addPlaybackSlave:type:enforce: instead

## pause()

- (void) pause |  |  |

Set the pause state of the feed. Do nothing if already paused.

## performNavigationAction:()

- (void) performNavigationAction: |  | (VLCMediaPlaybackNavigationAction) | action |

performs navigation actions on interactive titles

## play()

- (void) play |  |  |

Plays a media resource using the currently selected media controller (or default controller. If feed was paused then the feed resumes at the position it was paused in.

## previousChapter()

- (void) previousChapter |  |  |

switch to the previous chapter

## resetEqualizerFromProfile:()

- (void) resetEqualizerFromProfile: |  | (unsigned) | profile |

Re-set the equalizer to a profile retrieved from the list

Note
  This doesn't enable the Equalizer automagically

## rewind()

- (void) rewind |  |  |

Rewinds through the feed at the standard 1x rate.

## rewindAtRate:()

- (void) rewindAtRate: |  | (float) | rate |

Rewinds through the feed at the rate specified.

Parameters

  rate | Rate at which the feed should be fast rewound.

## saveVideoSnapshotAt:withWidth:andHeight:()

- (void) saveVideoSnapshotAt: |  | (NSString *) | path
withWidth: |  | (int) | width
andHeight: |  | (int) | height

Take a snapshot of the current video.

If width AND height is 0, original size is used. If width OR height is 0, original aspect-ratio is preserved.

Parameters

  path | the path where to save the screenshot to
  width | the snapshot's width
  height | the snapshot's height

## setAmplification:forBand:()

- (void) setAmplification: |  | (CGFloat) | amplification
forBand: |  | (unsigned) | index

set amplification for band

Parameters

  amplification | value (clamped to the -20.0 to +20.0 range)
  index | of the respective band

## setDeinterlaceFilter:()

- (void) setDeinterlaceFilter: |  | (NSString *) | name |

Enable or disable deinterlace filter

Parameters

  name | of deinterlace filter to use (availability depends on underlying VLC version), NULL to disable.

## setVideoLayer:()

- (void) setVideoLayer: |  | (VLCVideoLayer *) | aVideoLayer |

set a video layer for rendering

Parameters

  aVideoLayer | instance of VLCVideoLayer

Note
  This setter is macOS only

## setVideoView:()

- (void) setVideoView: |  | (VLCVideoView *) | aVideoView |

set a video view for rendering

Parameters

  aVideoView | instance of VLCVideoView

Note
  This setter is macOS only

## shortJumpBackward()

- (void) shortJumpBackward |  |  |

Jumps shortly backward in current stream if seeking is supported.

## shortJumpForward()

- (void) shortJumpForward |  |  |

Jumps shortly forward in current stream if seeking is supported.

## stop()

- (void) stop |  |  |

Stop the playing.

## updateViewpoint:pitch:roll:fov:absolute:()

- (BOOL) updateViewpoint: |  | (CGFloat) | yaw
pitch: |  | (CGFloat) | pitch
roll: |  | (CGFloat) | roll
fov: |  | (CGFloat) | fov
absolute: |  | (BOOL) | absolute

Updates viewpoint with given values.

Parameters

  yaw | new yaw.
  pitch | new pitch.
  roll | new roll.
  fov | new field of view.
  absolute | if true replace the old viewpoint with the new one. If false, increase/decrease it.

Note
  This will create a viewpoint instance if not present.

## Member Data Documentation

## VLCChapterDescriptionDuration

- (NSString* const) VLCChapterDescriptionDuration

dictionary value for the chapter's duration

## VLCChapterDescriptionName

- (NSString* const) VLCChapterDescriptionName

dictionary value for the user-facing chapter name

## VLCChapterDescriptionTimeOffset

- (NSString* const) VLCChapterDescriptionTimeOffset

dictionary value for the chapter's time offset

## VLCTitleDescriptionDuration

- (NSString* const) VLCTitleDescriptionDuration

dictionary value for the title's duration

## VLCTitleDescriptionIsMenu

- (NSString* const) VLCTitleDescriptionIsMenu

dictionary value whether the title is a menu or not

## Property Documentation

## adjustFilterEnabled

- (BOOL) adjustFilterEnabled

readwritenonatomicassign

Enable or disable adjust video filter (contrast, brightness, hue, saturation, gamma)

Returns
  bool value

## audio

- (VLCAudio*) audio

readnonatomicweak

an audio controller object

Returns
  instance of VLCAudio

## audioChannel

- (int) audioChannel

readwriteatomicassign

sets / returns the current audio channel

Returns
  the currently set audio channel

## audioTrackIndexes

- (NSArray*) audioTrackIndexes

readatomiccopy

Returns the audio track IDs those are needed to set the video index

## audioTrackNames

- (NSArray*) audioTrackNames

readatomiccopy

Returns the audio track names, usually a language name or a description It includes the "Disabled" fake track at index 0.

## brightness

- (float) brightness

readwritenonatomicassign

Set/Get the adjust filter's brightness value

Returns
  float value (range: 0-2, default: 1.0)

## canPause

- (BOOL) canPause

readatomicassign

property whether the currently playing media can be paused (or not)

Returns
  BOOL value

## contrast

- (float) contrast

readwritenonatomicassign

Set/Get the adjust filter's contrast value

Returns
  float value (range: 0-2, default: 1.0)

## currentAudioPlaybackDelay

- (NSInteger) currentAudioPlaybackDelay

readwriteatomicassign

Get the current audio delay. Positive values means audio is delayed further, negative values less.

Returns
  time (in microseconds) the audio playback is being delayed

## currentAudioTrackIndex

- (int) currentAudioTrackIndex

readwriteatomicassign

Return the current audio track index

Returns
  0 if none is set.

Pass -1 to disable.

## currentChapterIndex

- (int) currentChapterIndex

readwriteatomicassign

Chapter selection and enumeration, it is bound to a title option. Return the current chapter index, or

Returns
  NSNotFound if none is set.

## currentTitleIndex

- (int) currentTitleIndex

readwriteatomicassign

Title selection and enumeration

Returns
  NSNotFound if none is set.

## currentVideoSubTitleDelay

- (NSInteger) currentVideoSubTitleDelay

readwriteatomicassign

Get the current subtitle delay. Positive values means subtitles are being displayed later, negative values earlier.

Returns
  time (in microseconds) the display of subtitles is being delayed

## currentVideoSubTitleIndex

- (int) currentVideoSubTitleIndex

readwriteatomicassign

Return the current video subtitle index

Returns
  0 if none is set.

Pass -1 to disable.

## currentVideoTrackIndex

- (int) currentVideoTrackIndex

readwriteatomicassign

Return the current video track index

Returns
  0 if none is set.

Pass -1 to disable.

## delegate

- (id<VLCMediaPlayerDelegate>) delegate

readwritenonatomicweak

the delegate object implementing the optional protocol

## drawable

- (id) drawable

readwriteatomicstrong

set/retrieve a video view for rendering This can be any UIView or NSView or instances of VLCVideoView / VLCVideoLayer if running on macOS

## equalizerEnabled

- (BOOL) equalizerEnabled

readwriteatomicassign

Toggle equalizer state param: bool value to enable/disable the equalizer

Returns
  current state

## equalizerProfiles

- (NSArray*) equalizerProfiles

readatomicweak

Get a list of available equalizer profiles

Note
  Current versions do not allow the addition of further profiles so you need to handle this in your app.

Returns
  array of equalizer profiles

## gamma

- (float) gamma

readwritenonatomicassign

Set/Get the adjust filter's gamma value

Returns
  float value (range: 0-10, default: 1.0)

## hasVideoOut

- (BOOL) hasVideoOut

readatomicassign

Does the current media have a video output?

Note
  a false return value doesn't mean that the video doesn't have any video
  tracks. Those might just be disabled.

Returns
  current video output status

## hue

- (float) hue

readwritenonatomicassign

Set/Get the adjust filter's hue value

Returns
  float value (range: -180-180, default: 0.)

## indexOfLongestTitle

- (int) indexOfLongestTitle

readatomicassign

the title with the longest duration

Returns
  int matching the title index

## libraryInstance

- (VLCLibrary*) libraryInstance

readnonatomicassign

the library instance in use by the player instance

## media

- (VLCMedia*) media

readwriteatomicstrong

The currently media instance set to play

## numberOfAudioTracks

- (int) numberOfAudioTracks

readatomicassign

returns the number of audio tracks available in the current media

Returns
  number of tracks

## numberOfBands

- (unsigned) numberOfBands

readatomicassign

Number of equalizer bands

Returns
  the number of equalizer bands available in the current release

## numberOfSubtitlesTracks

- (int) numberOfSubtitlesTracks

readatomicassign

returns the number of SPU tracks available in the current media

Returns
  number of tracks

## numberOfTitles

- (int) numberOfTitles

readatomicassign

number of titles available for the current media

Returns
  the number of titles

## numberOfVideoTracks

- (int) numberOfVideoTracks

readatomicassign

returns the number of video tracks available in the current media

Returns
  number of tracks

## playing

- (BOOL) playing

readatomicassign

Playback state flag identifying that the stream is currently playing.

Returns
  TRUE if the feed is playing, FALSE if otherwise.

## position

- (float) position

readwriteatomicassign

Returns the receiver's position in the reading.

Returns
  movie position as percentage between 0.0 and 1.0.

## preAmplification

- (CGFloat) preAmplification

readwriteatomicassign

Set amplification level param: The supplied amplification value will be clamped to the -20.0 to +20.0 range.

Note
  this will create and enabled an Equalizer instance if not present

Returns
  current amplification level

## rate

- (float) rate

readwritenonatomicassign

Get the requested movie play rate.

Warning
  Depending on the underlying media, the requested rate may be different from the real playback rate. Due to limitations of some protocols this option may not be taken into account at all, if set.

Returns
  movie play rate

## remainingTime

- (VLCTime*) remainingTime

readnonatomicweak

Returns the current position (or time) of the feed, inversed if a duration is available

Returns
  VLCTime object with requested time

Note
  VLCTime will be a nullTime if no duration can be calculated for the current input

## saturation

- (float) saturation

readwritenonatomicassign

Set/Get the adjust filter's saturation value

Returns
  float value (range: 0-3, default: 1.0)

## scaleFactor

- (float) scaleFactor

readwritenonatomicassign

Set/Get the current video scaling factor. That is the ratio of the number of pixels on screen to the number of pixels in the original decoded video in each dimension. Zero is a special value; it will adjust the video to the output window/drawable (in windowed mode) or the entire screen.

param: relative scale factor as float

## seekable

- (BOOL) seekable

readatomicassign

Set movie position. This has no effect if playback is not enabled.

Note
  movie position as percentage between 0.0 and 1.0.

## state

- (VLCMediaPlayerState) state

readatomicassign

Playback's current state.

See also
  VLCMediaState

## time

- (VLCTime*) time

readwriteatomicstrong

Sets the current position (or time) of the feed.

Parameters

  value | New time to set the current position to. If time is [VLCTime nullTime], 0 is assumed. Returns the current position (or time) of the feed.

Returns
  VLCTime object with current time.

## titleDescriptions

- (NSArray*) titleDescriptions

readatomiccopy

title descriptions an array of all titles of the current media including information of name, duration and potential menu state

Returns
  array describing the titles in details

See also
  VLCTitleDescriptionName
  VLCTitleDescriptionDuration
  VLCTitleDescriptionIsMenu

## videoAspectRatio

- (char*) videoAspectRatio

readwriteatomicassign

Set/Get current video aspect ratio.

param: psz_aspect new video aspect-ratio or NULL to reset to default

Note
  Invalid aspect ratios are ignored.

Returns
  the video aspect ratio or NULL if unspecified (the result must be released with free()).

## videoCropGeometry

- (char*) videoCropGeometry

readwriteatomicassign

Set/Get current crop filter geometry.

param: psz_geometry new crop filter geometry (NULL to unset)

Returns
  the crop filter geometry or NULL if unset

## videoSize

- (CGSize) videoSize

readatomicassign

Get the current video size

Returns
  video size as CGSize

## videoSubTitlesIndexes

- (NSArray*) videoSubTitlesIndexes

readatomiccopy

Returns the video subtitle track IDs those are needed to set the video subtitle index

## videoSubTitlesNames

- (NSArray*) videoSubTitlesNames

readatomiccopy

Returns the video subtitle track names, usually a language name or a description It includes the "Disabled" fake track at index 0.

## videoTrackIndexes

- (NSArray*) videoTrackIndexes

readatomiccopy

Returns the video track IDs those are needed to set the video index

## videoTrackNames

- (NSArray*) videoTrackNames

readatomiccopy

Returns the video track names, usually a language name or a description It includes the "Disabled" fake track at index 0.

## VLCTitleDescriptionName

- (NSString* const) VLCTitleDescriptionName

dictionary value for the user-facing title name

## willPlay

- (BOOL) willPlay

readatomicassign

Playback state flag identifying wheather the stream will play.

Returns
  TRUE if the feed is ready for playback, FALSE if otherwise.

The documentation for this class was generated from the following file:

- Headers/Public/VLCMediaPlayer.h