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>Code snippet
<script>let new_source = {source: { src: "//path-to-video_playlist.m3u8", type: "application/x-mpegURL" }});player.changeSource(new_source);</script>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 from .vtt file. “Tears of Steel” video includes 4x subtitles and video chapters, all loaded from .vtt files.