Skip to content

Seat Recommendation#

The recommendation suggests media content to passengers during a flight by analyzing their profile preferences, previously watched or similar content, and trending media among other passengers. This ensures a personalized and engaging in-flight entertainment experience

1. Initialization of recommendation#

This API serves as the entry point for initiating a recommendation. Upon initialization, a service object is created and made available through the IInFlightCallback interface. The recommendation system completes its setup by invoking the onInitServiceComplete method within IInFlightCallback, which then provides access to the Recommendation object. This object is essential for retrieving and managing personalized media suggestions for passengers.

Recommendation recommendation;
Recommendation.initService(this, new IInFlightCallback() {
            @Override
            public void onInitServiceComplete(Object o, String s) {
                //After successful initialization of recommendation, recommendation object provided by the callback
                recommendation = (Recommendation) o;
            }

            @Override
            public void onInitServiceFailed(String s, InFlight.Error error) {
              //If any error occured during initilization this method get invoked
            }
        },new InFlight());

2. The recommendation response listener#

The Recommendation API includes a listener that is responsible for receiving and processing responses from the recommendation service. This listener acts as a unified component that handles responses for all types of recommendation API requests.

private OnMediaRecommendationReceivedListener onMediaRecommendationReceivedListener = new OnMediaRecommendationReceivedListener() {
        @Override
        public void onMediaRecommendationReceived(List<RecommendationByCategory> recommendationByCategories) {
            //After successfully retrieving data from the recommendation service, this method is get invoked and providing the data

            //recommendationByCategories is list contains the recommendation data, It may contians data of multiple categories
            for(RecommendationByCategory recommendationByCategory : recommendationByCategories) {
                //Single category item
                List<RecommendationType> recommendationTypeList = recommendationByCategory.getRecommendationType();

                //For single category item it contains multiple recommendation
                //For e.g. in case getEnsemble API list of trending, popular, recommendations list is obtained.
                //In case of other API only one list obtained in the response
                for (RecommendationType recommendationType : recommendationTypeList) {
                    List<MediaRecommendation> mediaRecommendationList = recommendationType.getMediaRecommendations();
                    MediaRecommendationType type = recommendationType.getRecommendationType();
                }
            }
        }

        @Override
        public void onError(Error error) {
          //Any error occured during API call, this method get invovked
        }
    };

The given code snippet illustrates that the recommendation response is obtained through the onMediaRecommendationReceived method. This method provides a list of RecommendationByCategory objects, as the recommendation API allows retrieving data for multiple categories. As a result, the response is organized in a category-wise format, ensuring that media recommendations are grouped based on their respective categories.

Each RecommendationByCategory object contains a list of RecommendationType objects. Each RecommendationType represents a specific category of recommendations, such as trending, popular, similar, or recommended suggestions. Additionally, the RecommendationType object includes a list of MediaRecommendation objects, which store detailed information about the recommended media content within that specific recommendation type.

3. The Recommendation API’s#

The recommendation service provides four different types of recommendations, each tailored to enhance media selection based on user preferences, content similarities, and trends.

3.1. Get Similar Media#

The getSimilarMedia method retrieves a list of media URIs that are similar to the specified media_uri. This API can be utilized in various scenarios, such as displaying related content on the content synopsis page to help users discover similar media. Additionally, it can be used to present recommendations after a user has finished watching a particular piece of content, enhancing the viewing experience by suggesting relevant options. By default, the list contains 10 items, sorted in descending order. The results can be filtered by media content, media category, and request limit. Additionally, specific media URIs can be excluded by providing a list of blacklist_uris.

recommendation.getSimilarMedia("media.video.movie", mediaUriList,
                mediaSimilarRequestAttribute, new Recommendation.OnMediaRecommendationReceivedListener() {
            @Override
            public void onMediaRecommendationReceived(List<RecommendationByCategory> list) {

            }

            @Override
            public void onError(Recommendation.Error error) {

            }
        });

Parameters

  • mediaUriList- Media URIs used to identify and retrieve similar content.

  • contentType - The media content type used to filter the recommendation results. e.g. media.video.movie, media.audio.album

  • mediaSimilarRequestAttribute - Additional optional parameters, such as category and request limit, to be included in the search

  • blackListedMediaUris - Specifies the URIs of media that should be excluded from appearing in the search results.

  • similarMediaResponseLimit - Defines the maximum number of media URIs that can be returned for each category ID. If this parameter is not specified, the default limit is set to 10 items per category.

  • categoryList - A list of category ID. If this parameter is provided, the response will include separate lists of recommendations for each specified category ID. Each recommendation list will be filtered based on its corresponding category ID.

  • seatNumber - Assigns the seat number for the passenger making the request.

  • onMediaRecommendationReceivedListener - This will be executed upon error or completion of the request.

3.2. Get Recommendation Media#

The getRecommendations method retrieves a list of similar items based on the passenger's viewing history and playlist. The recommendation obtains this data from the IPS service, which collects and stores historical viewing data based on the passenger's content consumption patterns. The IPS continuously accumulates this data from passenger interactions, allowing the recommender to generate personalized suggestions tailored to the passenger's preferences. By default, the list includes 10 items, sorted in descending order. The results can be filtered by media content, category, and request limit. Specific media URIs can also be excluded by providing a blacklist_uris list.

 recommendation.getRecommendations("media.video.movie",
                mediaRecommendationRequestAttribute, new Recommendation.OnMediaRecommendationReceivedListener() {
            @Override
            public void onMediaRecommendationReceived(List<RecommendationByCategory> list) {

            }

            @Override
            public void onError(Recommendation.Error error) {

            }
        });

