videojs-panorama icon indicating copy to clipboard operation
videojs-panorama copied to clipboard

How can I disable panorama after the plugin was initialized?

Open manuelsechi opened this issue 8 years ago • 9 comments

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

manuelsechi avatar Jan 19 '17 09:01 manuelsechi

Will work on it.

yanwsh avatar Feb 03 '17 04:02 yanwsh

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)

icetronics avatar Apr 19 '17 14:04 icetronics

+1

moshest avatar May 29 '17 09:05 moshest

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.

moshest avatar May 29 '17 12:05 moshest

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

paulomedia avatar Nov 19 '17 22:11 paulomedia

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

paulomedia avatar Nov 20 '17 09:11 paulomedia

hey, i noticed for some reason, it doesn't work. will work on it.

yanwsh avatar Nov 30 '17 07:11 yanwsh

+1

jjinkxy avatar Apr 09 '18 14:04 jjinkxy

+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

gaxunil avatar Jun 11 '18 22:06 gaxunil