Changing video source

Coffee
Santorini
Tears of Steel
The Nuevo plugin features a dedicated function to change video sources in a fast and relatively easy way. Besides video source, you can also define poster image, text tracks (subtitles, chapters, progress bar thumbnails), video title and description, video id, video url, and whatever other attribute that video.js or Nuevo plugin supports for individual media items.

The most simple usage of changeSource() function is to provide a new media source and type:
Code snippet
<script>
let new_source = {
sources: [
{ src: "//path-to-video.mp4", type: "video/mp4" },
{ src: "//path-to-video.webm", type: "video/webm" }
]
});
player.changeSource(new_source);
</script>
If new source is single HLS or DASH playlist:
Code snippet
<script>
let new_source = {
source: { src: "//path-to-video_playlist.m3u8", type: "application/x-mpegURL" }
});
player.changeSource(new_source);
</script>
As mentioned above, it is possible to define the poster image, text tracks, video title and description, video id, video permalink, embed code, and other possible parameters of the media item. The only required parameter is "sources." All other parameters are optional.
Code snippet
<script>
let new_source = {
source: { src: "//path-to-video_playlist.m3u8", type: "application/x-mpegURL" },
video_id: "media unique id",
title: "media title",
description: "media description",
url: "media permalink",
poster: "media poster",
embed: "embed_code",
infoTitle: "optional title display",
infoDescription: "optional description display",
slideImage: "path-to-progress-bar-thumbs-slide-image",
tracks: [
{ kind:"captions" src:"path-to-captions_en.vtt", srclang:"en", label:"English" default:1 },
{ kind:"captions" src:"path-to-captions_de.vtt", srclang:"de", label:"German" },
{ kind:"captions" src:"path-to-captions_fr.vtt", srclang:"fr", label:"French" },
{ kind:"chapters" src:"path-to-chapters.vtt", srclang:"en" },
]
});
player.changeSource(new_source);
</script>

The video presentation above allows you to switch between three videos. “Coffee” HLS video includes 2x subtitles loaded from .vtt files and progress-bar thumbs from slideImage. “Santorini” HLS video includes progress-bar thumbs loaded form .vtt file. “Tears of Steel” video includes 4x subtitles and video chapters, all loaded from .vtt files.