Skip to main content

Function: clearPersisted()

function clearPersisted(storage: MediaSessionStorage, options?: PersistenceOptions): Promise<void>;

Defined in: packages/media-session/src/persistence.ts:915

Forget the persisted session.

Writes a channel-less record of the current schema version rather than deleting the key: MediaSessionStorage is two methods on purpose, and requiring removeItem would exclude storage engines that do not have one. restorePersisted reads the result as empty.

Storage failures reject — the caller asked for this one and can handle it.

Clears the app-facing record only. It is handed a storage engine, not a service, so it cannot reach the native resumption mirror; call PersistedMediaService.clear instead when a forgotten session should also stop being offered as a System UI resumption card.

Parameters

ParameterType
storageMediaSessionStorage
optionsPersistenceOptions

Returns

Promise<void>