Open hate7354 opened 5 months ago
The canvas element is only removed if it was created by JSMpeg in the first place. If you want to keep the canvas, create it outside of JSMpeg and pass it in as an option. E.g.
<canvas id="video-canvas"></canvas>
var element = document.getElementById('video-canvas');
var player = new JSMpeg.Player('file.ts', {canvas: element});
// this will not remove the canvas, since it was not created by jsmpeg
player.destroy();
When executing player.destroy(), the canvas is destroyed. What should I do because I want to use all functions of destroy() without destroying the canvas?