import BaseObject from "./baseObject"; import UuidWrapper from "../../uuidWrapper"; import { ByteVector } from "../../byteVector"; import { ObjectType } from "../constants"; import { File } from "../../file"; /** * Flags that are set on a {@link FilePropertiesObject}. See {@link FilePropertiesObject.flags} for * more details. */ export declare enum FilePropertiesFlags { /** * The file is in the process of being created. */ Broadcast = 1, /** * The file is seekable. */ Seekable = 2 } /** * Extends {@link BaseObject} to provide a representation of an ASF file properties object. The * file properties object defines the global characteristics of the combined digital media streams * found within the Data object. */ export default class FilePropertiesObject extends BaseObject { private static readonly FILE_TIME_TO_UNIX_EPOCH; private _creationDateTicks; private _dataPacketsCount; private _fileId; private _fileSize; private _flags; private _maximumBitrate; private _maximumDataPacketSize; private _minimumDataPacketSize; private _playDurationTicks; private _prerollMilliseconds; private _sendDurationTicks; private constructor(); /** * Constructs a new instance by reading from a file. * @param file File to read the file properties object from * @param position Offset into the file where the object begins */ static fromFile(file: File, position: number): FilePropertiesObject; /** * Gets the creation date of the file described by the current instance. */ get creationDate(): Date; /** * Gets the number of packets in the data section of the file represented by the current * instance. */ get dataPacketsCount(): bigint; /** * Gets the GUID for the file described by the current instance. */ get fileId(): UuidWrapper; /** * Gets the total size of the file described by the current instance in bytes. */ get fileSize(): bigint; /** * Gets whether the file described by the current instance is broadcast or seekable. * @remarks * This attribute applies to presentation descriptors for ASF content. The value is a * bitwise OR of the flags in {@link FilePropertiesFlags}. * * If {@link FilePropertiesFlags.Broadcast} is set, the following properties are not * valid * * {@link fileId} * * {@link creationDate} * * {@link dataPacketsCount} * * {@link playDurationMilliseconds} * * {@link sendDurationMilliseconds} * * {@link maximumDataPacketSize} and {@link minimumDataPacketSize} are set to the * actual packet size * * If {@link FilePropertiesFlags.Seekable} is set, an audio stream is present and the * {@link maximumDataPacketSize} and {@link minimumDataPacketSize} are set to the same * size. It can also be seekable if the file has an audio stream and a video stream with * a matching simple index object. */ get flags(): number; /** * Gets the maximum instantaneous bit rate, in bits per second, for the file described by the * current instance. */ get maximumBitrate(): number; /** * Gets the maximum packet size, in bytes, for the file described by the current instance. */ get maximumDataPacketSize(): number; /** * Gets the minimum packet size, in bytes, for the file described by the current instance. */ get minimumDataPacketSize(): number; /** @inheritDoc */ get objectType(): ObjectType; /** * Gets the amount of time, in milliseconds, to buffer data before playing the file described * by the current instance. */ get prerollMilliseconds(): number; /** * Get the time needed to play the file described by the current instance in milliseconds. */ get playDurationMilliseconds(): number; /** * Get the time needed to send the file described by the current instance in milliseconds. A * packet's "send time" is the time when the packet should be delivered over the network, it is * not the presentation of the packet. */ get sendDurationMilliseconds(): number; /** @inheritDoc */ render(): ByteVector; }