Skip to content

Commit 5f7da6e

Browse files
feat: support profiles in default videoPlayer method
Co-Authored-By: Tsachi Shlidor <tsachi.shlidor@cloudinary.com> Co-Authored-By: cloudinary-jenkins <jenkins@cloudinary.com>
1 parent 5518a84 commit 5f7da6e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/index.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ const getConfig = (playerOptions = {}, cloudinaryConfig) => {
1414
});
1515
};
1616

17-
const getVideoPlayer = config => (id, playerOptions, ready) =>
18-
new VideoPlayer(id, getConfig(playerOptions, config), ready);
17+
const getVideoPlayer = config => (id, playerOptions, ready) => {
18+
if (playerOptions?.profile) {
19+
return createVideoPlayerProfile(id, getConfig(playerOptions, config), ready);
20+
}
21+
return new VideoPlayer(id, getConfig(playerOptions, config), ready);
22+
};
1923

2024
const getVideoPlayers = config => (selector, playerOptions, ready) =>
2125
VideoPlayer.all(selector, getConfig(playerOptions, config), ready);

0 commit comments

Comments
 (0)