Skip to main content

IEditableResourceFile

Hierarchy

Index

Properties

cacheToHardDisk

cacheToHardDisk: boolean

If this resource need to be cached:

  • For Android / iOS / Windows / macOS client, the file will be included in the resource package, if the developer is not selecting the bare building solution.
  • For Web version, the file will be cached with the Cache API or the IndexedDB API.

readonlyconvertedHash

convertedHash: { md5: string; xxHash: string }

The hash value of the file, Recative System provides two different hash for different use cases, xxHash is a faster hashing algorithm but MD5 has a better compatibility since many battery-included languages have a build-in MD5 implementation.


Type declaration

  • readonlymd5: string
  • readonlyxxHash: string

dirty

dirty: boolean

readonlyduration

duration: number

If the resource is a video or an audio, a numeric value should be provided to calculate the progress and timing of the playing process.

episodeIds

episodeIds: string[]

The episode id of this resource belongs to, we use this value to manage resource preloading and offline bundle building.

extensionConfigurations

extensionConfigurations: Record<string, string>

All configuration generated by Recative Studio, could be used by the player or interface components, like the audio backend or the atlas dimension information.

readonlyid

id: string

The unique ID of this resource file, for most of the case, the value is randomly generated by Nano ID while importing the resource. Some extension may use meaningful value. However, this is a very special case, except developers have a specific purpose, this value should always be a random ID to prevent any kind of conflict.

readonlyimportTime

importTime: number

The time of the file is imported.

label

label: string

Human readable label to identity the resource file, this field is manually filled by developers, developers should avoid name conflict, at lease for each episode or resource group.

Please notice if there is a resource group and a resource file with the same label, Recative System selects resource groups over resource files in preference.

managedBy

managedBy: string

A managed file means all managed fields will be locked, should never be changed manually.

For Recative Studio, while the target file changes, extension configuration not marked as nonMergeableResourceExtensionConfiguration and tags not end with ! will be applied to managed files.

Mergeable field is defined in the resource processor extension of Recative Studio.

readonlymimeType

mimeType: string

The MIME type of this resource file. For video and audio files, developers should avoid filling application/octet-stream, and provide codec information to this field or Safari may failed to play these media.

Recative Studio will automatically detect the type and codec of the media files, for developers that manually filling these fields, it is recommend to use this script to generate the MIME type with codec information for the media file.

readonlyoriginalHash

originalHash: string

The xxHash value of the file while importing.

This field is considered legacy. In earlier versions of Recative Studio, files might be imported with some pre-processing process, this field can help Recative System determine whether a particular file has been imported even after the file is converted. But this mechanism is considered to be harmful. We now process the files through an extension system. The converted files are stored in the database as a new file, and the original files are preserved, the new file and the original file are linked by the managedBy field.

preloadLevel

preloadLevel: PreloadLevel

If the resource need to be preloaded. Developers could set this field if the resources need to loaded when the act point or the episode starts playing. This is for providing a more complete first-screen experience, to avoid the visual experience regression caused by the image loading.

preloadTriggers

preloadTriggers: string[]
@deprecated

Legacy field, not using anywhere.

optionalredirectTo

redirectTo?: string

Use resource with the value of this field, instead this resource definition.

This should ONLY be available for online resource in production mode, the field will appear while multiple resources are merged into one group.

removed

removed: boolean

If the file is soft removed, Recative System do not remove files even if developers removed the file in the Recative Studio since the resource is possible to be published in production, remove the record of these resource is not safe.

removedTime

removedTime: number

The time of the file is removed.

resourceGroupId

resourceGroupId: string

The resource group of this resource file belongs to, provide an empty string if the resource file do not contains in any resource group.

This is a bi-directional field, developers should maintain this field and the files field of the resource group. Or the resource querying may not working correctly, Recative Studio did this automatically but if you are writing resource definition manually, please be careful.

tags

tags: string[]

Tags for smart resource selection, including the language, device type definition, the format is [field]:[value](!), like:

  • lang:en: Resource that used for English environment.
  • role:video!: The role of this resource for a video is the video channel, the tags would not be changed when the resource is managed or being merged.

readonlythumbnailSrc

thumbnailSrc: string

The URL of the thumbnail image, this field is only used in the Recative Studio, would not be uploaded to the CDN, and would not be used by any part of the Recative System.

readonlytype

type: file

The type of this resource, for a resource file, the value should be file.

url

url: Record<string, string>

A map of the url of this resource, the key is the identity of the uploader, this could be the name of the CDN or the name of the storage solution, like build-in resource of the package.