Koji.playerState.hideChrome();
Manages the state of the Koji player to enable distinct experiences for different users and views.
Hides any Koji player chrome, such as the user’s profile icon. To display the player chrome, use [[showChrome]].
Note
|
Incorrectly controlling the player chrome can result in a disorienting user experience, so use this functionality judiciously.
The player chrome must be displayed on all root screens of an app. It can be hidden if a user navigates to a child screen, such as a modal.
The player chrome is hidden by default when the app’s presentationStyle is popover .
|
Koji.playerState.hideChrome();
Listens for event notifications that the Koji app lost the focus and then invokes a callback function to respond to the focus state change.
callback
- BlurCallback, Function to handle when the Koji app loses the focus.
Function, Function to unsubscribe from the onBlur listener.
const unsubscribeBlur = Koji.playerState.onBlur((blur) => {
// Change Koji experience
});
Listens for event notifications that the Koji app got the focus and then invokes a callback function to respond to the focus state change.
callback
- FocusCallback, Function to handle when the Koji app gets the focus.
Function, Function to unsubscribe from the onFocus listener.
const unsubscribeFocus = Koji.playerState.onFocus((focus) => {
// Change Koji experience
});
Restores the Koji platform chrome, if it has been hidden with [[hideChrome]].
Koji.playerState.showChrome();
Listens to changes in customization mode and invokes a callback function to enable different experiences during customization, preview, or use.
callback
- IsRemixingCallback, Function to handle changes in customization mode.
Function, Function to unsubscribe from the customization mode listener.
const unsubscribe = Koji.playerState.subscribe((remixing, { type, mode }) => {
// Change Koji experience
});
PlayerStateContext, Context of the Koji app.
Boolean, Focus state of the Koji app.
Boolean, Whether the player chrome (Koji platform buttons and navigation) is visible.
PlayerPresentationStyle, Presentation style of the Koji app.
'buyer' | 'seller', Type of receipt.
Describes the editor that the creator is using.
mode
- 'edit' | 'new' (Optional), Distinguishes between creating a `new` customized version of the app and doing an `edit` of the user’s existing Koji app.
type
- 'instant' | 'full' (Optional), Type of editor the creator is using, either `instant` for the Koji player or `full` for the Koji code editor.
Function to handle when the Koji app loses focus. Invoked by the [[onBlur]] listener.
Distinguishes between creating a `new` customized version of the app and doing an `edit` of the user’s existing Koji app.
Type of editor the creator is using, either `instant` for the Koji player or `full` for the Koji code editor.
Function to handle when the Koji app gets focus. Invoked by the [[onFocus]] listener.
Function to handle changes in the customization mode. Invoked by the [[subscribe]] listener.
isRemixing
- Boolean, Indicates whether the app is in customization mode.
editorAttributes
- EditorAttributes, Describes the editor that the creator is using.
Presentation style of the Koji app, either in a modal window (`popover`) or the standard player (`fullscreen`). The player chrome (including the user's profile icon) is hidden by default when the app's `presentationStyle` is `popover`.
Context in which the Koji app is being viewed. A Koji app can provide a distinct experience for each context.
View of the receipt for a transaction, either `buyer` or `seller`.
Who is viewing the receipt for a transaction, either `buyer` or `seller`.