If you are not looking for angular solutions, check out the Player embed-types here.
The best way to embed the player with Angular is dynamically, which allows you to generate the embed call only after all the component properties have been initialized.
We do this by putting the embed code in the
ngOnInit function, an angular lifecycle function, within the Video Components class.
Notice that in this scenario, the static script that loads the player should be in the
Be sure to fill in the missing information needed in the player script:
- partner_id:found in the KMC Integration Settings
- uiConf_id or player ID, found in the KMC studio or, if you’re using the API, by calling uiConf.list to see a full list of existing players.
- player_placeholder that corresponds to the div in the HTML code
- entry_id of the video that you wish to show in the player.
The auto embed is the simplest way to embed a player, is what would be generated in the KMC under share and embed. For this scenario we create the script dynamically, this time inside the
ngAfterViewInit function, another lifecycle hook that is called after Angular has fully initialized a component’s view, preventing the script from being deleted during initialization.
Here we create the iFrame inside the
ngAfterViewInit function as we did in the auto-embed.