Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to update player config when the playlist item is being switched? #700

Open
2 of 6 tasks
achievement-sambo-visal opened this issue Jan 9, 2024 · 0 comments
Open
2 of 6 tasks

Comments

@achievement-sambo-visal
Copy link

Prerequisites

I tried to load playlist items by using kalturaPlayer.loadPlaylistByEntryList({entries: [{entryId: '123'}, {entryId: '456'}]}, {countdown: {duration: 20}});
And below is my player config

const kalturaPlayer = KalturaPlayer.setup({
      "sources": {
        "options": {},
      },
      "targetId": "player-placeholder",
      "ui": {
        "components": {},
        "settings": {
          "showSpeedMenu": true,
        }
      },
      "provider": {
        "partnerId": PARTNER_ID,
        "uiConfId": UI_CONFIG_ID,
        "ks": KS_SESSION
      },
      "playback": {
        "autoplay": true,
        "allowMutedAutoPlay": true,
        "playsinline": true,
        "textLanguage": "default",
        "pictureInPicture": false,
        "inBrowserFullscreen": false,
      },
      "plugins": {
        "share": {
          "disable": true
        },
        "download": {
          "disable": true
        },
        "report": {
          "disable": true
        }
      }
    });

If you noticed I config the player with KS in order to play the video. I used my own API to get the player KS by passing the entry_id.
So when the player is being loaded, I called API to get the KS and play the video.

Since I wanted to use playlist feature, So when the entry is being switched to next or previous, I want to get the entry_id and update player config KS when the entry is being played.

kalturaPlayer.addEventListener(KalturaPlayer.playlist.PlaylistEventType.PLAYLIST_ITEM_CHANGED, () => {
   // get entry_id ? // then call my own API to get KS // then update player config with the new KS // then play the media
});

I also checked with the kaltura change-media API but I could not solve my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant