Add batch ingest, tree depth/path, peer scoring helpers, scheduler peek, FEC and ABR controls, telemetry sessions, and richer production api.md for bandwidth-aggregator and media-tree-orchestrator. Co-authored-by: Cursor <[email protected]>
19 lines
577 B
JavaScript
19 lines
577 B
JavaScript
require('bare-process/global')
|
|
const test = require('brittle')
|
|
const { HyperP2PMediaChunker, PROTOCOL } = require('../index.js')
|
|
|
|
test('exports', (t) => {
|
|
t.ok(HyperP2PMediaChunker)
|
|
t.is(PROTOCOL, 'media-chunker/v1')
|
|
})
|
|
|
|
test('segment and list', async (t) => {
|
|
const m = new HyperP2PMediaChunker({ chunkSize: 4 })
|
|
const chunks = m.segment(Buffer.from('abcdefghij'), { streamId: 's1', keyframe: true })
|
|
t.ok(chunks.length >= 2)
|
|
t.is(m.listChunks('s1').length, chunks.length)
|
|
t.ok(m.keyframeIndices('s1').length)
|
|
t.is(m.totalBytes('s1'), 10)
|
|
await m.close()
|
|
})
|