videojs-panorama
videojs-panorama copied to clipboard
How can I disable panorama after the plugin was initialized?
after I initialised panorama for a 360 video I would like to disable it if the next one is not a 360 one, and I am not reloading the page so I'd need to programmaticaly disable it.
thanks M
Will work on it.
Hi, are there any updates on this one? @yanwsh, could you please give pointers at least how the panorama plugin can be removed from a vjs instance? (e.g. remove canvas, etc)
+1
This is what I using in order to remove the panorama:
const canvas = player.getChild('Canvas');
if (!canvas) return;
canvas.handleDispose(); // doing nothing, see issue #100
canvas.startAnimation = () => {}; // fix bug on handleDispose method
player.removeChild('Canvas');
player.removeChild('HelperCanvas');
player.removeChild('Notice');
player.controlBar.removeChild('VRButton');
delete player.tech({ IWillNotUseThisInPlugins: true }).el().style.display;
UPDATE: handleDispose()
method is buggy, see issue #100.
Hi I'm try your solution with
player.removeChild('Canvas');
but, i can hear the audio and can not watch the video, we have to try do something more than that.
I'm trying to temporarily find a method to disable the plugin and activate it, basing me in videojs-panorama.v5.js, while we wait for a solution from yanwsh
I can see the vídeo changing the display to 'block'
player.tech({ IWillNotUseThisInPlugins: true }).el().style.display = 'block';
,
That's the reason why I did not see the video, when I deleted it.
delete player.tech({ IWillNotUseThisInPlugins: true }).el().style.display;
the vídeo not change the display to block value.
Best regards
hey, i noticed for some reason, it doesn't work. will work on it.
+1
+1 - I need a way to toggle the panorama dewarpping etc on and off. We have 360 fish eye video and I need to enable a way for the user to trigger the nice things the panorama plugin does for us, but also be able to disable it and return to round, fisheye view (no dewarpping, panorama plugin essentially disabled). I could work on adding this and getting up a PR - any guidance on the general things that need to be done? @yanwsh