Recommending Videos that Engage Your Viewers

.
JWP Product & Engineering
7 min readAug 6, 2019
Screenshot of JW Recommendations shelf widget.
Screenshot of Recommendations shelf overlay.

You have hundreds of videos in your library and every week your company produces new content to engage viewers. When viewers come to your site and engage with the video content on the page, how can you address the issue of content discovery: leveraging your video library to keep them engaged to watch more videos after they watched the initial video?

The model

You need a model that can recommend videos based on both the strength of behavioral signals from your viewers as well as the content of the video and your library.

After experimenting with various recommendation models, we created Recommendations. Recommendations uses the currently-watched video to automatically suggest videos with the highest likelihood to extend a viewer’s video watching session. Our solution uses a proprietary algorithm that incorporates historical viewer patterns, similarity in video metadata across pairs of videos (titles, descriptions, tags), and recent video popularity in determining what content to recommend. Each customer has different configurations which affect the strength of each signal we collect. Given this variance in different signals, our model has three different layers that get activated based on the strength of the signals. Below, we lay out how each layer works at a high level.

Association layer

Association-based recommendations involve observing user behavior in order to infer associations between pairs of items. The association layer in Recommendations surfaces relationships between videos based on historical viewer behavior, using a proprietary Pairwise Empirical Engagement Rate (PEER) model. This model identifies videos that are regularly watched together by a publisher’s viewers, and selects the ones most likely to drive additional viewing time based on the following data:

  • Pairs of videos watched by individual viewers within and across viewing sessions
  • Precise watch durations for each video view, including whether the video was completed
  • Temporal and sequential information about how videos are consumed

Our model is based on a PEER score which is tailored for answering the following question: given that a viewer has engaged with a specific video — say Video X — which other video are they empirically most likely to engage with? To compute this metric for a pair of videos (say videos 1 and 2) we start with the pool of viewers that have played and engaged with Video 1. In this case, we define engagement as either completing the video or watching it to a critical time threshold (e.g. [x] seconds).

From this pool, we identify the subset of viewers — illustrated by the light blue dots — that also played Video 2.

From the pool of viewers that engaged with video 1 and went on to play video 2 (the blue dots above), we identify the subset of viewers that engaged with Video 2 (green dots below).

With this data we can calculate an engagement ratio to which we then apply a sample size correction.

The PEER model also addresses a symmetry problem that arises within some common association algorithms. A simple way to think about this problem is to imagine an e-commerce use case. While shoppers that buy beds may likely buy sheets, the reverse is not true: shoppers that buy sheets for a bed are not very likely to buy a bed. Having a group of customers that buys beds and bedsheets together does not necessarily mean that beds should be recommended to buyers of bedsheets.

This type of symmetry question is relevant for video recommendations as well. Just because a set of viewers watched Videos A and B does not necessarily mean that one should recommend Video A every time a viewer watches Video B. The PEER model addresses this issue of symmetry and accounts for the order in which videos are watched together.

Content similarity layer

When our engine cannot build sufficient associations between videos, the Recommendations engine uses metadata — such as video title, description, and associated tags — to compute the semantic similarity between two videos. This is particularly valuable in the case of brand new videos that don’t yet have data to be used for inferring associations to other videos.

Trending layer

In the event that neither the association layer nor the content similarity layer identifies strong signals, the Recommendations engine falls back to trending videos based on an Exponentially Weighted Moving Average (EWMA) of plays to highlight recently popular videos.

Why not build your own model

Now that I have explained our recommendations model, why not create your own in-house recommendations engine?

Due to the following two requirements, creating an in-house recommendations engine is not practically feasible for many:

  • Dedicated engineering and data science resources with different skillsets
  • Large and diverse data set to accelerate model improvement

Dedicated engineering resources and data science resources

A solution like Recommendations is comprised of multiple parts that require dedicated engineering resources to build. These parts include the generation of the data to be used in the different layers, the structuring of the data to be consumed by the models, data pipelines to access and serve the data needed to compute all the different scores and make recommendations, an A/B testing infrastructure to test new features and improve the model, building of mechanisms to track anomalies and performance for the different layers of the algorithm, and constant maintenance of the entire infrastructure to ensure reliable service.

Large and diverse data set

In order to support and improve our recommendations engine, JW Player also benefits from a uniquely broad data set that helps us learn and innovate quickly. Working with thousands of media companies gives us a tremendous network from which to draw insight and inspiration, and allows us to draw more robust conclusions from experiments conducted at scale. Any new model is thoroughly tested against our network to understand its strengths and weaknesses in different contexts, and what we learn is used to make improvements for all of our publishers. By leveraging a diverse set of publishers and viewers across our network, we’re able to shorten the improvement cycle for all of our customers.

Recommend videos with a pre-selected seed video

Now that you have an understanding of Recommendations, let’s explore how to implement this solution.

Assume that you have a JW Player web player that plays a single video:

jwplayer(“myElement”).setup({
playlist: “https://cdn.jwplayer.com/v2/media/Ly53q8A1"
});

You need to complete the following steps to add Recommendations to this setup:

1. Make a call to JW Player’s API (api.jwplatform.com/v1) using POST /channels/create?type=feed&title={title_name} to create a recommendations playlist. Be sure to replace {title_name} with a name for the playlist.

POST /channels/create?type=feed&title=An+awesome+feed&api_nonce=80684843&api_timestamp=1237387851&api_format=json&api_signature=12Three4567=&$-12Three4567=&$.EAk7kg.12Three4&api_key=abC432d1

2. Locate the eight-character, alphanumeric channel.key in the API response. This is the unique identifier for the recommendations playlist that you just created.

{
"status": "success",
"rate_limit": {
"reset": 1562880540,
"limit": 60,
"remaining": 60
},
"channel": {
"key": "n29tZc01"
},
"signature": "12Three4567=&$-12Three4567=&$.EAk7kg.12Three4"
}

3. In the playlist parameter of your player code, add a query string for the recommendations playlist (?recommendations_playlist_id={channel.key}) to the existing video URL. Be sure to replace {channel.key} with the key from the API response.

https://cdn.jwplayer.com/v2/media/Ly53q8A1?recommendations_playlist_id=n29tZc01

4. (Optional) Define the nextupoffset property to define when the Next Up pop-up appears. The Next Up display shows the name, thumbnail, and duration of the next video. The default value is -10.

5. Define the related.displayMode property. This property controls how recommended videos are displayed.

Suggested values include:

  • shelf (default)
  • shelfWidget

6. (Optional) Define the related.oncomplete as autoplay. This property helps to extend a viewer’s video play session.

jwplayer("myElement").setup({
playlist: "https://cdn.jwplayer.com/v2/media/Ly53q8A1?recommendations_playlist_id=n29tZc01",
nextupoffset: -15,
related: {
displayMode: "shelf",
oncomplete: "autoplay"
}
});

This setup recommends a set of videos based upon a chosen video (Ly53q8A1). Fifteen seconds before the end of the current video, a pop-up will appear that identifies the next video. Once the current video ends, the next video with automatically play.

Wrap-up

Recommendations is a solution that enables engineers and developers like you to extend the duration of your viewers’ video play sessions. We encourage you to add Recommendations to a page that already has a JW Player web player with your content. You can also read our developer documentation,Set up Recommendations, to learn how to add and customize functionality to this implementation.

If you work for a company that already uses JW Player, confirm with your JW Player representative that Recommendations has been enabled for your account. Otherwise, you can sign up for a personal developer account to experiment with Recommendations and many of the other features offered by JW Player.

--

--