VLCMediaPlayer.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. /*****************************************************************************
  2. * VLCMediaPlayer.h: VLCKit.framework VLCMediaPlayer header
  3. *****************************************************************************
  4. * Copyright (C) 2007-2009 Pierre d'Herbemont
  5. * Copyright (C) 2007-2015 VLC authors and VideoLAN
  6. * Copyright (C) 2009-2015 Felix Paul Kühne
  7. * $Id$
  8. *
  9. * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
  10. * Felix Paul Kühne <fkuehne # videolan.org>
  11. * Soomin Lee <TheHungryBu # gmail.com>
  12. *
  13. * This program is free software; you can redistribute it and/or modify it
  14. * under the terms of the GNU Lesser General Public License as published by
  15. * the Free Software Foundation; either version 2.1 of the License, or
  16. * (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Lesser General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Lesser General Public License
  24. * along with this program; if not, write to the Free Software Foundation,
  25. * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  26. *****************************************************************************/
  27. #import <Foundation/Foundation.h>
  28. #if TARGET_OS_IPHONE
  29. # import <CoreGraphics/CoreGraphics.h>
  30. # import <UIKit/UIKit.h>
  31. #endif
  32. #import "VLCMedia.h"
  33. #import "VLCTime.h"
  34. #import "VLCAudio.h"
  35. #if !TARGET_OS_IPHONE
  36. @class VLCVideoView;
  37. @class VLCVideoLayer;
  38. #endif
  39. @class VLCLibrary;
  40. @class VLCRendererItem;
  41. /* Notification Messages */
  42. extern NSString *const VLCMediaPlayerTimeChanged;
  43. extern NSString *const VLCMediaPlayerStateChanged;
  44. extern NSString *const VLCMediaPlayerTitleChanged;
  45. extern NSString *const VLCMediaPlayerChapterChanged;
  46. /**
  47. * VLCMediaPlayerState describes the state of the media player.
  48. */
  49. typedef NS_ENUM(NSInteger, VLCMediaPlayerState)
  50. {
  51. VLCMediaPlayerStateStopped, ///< Player has stopped
  52. VLCMediaPlayerStateOpening, ///< Stream is opening
  53. VLCMediaPlayerStateBuffering, ///< Stream is buffering
  54. VLCMediaPlayerStateEnded, ///< Stream has ended
  55. VLCMediaPlayerStateError, ///< Player has generated an error
  56. VLCMediaPlayerStatePlaying, ///< Stream is playing
  57. VLCMediaPlayerStatePaused, ///< Stream is paused
  58. VLCMediaPlayerStateESAdded ///< Elementary Stream added
  59. };
  60. /**
  61. * VLCMediaPlaybackNavigationAction describes actions which can be performed to navigate an interactive title
  62. */
  63. typedef NS_ENUM(unsigned, VLCMediaPlaybackNavigationAction)
  64. {
  65. VLCMediaPlaybackNavigationActionActivate = 0,
  66. VLCMediaPlaybackNavigationActionUp,
  67. VLCMediaPlaybackNavigationActionDown,
  68. VLCMediaPlaybackNavigationActionLeft,
  69. VLCMediaPlaybackNavigationActionRight
  70. };
  71. /**
  72. * Returns the name of the player state as a string.
  73. * \param state The player state.
  74. * \return A string containing the name of state. If state is not a valid state, returns nil.
  75. */
  76. extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
  77. /**
  78. * Formal protocol declaration for playback delegates. Allows playback messages
  79. * to be trapped by delegated objects.
  80. */
  81. @protocol VLCMediaPlayerDelegate
  82. @optional
  83. /**
  84. * Sent by the default notification center whenever the player's state has changed.
  85. * \details Discussion The value of aNotification is always an VLCMediaPlayerStateChanged notification. You can retrieve
  86. * the VLCMediaPlayer object in question by sending object to aNotification.
  87. */
  88. - (void)mediaPlayerStateChanged:(NSNotification *)aNotification;
  89. /**
  90. * Sent by the default notification center whenever the player's time has changed.
  91. * \details Discussion The value of aNotification is always an VLCMediaPlayerTimeChanged notification. You can retrieve
  92. * the VLCMediaPlayer object in question by sending object to aNotification.
  93. */
  94. - (void)mediaPlayerTimeChanged:(NSNotification *)aNotification;
  95. /**
  96. * Sent by the default notification center whenever the player's title has changed (if any).
  97. * \details Discussion The value of aNotification is always an VLCMediaPlayerTitleChanged notification. You can retrieve
  98. * the VLCMediaPlayer object in question by sending object to aNotification.
  99. * \note this is about a title in the navigation sense, not about metadata
  100. */
  101. - (void)mediaPlayerTitleChanged:(NSNotification *)aNotification;
  102. /**
  103. * Sent by the default notification center whenever the player's chapter has changed (if any).
  104. * \details Discussion The value of aNotification is always an VLCMediaPlayerChapterChanged notification. You can retrieve
  105. * the VLCMediaPlayer object in question by sending object to aNotification.
  106. */
  107. - (void)mediaPlayerChapterChanged:(NSNotification *)aNotification;
  108. /**
  109. * Sent by the default notification center whenever a new snapshot is taken.
  110. * \details Discussion The value of aNotification is always an VLCMediaPlayerSnapshotTaken notification. You can retrieve
  111. * the VLCMediaPlayer object in question by sending object to aNotification.
  112. */
  113. - (void)mediaPlayerSnapshot:(NSNotification *)aNotification;
  114. @end
  115. /**
  116. * The player base class needed to do any playback
  117. */
  118. @interface VLCMediaPlayer : NSObject
  119. /**
  120. * the library instance in use by the player instance
  121. */
  122. @property (nonatomic, readonly) VLCLibrary *libraryInstance;
  123. /**
  124. * the delegate object implementing the optional protocol
  125. */
  126. @property (weak, nonatomic) id<VLCMediaPlayerDelegate> delegate;
  127. #if !TARGET_OS_IPHONE
  128. /* Initializers */
  129. /**
  130. * initialize player with a given video view
  131. * \param aVideoView an instance of VLCVideoView
  132. * \note This initializer is for macOS only
  133. */
  134. - (instancetype)initWithVideoView:(VLCVideoView *)aVideoView;
  135. /**
  136. * initialize player with a given video layer
  137. * \param aVideoLayer an instance of VLCVideoLayer
  138. * \note This initializer is for macOS only
  139. */
  140. - (instancetype)initWithVideoLayer:(VLCVideoLayer *)aVideoLayer;
  141. #endif
  142. /**
  143. * initialize player with a given set of options
  144. * \param options an array of private options
  145. * \note This will allocate a new libvlc and VLCLibrary instance, which will have a memory impact
  146. */
  147. - (instancetype)initWithOptions:(NSArray *)options;
  148. /**
  149. * initialize player with a certain libvlc instance and VLCLibrary
  150. * \param playerInstance the libvlc instance
  151. * \param library the library instance
  152. * \note This is an advanced initializer for very specialized environments
  153. */
  154. - (instancetype)initWithLibVLCInstance:(void *)playerInstance andLibrary:(VLCLibrary *)library;
  155. /* Video View Options */
  156. // TODO: Should be it's own object?
  157. #pragma mark -
  158. #pragma mark video functionality
  159. #if !TARGET_OS_IPHONE
  160. /**
  161. * set a video view for rendering
  162. * \param aVideoView instance of VLCVideoView
  163. * \note This setter is macOS only
  164. */
  165. - (void)setVideoView:(VLCVideoView *)aVideoView;
  166. /**
  167. * set a video layer for rendering
  168. * \param aVideoLayer instance of VLCVideoLayer
  169. * \note This setter is macOS only
  170. */
  171. - (void)setVideoLayer:(VLCVideoLayer *)aVideoLayer;
  172. #endif
  173. /**
  174. * set/retrieve a video view for rendering
  175. * This can be any UIView or NSView or instances of VLCVideoView / VLCVideoLayer if running on macOS
  176. */
  177. @property (strong) id drawable; /* The videoView or videoLayer */
  178. /**
  179. * Set/Get current video aspect ratio.
  180. *
  181. * param: psz_aspect new video aspect-ratio or NULL to reset to default
  182. * \note Invalid aspect ratios are ignored.
  183. * \return the video aspect ratio or NULL if unspecified
  184. * (the result must be released with free()).
  185. */
  186. @property (NS_NONATOMIC_IOSONLY) char *videoAspectRatio;
  187. /**
  188. * Set/Get current crop filter geometry.
  189. *
  190. * param: psz_geometry new crop filter geometry (NULL to unset)
  191. * \return the crop filter geometry or NULL if unset
  192. */
  193. @property (NS_NONATOMIC_IOSONLY) char *videoCropGeometry;
  194. /**
  195. * Set/Get the current video scaling factor.
  196. * That is the ratio of the number of pixels on
  197. * screen to the number of pixels in the original decoded video in each
  198. * dimension. Zero is a special value; it will adjust the video to the output
  199. * window/drawable (in windowed mode) or the entire screen.
  200. *
  201. * param: relative scale factor as float
  202. */
  203. @property (nonatomic) float scaleFactor;
  204. /**
  205. * Take a snapshot of the current video.
  206. *
  207. * If width AND height is 0, original size is used.
  208. * If width OR height is 0, original aspect-ratio is preserved.
  209. *
  210. * \param path the path where to save the screenshot to
  211. * \param width the snapshot's width
  212. * \param height the snapshot's height
  213. */
  214. - (void)saveVideoSnapshotAt:(NSString *)path withWidth:(int)width andHeight:(int)height;
  215. /**
  216. * Enable or disable deinterlace filter
  217. *
  218. * \param name of deinterlace filter to use (availability depends on underlying VLC version), NULL to disable.
  219. */
  220. - (void)setDeinterlaceFilter: (NSString *)name;
  221. /**
  222. * Enable or disable adjust video filter (contrast, brightness, hue, saturation, gamma)
  223. *
  224. * \return bool value
  225. */
  226. @property (nonatomic) BOOL adjustFilterEnabled;
  227. /**
  228. * Set/Get the adjust filter's contrast value
  229. *
  230. * \return float value (range: 0-2, default: 1.0)
  231. */
  232. @property (nonatomic) float contrast;
  233. /**
  234. * Set/Get the adjust filter's brightness value
  235. *
  236. * \return float value (range: 0-2, default: 1.0)
  237. */
  238. @property (nonatomic) float brightness;
  239. /**
  240. * Set/Get the adjust filter's hue value
  241. *
  242. * \return float value (range: -180-180, default: 0.)
  243. */
  244. @property (nonatomic) float hue;
  245. /**
  246. * Set/Get the adjust filter's saturation value
  247. *
  248. * \return float value (range: 0-3, default: 1.0)
  249. */
  250. @property (nonatomic) float saturation;
  251. /**
  252. * Set/Get the adjust filter's gamma value
  253. *
  254. * \return float value (range: 0-10, default: 1.0)
  255. */
  256. @property (nonatomic) float gamma;
  257. /**
  258. * Get the requested movie play rate.
  259. * @warning Depending on the underlying media, the requested rate may be
  260. * different from the real playback rate. Due to limitations of some protocols
  261. * this option may not be taken into account at all, if set.
  262. *
  263. * \return movie play rate
  264. */
  265. @property (nonatomic) float rate;
  266. /**
  267. * an audio controller object
  268. * \return instance of VLCAudio
  269. */
  270. @property (nonatomic, readonly, weak) VLCAudio * audio;
  271. /* Video Information */
  272. /**
  273. * Get the current video size
  274. * \return video size as CGSize
  275. */
  276. @property (NS_NONATOMIC_IOSONLY, readonly) CGSize videoSize;
  277. /**
  278. * Does the current media have a video output?
  279. * \note a false return value doesn't mean that the video doesn't have any video
  280. * \note tracks. Those might just be disabled.
  281. * \return current video output status
  282. */
  283. @property (NS_NONATOMIC_IOSONLY, readonly) BOOL hasVideoOut;
  284. /**
  285. * Frames per second
  286. * \deprecated provided for API compatibility only, to retrieve a media's FPS, use VLCMediaTracksInformationFrameRate.
  287. * \returns 0
  288. */
  289. @property (NS_NONATOMIC_IOSONLY, readonly) float framesPerSecond __attribute__((deprecated));
  290. #pragma mark -
  291. #pragma mark time
  292. /**
  293. * Sets the current position (or time) of the feed.
  294. * \param value New time to set the current position to. If time is [VLCTime nullTime], 0 is assumed.
  295. */
  296. /**
  297. * Returns the current position (or time) of the feed.
  298. * \return VLCTime object with current time.
  299. */
  300. @property (NS_NONATOMIC_IOSONLY, strong) VLCTime *time;
  301. /**
  302. * Returns the current position (or time) of the feed, inversed if a duration is available
  303. * \return VLCTime object with requested time
  304. * \note VLCTime will be a nullTime if no duration can be calculated for the current input
  305. */
  306. @property (nonatomic, readonly, weak) VLCTime *remainingTime;
  307. #pragma mark -
  308. #pragma mark ES track handling
  309. /**
  310. * Return the current video track index
  311. *
  312. * \return 0 if none is set.
  313. *
  314. * Pass -1 to disable.
  315. */
  316. @property (readwrite) int currentVideoTrackIndex;
  317. /**
  318. * Returns the video track names, usually a language name or a description
  319. * It includes the "Disabled" fake track at index 0.
  320. */
  321. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoTrackNames;
  322. /**
  323. * Returns the video track IDs
  324. * those are needed to set the video index
  325. */
  326. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoTrackIndexes;
  327. /**
  328. * returns the number of video tracks available in the current media
  329. * \return number of tracks
  330. */
  331. @property (NS_NONATOMIC_IOSONLY, readonly) int numberOfVideoTracks;
  332. /**
  333. * Return the current video subtitle index
  334. *
  335. * \return 0 if none is set.
  336. *
  337. * Pass -1 to disable.
  338. */
  339. @property (readwrite) int currentVideoSubTitleIndex;
  340. /**
  341. * Returns the video subtitle track names, usually a language name or a description
  342. * It includes the "Disabled" fake track at index 0.
  343. */
  344. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoSubTitlesNames;
  345. /**
  346. * Returns the video subtitle track IDs
  347. * those are needed to set the video subtitle index
  348. */
  349. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoSubTitlesIndexes;
  350. /**
  351. * returns the number of SPU tracks available in the current media
  352. * \return number of tracks
  353. */
  354. @property (NS_NONATOMIC_IOSONLY, readonly) int numberOfSubtitlesTracks;
  355. /**
  356. * Load and set a specific video subtitle, from a file.
  357. *
  358. * \deprecated use addPlaybackSlave:type:enforce: instead
  359. */
  360. - (BOOL)openVideoSubTitlesFromFile:(NSString *)path __attribute__((deprecated));
  361. /**
  362. * VLCMediaPlaybackNavigationAction describes actions which can be performed to navigate an interactive title
  363. */
  364. typedef NS_ENUM(unsigned, VLCMediaPlaybackSlaveType)
  365. {
  366. VLCMediaPlaybackSlaveTypeSubtitle = 0,
  367. VLCMediaPlaybackSlaveTypeAudio
  368. };
  369. /**
  370. * Add additional input sources to a playing media item
  371. * This way, you can add subtitles or audio files to an existing input stream
  372. * For the user, it will appear as if they were part of the existing stream
  373. * \param slaveURL of the content to be added
  374. * \param slaveType content type
  375. * \param enforceSelection switch to the added accessory content
  376. */
  377. - (int)addPlaybackSlave:(NSURL *)slaveURL type:(VLCMediaPlaybackSlaveType)slaveType enforce:(BOOL)enforceSelection;
  378. /**
  379. * Get the current subtitle delay. Positive values means subtitles are being
  380. * displayed later, negative values earlier.
  381. *
  382. * \return time (in microseconds) the display of subtitles is being delayed
  383. */
  384. @property (readwrite) NSInteger currentVideoSubTitleDelay;
  385. /**
  386. * Chapter selection and enumeration, it is bound
  387. * to a title option.
  388. */
  389. /**
  390. * Return the current chapter index, or
  391. * \return NSNotFound if none is set.
  392. */
  393. @property (readwrite) int currentChapterIndex;
  394. /**
  395. * switch to the previous chapter
  396. */
  397. - (void)previousChapter;
  398. /**
  399. * switch to the next chapter
  400. */
  401. - (void)nextChapter;
  402. /**
  403. * returns the number of chapters for a given title
  404. * \param titleIndex the index of the title you are requesting the chapters for
  405. */
  406. - (int)numberOfChaptersForTitle:(int)titleIndex;
  407. /**
  408. * Chapters of a given title index
  409. * \deprecated Use chapterDescriptionsOfTitle instead
  410. */
  411. - (NSArray *)chaptersForTitleIndex:(int)titleIndex __attribute__((deprecated));
  412. /**
  413. * dictionary value for the user-facing chapter name
  414. */
  415. extern NSString *const VLCChapterDescriptionName;
  416. /**
  417. * dictionary value for the chapter's time offset
  418. */
  419. extern NSString *const VLCChapterDescriptionTimeOffset;
  420. /**
  421. * dictionary value for the chapter's duration
  422. */
  423. extern NSString *const VLCChapterDescriptionDuration;
  424. /**
  425. * chapter descriptions
  426. * an array of all chapters of the given title including information about
  427. * chapter name, time offset and duration
  428. * \note if no title value is provided, information about the chapters of the current title is returned
  429. * \return array describing the titles in details
  430. * \see VLCChapterDescriptionName
  431. * \see VLCChapterDescriptionTimeOffset
  432. * \see VLCChapterDescriptionDuration
  433. */
  434. - (NSArray *)chapterDescriptionsOfTitle:(int)titleIndex;
  435. /**
  436. * Title selection and enumeration
  437. * \return NSNotFound if none is set.
  438. */
  439. @property (readwrite) int currentTitleIndex;
  440. /**
  441. * number of titles available for the current media
  442. * \return the number of titles
  443. */
  444. @property (readonly) int numberOfTitles;
  445. /**
  446. * count of titles
  447. * \deprecated Use numberOfTitles instead
  448. */
  449. @property (readonly) NSUInteger countOfTitles __attribute__((deprecated));
  450. /**
  451. * array of available titles
  452. * \deprecated Use titleDescriptions instead
  453. */
  454. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *titles __attribute__((deprecated));
  455. /**
  456. * dictionary value for the user-facing title name
  457. */
  458. extern NSString *const VLCTitleDescriptionName;
  459. /**
  460. * dictionary value for the title's duration
  461. */
  462. extern NSString *const VLCTitleDescriptionDuration;
  463. /**
  464. * dictionary value whether the title is a menu or not
  465. */
  466. extern NSString *const VLCTitleDescriptionIsMenu;
  467. /**
  468. * title descriptions
  469. * an array of all titles of the current media including information
  470. * of name, duration and potential menu state
  471. * \return array describing the titles in details
  472. * \see VLCTitleDescriptionName
  473. * \see VLCTitleDescriptionDuration
  474. * \see VLCTitleDescriptionIsMenu
  475. */
  476. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *titleDescriptions;
  477. /**
  478. * the title with the longest duration
  479. * \return int matching the title index
  480. */
  481. @property (readonly) int indexOfLongestTitle;
  482. /* Audio Options */
  483. /**
  484. * Return the current audio track index
  485. *
  486. * \return 0 if none is set.
  487. *
  488. * Pass -1 to disable.
  489. */
  490. @property (readwrite) int currentAudioTrackIndex;
  491. /**
  492. * Returns the audio track names, usually a language name or a description
  493. * It includes the "Disabled" fake track at index 0.
  494. */
  495. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *audioTrackNames;
  496. /**
  497. * Returns the audio track IDs
  498. * those are needed to set the video index
  499. */
  500. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *audioTrackIndexes;
  501. /**
  502. * returns the number of audio tracks available in the current media
  503. * \return number of tracks
  504. */
  505. @property (NS_NONATOMIC_IOSONLY, readonly) int numberOfAudioTracks;
  506. #pragma mark -
  507. #pragma mark audio functionality
  508. /**
  509. * sets / returns the current audio channel
  510. * \return the currently set audio channel
  511. */
  512. @property (NS_NONATOMIC_IOSONLY) int audioChannel;
  513. /**
  514. * Get the current audio delay. Positive values means audio is delayed further,
  515. * negative values less.
  516. *
  517. * \return time (in microseconds) the audio playback is being delayed
  518. */
  519. @property (readwrite) NSInteger currentAudioPlaybackDelay;
  520. #pragma mark -
  521. #pragma mark equalizer
  522. /**
  523. * Get a list of available equalizer profiles
  524. * \note Current versions do not allow the addition of further profiles
  525. * so you need to handle this in your app.
  526. *
  527. * \return array of equalizer profiles
  528. */
  529. @property (weak, readonly) NSArray *equalizerProfiles;
  530. /**
  531. * Re-set the equalizer to a profile retrieved from the list
  532. * \note This doesn't enable the Equalizer automagically
  533. */
  534. - (void)resetEqualizerFromProfile:(unsigned)profile;
  535. /**
  536. * Toggle equalizer state
  537. * param: bool value to enable/disable the equalizer
  538. * \return current state */
  539. @property (readwrite) BOOL equalizerEnabled;
  540. /**
  541. * Set amplification level
  542. * param: The supplied amplification value will be clamped to the -20.0 to +20.0 range.
  543. * \note this will create and enabled an Equalizer instance if not present
  544. * \return current amplification level */
  545. @property (readwrite) CGFloat preAmplification;
  546. /**
  547. * Number of equalizer bands
  548. * \return the number of equalizer bands available in the current release */
  549. @property (readonly) unsigned numberOfBands;
  550. /**
  551. * frequency of equalizer band
  552. * \param index the band index
  553. * \return frequency of the requested equalizer band */
  554. - (CGFloat)frequencyOfBandAtIndex:(unsigned)index;
  555. /**
  556. * set amplification for band
  557. * \param amplification value (clamped to the -20.0 to +20.0 range)
  558. * \param index of the respective band */
  559. - (void)setAmplification:(CGFloat)amplification forBand:(unsigned)index;
  560. /**
  561. * amplification of band
  562. * \param index of the band
  563. * \return current amplification value (clamped to the -20.0 to +20.0 range) */
  564. - (CGFloat)amplificationOfBand:(unsigned)index;
  565. #pragma mark -
  566. #pragma mark media handling
  567. /* Media Options */
  568. /**
  569. * The currently media instance set to play
  570. */
  571. @property (NS_NONATOMIC_IOSONLY, strong) VLCMedia *media;
  572. #pragma mark -
  573. #pragma mark playback operations
  574. /**
  575. * Plays a media resource using the currently selected media controller (or
  576. * default controller. If feed was paused then the feed resumes at the position
  577. * it was paused in.
  578. */
  579. - (void)play;
  580. /**
  581. * Set the pause state of the feed. Do nothing if already paused.
  582. */
  583. - (void)pause;
  584. /**
  585. * Stop the playing.
  586. */
  587. - (void)stop;
  588. /**
  589. * Advance one frame.
  590. */
  591. - (void)gotoNextFrame;
  592. /**
  593. * Fast forwards through the feed at the standard 1x rate.
  594. */
  595. - (void)fastForward;
  596. /**
  597. * Fast forwards through the feed at the rate specified.
  598. * \param rate Rate at which the feed should be fast forwarded.
  599. */
  600. - (void)fastForwardAtRate:(float)rate;
  601. /**
  602. * Rewinds through the feed at the standard 1x rate.
  603. */
  604. - (void)rewind;
  605. /**
  606. * Rewinds through the feed at the rate specified.
  607. * \param rate Rate at which the feed should be fast rewound.
  608. */
  609. - (void)rewindAtRate:(float)rate;
  610. /**
  611. * Jumps shortly backward in current stream if seeking is supported.
  612. * \param interval to skip, in sec.
  613. */
  614. - (void)jumpBackward:(int)interval;
  615. /**
  616. * Jumps shortly forward in current stream if seeking is supported.
  617. * \param interval to skip, in sec.
  618. */
  619. - (void)jumpForward:(int)interval;
  620. /**
  621. * Jumps shortly backward in current stream if seeking is supported.
  622. */
  623. - (void)extraShortJumpBackward;
  624. /**
  625. * Jumps shortly forward in current stream if seeking is supported.
  626. */
  627. - (void)extraShortJumpForward;
  628. /**
  629. * Jumps shortly backward in current stream if seeking is supported.
  630. */
  631. - (void)shortJumpBackward;
  632. /**
  633. * Jumps shortly forward in current stream if seeking is supported.
  634. */
  635. - (void)shortJumpForward;
  636. /**
  637. * Jumps shortly backward in current stream if seeking is supported.
  638. */
  639. - (void)mediumJumpBackward;
  640. /**
  641. * Jumps shortly forward in current stream if seeking is supported.
  642. */
  643. - (void)mediumJumpForward;
  644. /**
  645. * Jumps shortly backward in current stream if seeking is supported.
  646. */
  647. - (void)longJumpBackward;
  648. /**
  649. * Jumps shortly forward in current stream if seeking is supported.
  650. */
  651. - (void)longJumpForward;
  652. /**
  653. * performs navigation actions on interactive titles
  654. */
  655. - (void)performNavigationAction:(VLCMediaPlaybackNavigationAction)action;
  656. /**
  657. * Updates viewpoint with given values.
  658. * \param yaw new yaw.
  659. * \param pitch new pitch.
  660. * \param roll new roll.
  661. * \param fov new field of view.
  662. * \param absolute if true replace the old viewpoint with the new one. If
  663. * false, increase/decrease it.
  664. * \note This will create a viewpoint instance if not present.
  665. */
  666. - (BOOL)updateViewpoint:(CGFloat)yaw pitch:(CGFloat)pitch roll:(CGFloat)roll fov:(CGFloat)fov absolute:(BOOL)absolute;
  667. #pragma mark -
  668. #pragma mark playback information
  669. /**
  670. * Playback state flag identifying that the stream is currently playing.
  671. * \return TRUE if the feed is playing, FALSE if otherwise.
  672. */
  673. @property (NS_NONATOMIC_IOSONLY, getter=isPlaying, readonly) BOOL playing;
  674. /**
  675. * Playback state flag identifying wheather the stream will play.
  676. * \return TRUE if the feed is ready for playback, FALSE if otherwise.
  677. */
  678. @property (NS_NONATOMIC_IOSONLY, readonly) BOOL willPlay;
  679. /**
  680. * Playback's current state.
  681. * \see VLCMediaState
  682. */
  683. @property (NS_NONATOMIC_IOSONLY, readonly) VLCMediaPlayerState state;
  684. /**
  685. * Returns the receiver's position in the reading.
  686. * \return movie position as percentage between 0.0 and 1.0.
  687. */
  688. @property (NS_NONATOMIC_IOSONLY) float position;
  689. /**
  690. * Set movie position. This has no effect if playback is not enabled.
  691. * \note movie position as percentage between 0.0 and 1.0.
  692. */
  693. @property (NS_NONATOMIC_IOSONLY, getter=isSeekable, readonly) BOOL seekable;
  694. /**
  695. * property whether the currently playing media can be paused (or not)
  696. * \return BOOL value
  697. */
  698. @property (NS_NONATOMIC_IOSONLY, readonly) BOOL canPause;
  699. /**
  700. * Array of taken snapshots of the current video output
  701. * \return a NSArray of NSString instances containing the names
  702. * \note This property is not available to macOS
  703. */
  704. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *snapshots;
  705. #if TARGET_OS_IPHONE
  706. /**
  707. * Get last snapshot available.
  708. * \return an UIImage with the last snapshot available.
  709. * \note return value is nil if there is no snapshot
  710. * \note This property is not available to macOS
  711. */
  712. @property (NS_NONATOMIC_IOSONLY, readonly) UIImage *lastSnapshot;
  713. #else
  714. /**
  715. * Get last snapshot available.
  716. * \return an NSImage with the last snapshot available.
  717. * \note return value is nil if there is no snapshot
  718. * \note This property is not available to iOS and tvOS
  719. */
  720. @property (NS_NONATOMIC_IOSONLY, readonly) NSImage *lastSnapshot;
  721. #endif
  722. #pragma mark -
  723. #pragma mark Renderer
  724. /**
  725. * Sets a `VLCRendererItem` to the current media player
  726. * \param item `VLCRendererItem` discovered by `VLCRendererDiscoverer`
  727. * \return `YES` if successful, `NO` otherwise
  728. * \note Must be called before the first call of `play` to take effect
  729. * \see VLCRendererDiscoverer
  730. * \see VLCRendererItem
  731. */
  732. - (BOOL)setRendererItem:(VLCRendererItem *)item;
  733. @end