Creating a Parent-Child video via API

Hey, im new the Kaltura and their API

I want to create a simple website where i can upload 2 videos and create the same effect you create via the Kaltura capture.

I dont need help with the frontend, but i dont understand how to structure the backend to create the “picture-in-picture” effect.
I have read the knowledge center:
But neither of them explain or show how to actually do it any form of code.

I would very much appriciate the help!

@mikkelh The underlying mechanics of a picture-in-picture playback is two (or more) media entries with one being the parent and the others being child entries that reference the parent. That reference is made through the ParentEntryId field in the child entry metadata.

NOTE: Once you convert an entry to a child by assigning ParentEntryId, you lose the ability to see that child entry in the KMC. The workaround for that is to select an entry you can see and then replace the entry id in the address bar with that of the child entry.

Here is some C# code for adding the child entry. Keep in mind that most of the metadata for the child entry will be unnecessary (and in some cases unable to be assigned) because the metadata from the parent entry is what is used for the parent/child combination.

MediaEntry entry = new MediaEntry();
entry.Name = "Child Entry Name";
entry.ParentEntryId = "{parentEntryId}";
entry.MediaType = MediaType.VIDEO;

Another approach would be to initially create the child entry as a standalone (without ParentEntryId assigned) with all the metadata you would normally provide, then update the entry to assign the ParentEntryId. This way you won’t get hit with an error for trying to assign a field that is unassignable on a child, and if you ever revert that entry back to a standalone entry, the additional information, like category, should already be there.

Please reach out if you have any other questions. -Dave

Hey Dave!

Thanks for the reply, But I figured it. I had a hard time finding the documentation for the way the API is using in C# as the workflows and other examples I found, I did not see anything about the “.ExecuteAndWaitForResponse(client)”.
The workflow showed something completely different and guess it confused me on how to implement the API into my solution :blush:

But thanks again for the reply!