Asset Inspector

Player

setContext

Optional

If defined, used to set context for view.

    /**
     * Set  context.
     * @param {Object} context
     * @param {Object} eventData
     */
    setContext(context, eventData) {
        //
    }
    

See section Context for format detail.

Refresh

Optional

If defined, used to refresh view state:

    refresh() {
        // update media status
    }    

It should be available in the publicScope.

setDispatcher

Optional

    /**
     * Set dispatcher. It should be available in the publicScope.
     * @param {Function} dispatch
     */
    setDispatcher(dispatch) {
        this.dispatch = dispatch;
    }

Use

    //Will change context all tabs except player
    this.dispatch('contextChange', context);

Tabs

setContext

Optional

If defined, used to set context for view.

    /**
     * Set  context
     * @param {Object} context
     * @param {Object} eventData
     */
    setContext(context, eventData) {
        //
    }
    

See section Context for format detail.

Refresh

Optional

If defined, used to refresh view state:

    refresh() {
        // update tab
    }
        

It should be available in the publicScope.

Defining tabs

To define new Inspector tab you should add such config into your avid array exported from your plugin:

    {
        name: 'temp',
        provides: ['tabs'],
        create: () => {
            return {
                type: 'av-metadata',
                order: 100
            };
        }
    }
  • type is an id to show in this tab
  • order is an order of this tab in a list. the beginnig of list is 100, next tab is 200 etc…

Receiving all tabs

To receive all registered tabs you have to specify such config into your avid array exported from your plugin:

    {
        requires: {
            tabs: "*"
        },
        start: true,
        create: (deps, meta) => {}
    }
  • {meta} contains tabs array with tabs names
  • {deps} contains tabs array with config returned by create method of this tab