Player APIs (BrightScript & Ja...
JavaScript APIs
storage
5min
the storage object provides functions related to the player storage this object is available as of bos 9 0 168 system idl \[ constructor() ] interface storage { promise\<void> eject(string mountpoint); promise\<void> format(string mountpoint, string filesystemtype); }; object creation to create a storage object, first load the brightsign/storage module using the require() method then create an instance of the storage class var storageclass = require("@brightsign/storage"); var storage = new storageclass(); storage use this interface to call the following methods eject() promise\<void> eject(string mountpoint) the storage device is prepared for safe removal and may be physically ejected if that is supported by the storage device format() promise\<void> format(string mountpoint, string filesystemtype) formats the specified drive using one of the file systems listed below vfat (fat32, dos/windows file system) readable and writable by windows, linux, and macos exfat (dos/windows file system) supported on series 3, 4 and 5 players ext2 (linux file system) writable by linux and readable by windows and macos with additional software ext3 (linux file system) writable by linux and readable by windows and macos with additional software ext4 (linux file system) writable by linux and readable by windows and macos with additional software this is the recommended file system for ssd devices and usb hard drives examples const storage = require("@brightsign/storage"); let storage = new storage(); storage eject("/storage/sd") then(() => { console log("sd card can now be removed\n"); } ); const storage = require("@brightsign/storage"); let storage = new storage(); storage format("/storage/sd", "vfat") then(() => { console log("sd card has been formatted\n");});