Skip to content

Commit

Permalink
fix: playlist by tag (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsi authored Feb 12, 2024
1 parent d52e4b6 commit 519e737
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/plugins/playlist/playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const playlist = (player, options = {}) => {
player.cloudinary.sourcesByTag = async (tag, options = {}) => {
const url = getCloudinaryUrl(
tag,
Object.assign(player.cloudinary.cloudinaryConfig(), LIST_BY_TAG_PARAMS)
Object.assign({}, player.cloudinary.cloudinaryConfig(), LIST_BY_TAG_PARAMS)
);

const result = await fetch(url);
Expand Down
4 changes: 2 additions & 2 deletions src/video-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ class VideoPlayer extends Utils.mixin(Eventable) {
playlist(sources, options = {}) {
options = Utils.assign({}, options, { playlistWidget: this.playerOptions.playlistWidget });

this.videojs.on(PLAYER_EVENT.READY, async () => {
this.videojs.one(PLAYER_EVENT.READY, async () => {
const playlistPlugin = await this.videojs.playlist(options);
playlistPlugin(sources, options);
});
Expand All @@ -588,7 +588,7 @@ class VideoPlayer extends Utils.mixin(Eventable) {
options = Utils.assign({}, options, { playlistWidget: this.playerOptions.playlistWidget });

return new Promise((resolve) => {
this.videojs.on(PLAYER_EVENT.READY, async () => {
this.videojs.one(PLAYER_EVENT.READY, async () => {
const playlistPlugin = await this.videojs.playlist(options);
playlistPlugin(await this.sourcesByTag(tag, options), options);
resolve(this);
Expand Down

0 comments on commit 519e737

Please sign in to comment.