Usage of the SDK constitutes your agreement with the Matterport SDK Agreement. Email developers@matterport.com with any questions.
Index
Types
AppState
Type declaration
-
application: App.Application
-
phase: App.Phase
Features
An observable collection of features and their state 'true' - Feature is available 'false' - Feature is not available 'undefined' - Feature availability cannot be determined.
State
Type declaration
-
application: App.Application
-
phase: App.Phase
-
phase
Times: object An object whose keys are phases from Phase and values are epoch time in milliseconds. The times are filled in after the phase has passed.
{ phaseTimes: { 'appphase.uninitialized': 1570084156590, 'appphase.waiting': 0, 'appphase.loading': 0, 'appphase.starting': 0, 'appphase.playing': 0, 'appphase.error': 0, } }
-
[phase: string]: number
-
Properties
features
Introduced 24.9.3
An observable list of features, their availability and their presence in Showcase.
App.features.subscribe({
onChanged(features) {
// room bounds setting has changed
if (features[App.Feature.RoomBounds] !== undefined) {
console.log('RoomBounds are ', features[App.Feature.RoomBounds] ? 'available' : 'unavailable');
}
else {
console.log('RoomBounds are unavailable.');
}
}
});
state
An observable application state object.
mpSdk.App.state.subscribe(function (appState) {
// app state has changed
console.log('The current application: ', appState.application);
console.log('The current phase: ', appState.phase);
console.log('Loaded at time ', appState.phaseTimes[mpSdk.App.Phase.LOADING]);
console.log('Started at time ', appState.phaseTimes[mpSdk.App.Phase.STARTING]);
});
output
> The current application: application.showcase
> The current phase: appphase.waiting
> Loaded at time 1570084156590
> Started at time 1570084156824
>
Methods
getLoadTimes
-
Returns Promise<object>
getState
-
Returns Promise<App.AppState>