Browse Source

media player: add support for interactive title navigation

Felix Paul Kühne 9 years ago
parent
commit
f246c938d4
2 changed files with 22 additions and 0 deletions
  1. 17 0
      Headers/Public/VLCMediaPlayer.h
  2. 5 0
      Sources/VLCMediaPlayer.m

+ 17 - 0
Headers/Public/VLCMediaPlayer.h

@@ -61,6 +61,18 @@ typedef NS_ENUM(NSInteger, VLCMediaPlayerState)
 };
 
 /**
+ * VLCMediaPlaybackNavigationAction describes actions which can be performed to navigate an interactive title
+ */
+typedef NS_ENUM(unsigned, VLCMediaPlaybackNavigationAction)
+{
+    VLCMediaPlaybackNavigationActionActivate = 0,
+    VLCMediaPlaybackNavigationActionUp,
+    VLCMediaPlaybackNavigationActionDown,
+    VLCMediaPlaybackNavigationActionLeft,
+    VLCMediaPlaybackNavigationActionRight
+};
+
+/**
  * Returns the name of the player state as a string.
  * \param state The player state.
  * \return A string containing the name of state. If state is not a valid state, returns nil.
@@ -607,6 +619,11 @@ extern NSString *const VLCTitleDescriptionIsMenu;
  */
 - (void)longJumpForward;
 
+/**
+ * performs navigation actions on interactive titles
+ */
+- (void)performNavigationAction:(VLCMediaPlaybackNavigationAction)action;
+
 #pragma mark -
 #pragma mark playback information
 /**

+ 5 - 0
Sources/VLCMediaPlayer.m

@@ -1179,6 +1179,11 @@ static void HandleMediaPlayerSnapshot(const libvlc_event_t * event, void * self)
     [self jumpForward:300];
 }
 
+- (void)performNavigationAction:(VLCMediaPlaybackNavigationAction)action
+{
+    libvlc_media_player_navigate(_playerInstance, action);
+}
+
 + (NSSet *)keyPathsForValuesAffectingIsPlaying
 {
     return [NSSet setWithObjects:@"state", nil];