Using the QoS Solution Powered by NPAW for iOS

The mobile implementation of the Ooyala QoS Solution powered by the NICE PEOPLE AT WORK (NPAW) YOUBORA platform provides analytics for the player events with Ooyala's iOS players.

Prior to enabling the Ooyala QoS Solution powered by YOUBORA, you must have the following:
  • A customer relationship with NPAW with accounts for YOUBORA. Please contact your Ooyala point of contact to set up your NPAW Account ID (identifier for your NPAW account) and User ID (the identifier for the user of the device).
  • An Ooyala Backlot account.
  • Experience in iOS development.
Note: We now have native support on iOS for VoD.
You need to add a small number of code snippets to integrate NPAW's YOUBORA with an existing OoyalaPlayer application.
  1. Download the frameworks and import them to your project using one of the following approaches:
    • (Recommended) Copy or drag them into your project folder and then add them to Linked Frameworks and Libraries.
    • Add them to Linked Frameworks and Libraries, select Build Settings > Framework Search Paths add the path where they are located.
  2. In the code where the Ooyala player is created, import the plugin using one of the import statements shown below:
    #import <YouboraPluginOoyala/YouboraPluginOoyala.h>
    
    // OR
    
    @import YouboraPluginOoyala;         
  3. As soon as the player is created, instance the plugin and start monitoring the player. This is usually done in the viewDidLoad() method.
    self.plugin = [[YBPluginOoyala alloc] initWithOptions:youboraOptions];    
    [self.plugin startMonitoringWithPlayer:player];                              

    youboraOptions is an NSDictionary that stores information related to the client YOUBORA account, device information, and media information. You can explore these options in complete detail at the NPAW Developer Portal. By calling startMonitoringWithPlayer(), the plugin registers the necessary listeners to extract the events from the player. It will wait until the media is loaded to create a session in YOUBORA.

  4. Call stopMonitoring() when the client no longer needs to track analytics. This is usually the case when the final user navigates back from a view controller with a fullscreen player. It is recommended you place this call in a Back button. You can also achieve this by overriding the ViewController's didMoveToParentController() method and checking for the parent parameter. The following method unregisters everything set in the startMonitoring() method, and sends a /stop event, which closes the YOUBORA session if one is ongoing.
    - (void)didMoveToParentViewController:(UIViewController *)parent {
        if (parent == nil) {
            // Moving to previous View Controller
            [self.plugin stopMonitoring];
        }
    }
     
  5. If you would like the plugin to print logs, call the setDebug() method before anything else, prior to the plugin creation:
    [YBLog setDebugLevel:logLevel];

    The logLevel parameter is the value of a constant defined in YBLog.h. These log levels are listed in order of verbosity:

    YBLogLevelSilent;
    YBLogLevelError;
    YBLogLevelWarning;
    YBLogLevelLifeCycle;
    YBLogLevelDebug;
    YBLogLevelHTTPRequests;                     
                     

    You can download a fully integrated example here.

When you have configured Ooyala and Youbora correctly, you will be able to see NPAW requests in network traces going to http://test-nqs.nice264.com/, as well as see logs in Logcat tagged with NICE_PEOPLE_OOYALA and NICE_PEOPLE_BASE.

YouboraMetadata

A class which accepts metadata about the environment. This is added into YOUBORA using Youbora.updateYouboraMetadata(metadata);.

This class has (but is not limited to) the following methods. For a full list of keys you can use along with detailed descriptions and examples, see the YOUBORA product documentation.

Method Automatically Filled Description
YouboraMetadata.setParam1 No  
YouboraMetadata.setParam2 No  
YouboraMetadata.setCdn No

Allows you to override the CDN automatic detection that YOUBORA Analytics does. This is an optional method.

The CDN detection is done based on the host of the resource/video URL YOUBORA receives from the player. However, you could embed API URLs that may cause YOUBORA automatic system to return a wrong CDN (or unknown). If you use the YOUBORA Smartswitch or know which CDN is sending the content, you can override the automatic value.

YouboraMetadata.setIp No

Allows you to override the IP automatic detection that Analytics does. This is an optional method.

The IP comes from the request IP from the end user. If you use a middle-ware between the plugin and the analytics server for the Smartswitch feature, YOUBORA would only get the middleware IP instead of the user's.

YouboraMetadata.setIsp No

Allows overriding the ISP automatic detection that Analytics does. This is an optional method.

YouboraMetadata.setTransaction No Sets the transaction code value inside YOUBORA analytics. The transaction code is a specific code you can use to identify the view within the Analytics tool and make searches. This code means whatever you want it to (purchaseCode, sessionCode, and so on).
YouboraMetadata.setResource No Overwrites the video URL metadata sent to the YOUBORA system. This means that even though the player plays one different URL, you can set up a new one as metadata (not as the video that will be played) just for the CDN detection.

Properties Map

A HashMap of properties that contains information about the current playback. Added into YOUBORA using metadata.setProperties(), where metadata is a YouboraMetadata object. This HashMap accepts (but is not limited to) the following keys. For a full list of keys you can use along with detailed descriptions and examples, see the YOUBORA product documentation.
Key Automatically Filled Description
filename No File name of the current media content.
content_id No Defaults to Ooyala Embed Code/Content ID.
transaction_type No Rent: Media for rental.

Subscription: Media which has been acquired as part of a subscription.

EST (Electronic Sell Through): Media purchased.

Free: Media which has no economical transaction.

quality No HD or SD.
content_type No Trailer, Episode, or Movie.
content_metadata Yes A HashMap of many other metadata entries related to the content.
device Yes A HashMap of many other metadata entries related to the content.
<Any text> No Can be any text string, which would be passed through to NPAW.

MetadataMap

A HashMap of information about the content. Added into the properties HashMap using properties.put("content_metadata", metadataMap);. This HashMap accepts (but is not limited to) the following keys. For a full list of keys you can use along with detailed descriptions and examples, see the YOUBORA product documentation.
Key Automatically Filled
title Yes
genre No
language No
year No
cast No
director No
owner No
duration Yes
parental No
price No
rating No
audioType No
audioChannels No

Device Metadata Map

A HashMap of information about the device. This HashMap accepts (but is not limited to) the following keys. For a full list of keys you can use along with detailed descriptions and examples, see the YOUBORA product documentation.

Key Automatically Filled
manufacturer No
type No
year No
firmware No

해당 내용이 도움 되었습니까?