VLCMediaPlayer.h 26 KB

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