Parameters

  • contentType - The content type of media to filter. Example: media.video.movie, media.audio.album

  • recommendationMediaAttr - Additional optional parameters, such as category and request limit, etc.

  • blackListedMediaUris - Specifies the URIs of media that should be excluded from appearing in the search results.

  • setRecommendedMediaResponseLimit - Defines the maximum number of media URIs that can be returned for each category ID. If this parameter is not specified, the default limit is set to 10 items per category.

  • categoryList - A list of category IDs. If this parameter is provided, the response will include separate lists of recommendations for each specified category ID. Each recommendation list will be filtered based on its corresponding category ID.

  • seatNumber - Assigns the seat number for the passenger making the request.

  • onMediaRecommendationReceivedListener - This will be executed upon error or completion of the request.

The getTrendingMedia retrieves a list of items that are currently being watched or were recently watched by passengers on the same flight. By default, the returned list includes up to 10 items, arranged in descending order based on relevance or popularity. The results can be customized by applying filters such as media content type, category, and a specified request limit to control the number of items retrieved. Additionally, specific media URIs can be excluded from the results by providing a blacklist_uris list, ensuring that certain content does not appear in the recommendations. Trending data is reset according to the IPS configuration set by the airline, which defines the criteria for determining the end of a sector. The data will be cleared upon the occurrence of one of the following three events, depending on the airline's program settings:

  • WOW (Weight on Wheels) transition

  • WOW transition + close flight

  • WOW transition + doors open

 recommendation.getTrendingMedia("media.video.movie",
                mediaTrendingRequestAttribute, new Recommendation.OnMediaRecommendationReceivedListener() {
            @Override
            public void onMediaRecommendationReceived(List<RecommendationByCategory> list) {

            }

            @Override
            public void onError(Recommendation.Error error) {

            }
        });

Parameters:

  • contentType - The content type of media to filter. Example: media.video.movie, media.audio.album

  • trendingMediaAttr - Additional optional parameters, such as blacklist, to be included in the search

  • blackListedMediaUris - Specifies the URIs of media that should be excluded from appearing in the search results.

  • mediaTrendingRequestAttribute - Additional optional parameters, such as category and request limit, etc.

  • setTrendingMediaItemLimit - Defines the maximum number of media that can be returned for each category ID. If this parameter is not specified, the default limit is set to 10 items per category.

  • categoryList - A list of category IDs. If this parameter is provided, the response will include separate lists of recommendations for each specified category ID. Each recommendation list will be filtered based on its corresponding category ID.

  • seatNumber - Assigns the seat number for the passenger making the request.

  • onMediaRecommendationReceivedListener - This will be executed upon error or completion of the request

3.4 Get Ensemble Media#

The getEnsembleMedia method works the same as calling getRecommendations, getTrendingMedia, and getPopular simultaneously.

Since there is no dedicated method for fetching popular recommendations, this method must be used to obtain a list of popular items. It retrieves items based on box office revenue data from the ROVI dataset, making it suitable for initial recommendations when a flight opens or immediately after an interactive session starts, particularly when history or usage data is unavailable. Alternatively, it may be a predefined, curated list from the ground.

Not only does it reduce multiple network requests, but it also prevents duplicate items from appearing across various lists. For instance, an item that is both recommended and trending will only be included once, ensuring a more diverse and streamlined set of results.

By default, the API returns 15 items, including 5 recommendations, 5 popular items, and 5 trending items. The results can be customized by applying filters based on media content type, category, and a specified request limit. Additionally, specific media URIs can be excluded from the response by providing a blacklist_uris list, ensuring that certain content is omitted from the returned results.

 recommendation.getEnsembleMedia("media.video.movie",
                mediaEnsembleRequestAttribute, new Recommendation.OnMediaRecommendationReceivedListener() {
            @Override
            public void onMediaRecommendationReceived(List<RecommendationByCategory> list) {

            }

            @Override
            public void onError(Recommendation.Error error) {

            }
        });

Parameters:

  • contentType - A content type of media to filter. Example: media.video.movie, media.audio.album

  • ensembleMediaAttr - Additional optional parameters, such as history, playlist, seat number, etc.

  • setTrendingMediaItemLimit - Defines the maximum number of media content that can be returned for each category ID. The default limit is set to 5 items per category if this parameter is not specified.

  • setRecommendedLimit - Defines the maximum number of media content that can be returned for each category ID. If this parameter is not specified, the default limit is set to 5 items per category.

  • setPopularLimit - Defines the maximum number of media content that can be returned for each category ID. If this parameter is not specified, the default limit is set to 5 items per category.

  • categoryList - A list of category IDs. If this parameter is provided, the response will include separate lists of recommendations for each specified category ID. Each recommendation list will be filtered based on its corresponding category ID.

  • seatNumber - Assigns the seat number for the passenger making the request.

  • onMediaRecommendationReceivedListener - This will be executed upon error or completion of the request.

4. Some other API’s#

4.1 Get Genres List#

Retrieves and provides a comprehensive list of genres associated with a particular type of content. Each genre in the list is mapped to its corresponding translated name based on the specified ISO 639 language code, ensuring that the genres are presented in the appropriate localized format.

These genres can be stored in the user's profile preferences. Based on these preferences, relevant recommendations can be generated.

recommendation.getGenre("media.video.movie", "eng", new OnGenreReceivedListener() {
            @Override
            public void onGenreReceived(List<String> genreList) {
                //List of genre will be obtain after succesful completion of API call
            }

            @Override
            public void onError(Error error) {
              //Invoke this method if any error during fetching the genre list
            }
        });

Parameters:

  • contentType - The content type for which genres are to be retrieved.

  • langIso - The ISO language code specifies the translation to be used.

  • genreReceivedListener - The listener used to obtain the list of genres list,

Version 1.0