Set up Recommendations (iOS)

Automate the generation of a playlist based on a seed video for your iOS app.



If you have hundreds of videos hosted on or registered with your account, Recommendations automates the generation of a playlist based on a seed video and provides you options to customize the appearance and behavior of that playlist.

1148

Screenshot of Recommendations view



Prerequisites

In addition to the general iOS SDK requirements, the following items are required to implement Recommendations.

ItemNotes
50 videos
(recommended)
This is the suggested minimum number of videos that should be in your JWP library.
RecommendationsΒ featureIf this product is not already enabled in your account, contact your JWP representative.


Configure the Recommendations display options

Follow these steps for configuring and setting up Recommendations:

  1. Create a Recommendations playlist in your JWP dashboard.
  2. After creating the Recommendations playlist, on the DEVELOPER RESOURCES tab of your JWP dashboard, copy the JSON URL.
  3. Use the following recipe to configure Recommendations in your app.

πŸ’‘

For a full example, see the Recommendations best practice app.

Specifically, the ViewController.swift shows an example that incorporates associating the Recommendations feed with either a specific video or all videos played in the player.



Related Delegates

DelegateDescription
func playerViewController(_ controller: JWPlayerViewController, relatedMenuOpenedWithItems items: [JWPlayerItem], withMethod method: JWRelatedInteraction)Triggers when the related view is opened
func playerViewController(_ controller: JWPlayerViewController, relatedMenuClosedWithMethod method: JWRelatedInteraction)Triggers when the related view is closed
func playerViewController(_ controller: JWPlayerViewController, relatedItemBeganPlaying item: JWPlayerItem, atIndex index: Int, withMethod method: JWRelatedInteraction)Triggers when a user selects an object in a related feed or the first item starts playing