Integrating Third-Party Players with IQ Using the JS SDK
Ooyala IQ needs to receive information about player events to properly display analytics data. The figure below shows the flow of when each player event should be recorded.
- setDeviceInfo: Called once to setup the device information.
- setPlayerInfo: Called once to setup player information.
- reportPlayerLoad: Called when the player is created (loaded).
- initializeMedia: Measures when a piece of video content is loaded and displayed within the player before it gets played (if a pre-roll ad is present, this should not be captured until the pre-roll ad is complete and the main video loads). This is called whenever the loaded video changes, also when the player goes to the next video in a playlist, for example.
- setMediaDuration: Called after the media is initialized.
- reportPlayRequested: Measures when the play button is triggered either manually or automatically. The requested content could be ad content or the actual video content.
- reportPlaybackStarted: Called when the media has successfully started playback.
- reportPlayHeadUpdate: Called when the video playhead moves. This event is reported periodically (at least every 2 to 3 seconds).
- reportPause: Called when the video is paused.
- reportResume: Called when the video is resumed after it has been paused.
- reportSeek: Called when the viewer seeks through the video, jumping from one time in the video to another.
- reportReplay: Called when the video is replayed.
- reportComplete: Called when the full length of the video was played.
- reportCustomEvent: Called whenever you want to report custom events to
Ooyala IQ.Note: At this time custom events can be ingested, but we can only store the information. Ooyala IQ is not able to process custom events, and you will not be able to access this information from the Ooyala IQ backend. However, you may wish to start sending Ooyala IQ your custom events now so that you have the data there for when custom events are supported by Ooyala IQ.
- Device information (setDeviceInfo): the device's unique identifier, which is generated if not set, the browser used to load the player, the browser version, the operating system, the device type (like, mobile or desktop), the device's brand and model. This information is used for the Device Panel in IQ.
- Player information (setPlayerInfo): the player's unique identifier, player name and player version.
The following diagram shows the architecture for any third-party player integration with Ooyala IQ (where Player is the third-party player).
translates your player's events and APIs to correlate with the events defined in
You can use an Ooyala adapter or create your own adapter.Ooyala provides adapters for the relevant standard versions of the following platforms:
- Brightcove (Videojs and Experiencejs)
- JW Player 6 and 7
- Flowplayer 6
- HTML5 video tag
- YouTube player (iframe_api)
- Xbox One
Create your third-party player.
- Reference the analytics.js in the page where your player is hosted. This needs to be done for any page that has a player.
- Include the adapter code (see adapter-specific documentation for details).
(Optional) Specify a media content type with the
MediaContentType parameter to show if the
mediaid specifies an Ooyala video asset or a non-Ooyala
video asset. You can set the media content type as one of the two following
values. If you do not specify a media content type, the default value is
EXTERNAL_CONTENT (non-Ooyala media assets).
- OOYALA_CONTENT: Indicates that the
mediaid is an Ooyala embed code. To get the
information you need to specify the Ooyala asset, make the
Backlot API query: /assets/<ASSET EMBED
CODE>/streams for the asset and copy the result of
the desired encoding. The example below shows how
OOYALA_CONTENT is specified with the JW
- EXTERNAL_CONTENT: Indicates that the
mediaid is not an Ooyala embed code (and is
customer-defined media ID from a non-Ooyala CMS). The example
below shows how EXTERNAL_CONTENT is specified
with the JW Player adapter.
- OOYALA_CONTENT: Indicates that the mediaid is an Ooyala embed code. To get the information you need to specify the Ooyala asset, make the Backlot API query: /assets/<ASSET EMBED CODE>/streams for the asset and copy the result of the desired encoding. The example below shows how OOYALA_CONTENT is specified with the JW Player adapter.