Skip to content

Commit c3f6413

Browse files
authored
fix: cld errors return videojs errors (#872)
1 parent dd71bfe commit c3f6413

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/plugins/cloudinary/models/video-source/video-source.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ class VideoSource extends BaseSource {
5252
'publicId', // BaseSource method
5353
'cloudinaryConfig', // BaseSource method
5454
'transformation', // BaseSource method
55-
'queryParams' // BaseSource method
55+
'queryParams', // BaseSource method
56+
'type' // BaseSource handles getType()
5657
];
5758
const SIMPLE_PROPERTIES = SOURCE_PARAMS.filter(param => !EXCLUDED_PROPERTIES.includes(param));
5859

test/unit/videoSource.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import VideoSource from '../../src/plugins/cloudinary/models/video-source/video-source.js';
22
import { hasCodec } from '../../src/plugins/cloudinary/models/video-source/video-source.utils';
3+
import { SOURCE_TYPE } from '../../src/utils/consts';
34
import '../../src/';
45
const cld = { cloud_name: 'demo' };
56

@@ -297,6 +298,15 @@ describe('tests withCredentials', () => {
297298
});
298299
});
299300

301+
describe('getType method tests', () => {
302+
it('should return VIDEO source type', () => {
303+
let sourceDef = {
304+
cloudinaryConfig: cld
305+
};
306+
let source = new VideoSource('sea_turtle', sourceDef);
307+
expect(source.getType()).toEqual(SOURCE_TYPE.VIDEO);
308+
});
309+
});
300310

301311
describe('test hasCodec method', () => {
302312

0 commit comments

Comments
 (0)