Similar to sharing, the related API examples below will assume that the following code is implemented:
.on('ready', function(event){
relatedPlugin = jwplayer().getPlugin('related');
});
relatedPlugin.open();
Opens the recommendations user interface. If the displayMode
is set to overlay, this will pause content if it is currently playing.
Value | Description | Type |
---|---|---|
- | No value returned | - |
relatedPlugin.close();
Closes the recommendations user interface. This will resume content.
Value | Description | Type |
---|---|---|
- | No value returned | - |
relatedPlugin.on('open');
Triggers when the recommendations interface is opened.
Returns an object with the following:
Value | Description | Type |
---|---|---|
method | The method used to open the plugin. (api, complete, or click) | String |
url | URL of the feed that was loaded into the player. | String |
items | An object of all objects that have been loaded into the related plugin. | Object |
relatedPlugin.on('close');
Triggers when the recommendations interface is closed.
Returns an object with the following:
Value | Description | Type |
---|---|---|
method | The method used to open the plugin. (api, complete, or click) | string |
relatedPlugin.on('play');
Triggers when a user selects an object in a related feed.
Returns an object with the following:
Value | Description | Type |
---|---|---|
item | Metadata for the chosen item specified in the feed. | Object |
auto | Returns true if started via autoplay; false if manually started. | Boolean |
position | Ordinal position of the related video that has been chosen. | Number |