Prepare an array of related videos
Code snippet
<script>var related_videos = [{thumb: '//domain.com/path/to/video_thumb_1.jpg',url: '//domain.com/path/to/video_1.html', title: 'Video 1 title', duration: '05:30'},{thumb: '//domain.com/path/to/video_thumb_2.jpg',url: '//domain.com/path/to/video_2.html', title: 'Video 2 title', duration: '05:30'},{thumb: '//domain.com/path/to/video_thumb_3.jpg',url: '//domain.com/path/to/video_3.html', title: 'Video 3 title', duration: '05:30'},{thumb: '//domain.com/path/to/video_thumb_4.jpg',url: '//domain.com/path/to/video_4.html', title: 'Video 4 title', duration: '05:30'},{thumb: '//domain.com/path/to/video_thumb_5.jpg',url: '//domain.com/path/to/video_5.html', title: 'Video 5 title', duration: '05:30'},{thumb: '//domain.com/path/to/video_thumb_6.jpg',url: '//domain.com/path/to/video_6.html', title: 'Video 6 title', duration: '05:30'}];</script>Nuevo plugin setup code
Once the related_videos array is defined, you can assign it as a related option among other Nuevo plugin's options, like in the player setup code below for one video available in multiple resolutions.
Code snippet
<script>const player = videojs('my_player', {license: "key"});player.nuevo({logo: '//domain.com/path/to/logo.png',logourl: '//domain.com',related: related_videos});</script>Show Related programmatically
The Nuevo plugin features a public function player.related(), which allows to show related videos container programmatically. For example, if you wish to display a related container on each pause event:Code snippet
player.on("pause", function(){player.related();});