Skip to main content

How To - Plugins

Plugins are set of optional components that adds additional ability to View360.

Adding plugins​

Plugins can be added in two ways.

1. Add plugins before initialization with the option plugins​

import View360, { ControlBar } from "@egjs/view360";

const viewer = new View360("#el_id", {
plugins: [new ControlBar()]
})

2. Add plugins at anytime with loadPlugins​

import View360, { ControlBar } from "@egjs/view360";

const viewer = new View360("#el_id");

viewer.loadPlugins(new ControlBar());

Removing plugins​

Plugins can be removed at anytime by calling removePlugins.
Otherwise, they will be removed when View360's destroy is called.

import View360, { ControlBar } from "@egjs/view360";

const plugin = new ControlBar();
const viewer = new View360("#el_id", {
plugins: [plugin]
});

// Remove control bar
viewer.removePlugins(plugin);