Skip to content

Commit 4eba4dc

Browse files
committed
fix: allow type to be 'text' or 'audio' and now text_type is optional because you don't pass text_type for multi-track audio
1 parent 434b808 commit 4eba4dc

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/video/domain.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ export interface CreatePlaybackIdParams {
217217

218218
export interface CreateTrackParams {
219219
url: string;
220-
type: 'text';
221-
text_type: 'subtitles';
220+
type: 'text' | 'audio';
221+
text_type?: 'subtitles';
222222
language_code: string;
223223
name?: string;
224224
closed_captions?: boolean;

src/video/resources/assets.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ export class Assets extends Base {
265265
}
266266

267267
if (!params) {
268-
return Promise.reject(new Error('Text track params are required'));
268+
return Promise.reject(new Error('Track params are required'));
269269
}
270270
return this.http.post(`${buildBasePath(assetId)}/tracks`, params);
271271
}

test/unit/video/resources/assets.spec.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ describe('Unit::Assets', () => {
235235
})
236236
.catch((err) => {
237237
expect(err).to.exist;
238-
expect(err.message).to.equal('Text track params are required');
238+
expect(err.message).to.equal('Track params are required');
239239
}));
240240
});
241241

0 commit comments

Comments
 (0)