/*jshint esversion: 6 */ let player; function changeStream() { player.destroy(); startStream(); } function startStream() { const canvas = document.getElementById('streamStage'); player = new JSMpeg.Player('ws://' + document.location.host + '/stream', {canvas:canvas}); }