Context

Context format

Context is a plain javascript object where keys are mimetypes.
All mime types are optional and depend on your current context.

For example:

{
     "text/plain": "1v6a002",
     "text/x.avid.asset-list": "interplay-pam:20AB378F-2BA3-4C34-912C-CB6ADEA3172E:masterclip:060a2b340101010101010f0013-000000-54171a7154f91090-060e2b347f7f-2a80",
     "text/x.avid.location-item-list": "interplay-pam:20AB378F-2BA3-4C34-912C-CB6ADEA3172E:folder-item:/Projects/mike/060a2b340101010101010f0013-000000-54171a7154f91090-060e2b347f7f-2a80"
     "text/x.avid.asset-list+json": [{
        "systemType":"interplay-pam",
        "systemID":"20AB378F-2BA3-4C34-912C-CB6ADEA3172E",
        "type":"sequence",
        "id":"060a2b340101010101010f0013-000000-bfb98d6a74e200a5-dbffd4686e88-1a5a"
     }]
};

There are some predefined mimeTypes:

  • text/plain
  • text/x.avid.asset-list contains globaID of asset ( systemType:systemID:type:id )
  • text/x.avid.location-item-list contains globalID of location item ( systemType:systemID:type:id )
  • text/x.avid.asset-list+json contains the same info as in text/x.avid.asset-list but in JSON format

Deprecated context formats

These mime-types are already deprecated and should be replaced by types listed above

  • text/plain
  • text/x-avid.asset-list
  • text/x-avid.location-item-list

Event data format

Event data is a plain javascript object. The object is optional and could be different (depends on specific needs).

For example (adding to context key modifiers):

{
    keys: {
        ctrlKey: true,
        shiftKey: false,
        metaKey: false,
        altKey: false
    }
};

How to open the context in another app

An application can request context change by dispatching the event:

 dispatch('appContextChange', context)
 

or

dispatch('appContextChange', context, eventData) 

Before v2020.4

The docked application can change the context for the main application and the asset inspector.

The main application can change the context for the asset inspector only.

Starting with v2020.4

If an application requests context opening, the default application opens the context if the user sets the preference.
If there is no preference, the most specific app opens the context.
The most specific app is chosen according to the application specificity rules.
For details, see Application Allowed Context.

How to react on context change request

If an application should change its context by requests from other apps or restore its state from a deeplink,
implement the method setContext.

How to notify about inner app context change

If an application wants to restore its context from a deeplink and change the browser history,
implement the method getContext and use the event
appStateChange.

Context use in the AssetEditor/player

The AssetEditor/player will load assets from a context that includes one of the standard mimetypes:

  • text/x.avid.asset-list+json
  • text/x.avid.asset-list

In addition, the following are available:

  • text/x.avid.asset-list-extended+json
    • an extension of text/x.avid.asset-list+json with added parameters {in, out, head} for setting markin/markout/playhead when the asset is loaded into the player
  • text/x.avid.player-options+json
    • JSON object with player load options:
      • frame: set playhead at frame
      • mode: ‘Output’ | ‘Asset’ - load asset into specified monitor
      • noReload: boolean - true = if already loaded, don’t reload