Files
Shade/packages/shade-media/src/index.ts
Sterister 7d45be8712 fix(media): an uploader checks the relay's upload status before trusting it
A chunk of 0 looped forever, a huge chunk held the film in memory and a huge
window opened a request (a thread on Kotlin) per piece. statusProblem checks
chunk, window, received and landed; the client window is capped at 16. Same
in MediaUploader, with tests on both sides.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-19 00:31:06 +02:00

42 lines
2.2 KiB
TypeScript

export * from './errors.js';
export {
MediaSealer,
MediaReader,
sealMediaStream,
sealMediaBytes,
validateMeta,
decodeFooter,
encodeFooter,
segmentCountFor,
sealedSizeFor,
DEFAULT_SEGMENT_SIZE,
MIN_SEGMENT_SIZE,
MAX_SEGMENT_SIZE,
FOOTER_BYTES,
} from './sealed.js';
export type { MediaMeta, MediaKeys, SealResult, SealOptions, ReaderOptions, Footer } from './sealed.js';
export { MemorySource, HttpRangeSource } from './source.js';
export type { RangeSource, HttpRangeSourceOptions } from './source.js';
export * from './grant.js';
export { OwnerKey, verifyOwner, READ_TOKEN_HEADER, READ_HASH_HEADER } from './owner.js';
export type { OwnerOp } from './owner.js';
export { MediaClient, openGrant, openAlbum, readAlbum, mediaUrl } from './client.js';
export { ALBUM_KIND, ALBUM_MIME, MAX_ALBUM_ITEMS, encodeAlbum, parseAlbum, isAlbum, albumMeta, isMediaGrant } from './album.js';
export type { Album } from './album.js';
export type { PutOptions } from './client.js';
export { MAX_PIECE_BYTES, DEFAULT_CHUNK_BYTES, MAX_UPLOAD_BYTES, MAX_CLIENT_WINDOW, OFFSET_HEADER, UPLOAD_WINDOW, chunkFor, statusProblem } from './upload.js';
export { LivePublisher, LiveSubscriber, epochKeys, chainStep, MAX_SKIP, MAX_SKIPPED_KEYS } from './live/channel.js';
export type { FrameOptions, PublisherOptions, GrantOptions, ReceivedFrame } from './live/channel.js';
export { encodeContent, decodeContent, decodeFrame, FLAG_STICKY, FLAG_KEYFRAME, FLAG_END } from './live/frame.js';
export type { LiveContent, FrameHeader } from './live/frame.js';
export { LivePublishClient, LiveWatchClient, liveUrl } from './live/client.js';
export type { LiveState, PublishOptions, WatchOptions } from './live/client.js';
export { MediaSplitter, sniffContainer } from './splitter.js';
export type { MediaPiece, LiveContainer } from './splitter.js';
export { WebmSplitter, webmMime } from './webm.js';
export type { WebmPiece } from './webm.js';
export { Fmp4Splitter, fmp4Mime } from './fmp4.js';
export type { Fmp4Piece } from './fmp4.js';
export { SUBTITLES_KEY, SUBTITLE_EXTENSIONS, withSubtitles, subtitlesOf, subtitleFor, srtToVtt } from './subtitles.js';
export type { SubtitleTrack } from './subtitles.js';