How can I add youtube video in kaltura with php?


#1

I have kaltura community edition
I want to add youtube video to kaltura with PHP as well as from console
So, How can I do that?


#2

I see that mediaspace allows you to upload YouTube videos. It then shows you the YouTube video but in the Kaltura video player. Is it possible to get this same functionality within Kaltura CE.


#3

Hello,

It is since MediaSpace uses the server API to accomplish everything it does. Therefore, you could code a similar solution using the API.


#4

Server API means? may use that in my kaltura community edition?
Which type of code i have to do for that?
Can you please give me such example or something?


#5

See my answer here:

Basically, you first need to either download the vidoe using something like youtube-dl and then upload it to Kaltura or, if you somehow have a direct download URL for the video, which I suppose you would IF you are the valid owner, you can just ingest it directly by either using bulk upload, passing a CSV or XML with the direct URL to the video or using something along the lines of:

$entryId = null;
$resource = new KalturaUrlResource();
$resource->url = 'http://youtube.com/bla/blah';
$conversionProfileId = null;
$advancedOptions = null;
$result = $client->baseEntry->updatecontent($entryId, $resource, $conversionProfileId, $advancedOptions);

Again note that both bulk upload and using baseEntry->updatecontent() depend on you having a direct URL to download the youtube video, just supplying the youtube viewing URL will not work, of course.


#6

I thought MediaSpace was simply streaming YouTube video directly from YouTube with their watermarks and everything. kinda like embedding or streaming the YouTube video with the Kaltura video player. Is this the fuctionally being used in this instance. I do not know their are tools to grab videos off YouTube however I see more larger sites just stream the watermarked YouTube content using their own players. It saves on bandwidth, storage and CPU usage. Generally, as long as your configuration does not block the YouTube ads they don’t mind cause they are still generating revenue off your traffic.


#7

This is another option, you can easily do so with the API, something like this:

$client = new KalturaClient($config);
$entry = new KalturaExternalMediaEntry();
$entry->searchProviderType = KalturaSearchProviderType::YOUTUBE;
$result = $client->baseEntry->add($entry, $type);

#8

did you find the solution to that problem ?
i find this :
https://developer.kaltura.com/console/#/externalMedia.add

but i can make the video play ! its upload an empty video (??)
and when im trying to run the code nothing happens !!


#9

Hi Jess

We have followed the method below but entries are not showing in KMC tho if we query it in the admin console, the entry is showing.

$client = new KalturaClient($config);
$entry = new KalturaExternalMediaEntry();
$entry->searchProviderType = KalturaSearchProviderType::YOUTUBE;
$result = $client->baseEntry->add($entry, $type);

How would we be able to play these entries pls?


#10

Did anyone find any solution to this? I want to attach a youtube video using the youtube URL to a kaltura media entry.