Get related videos of particular media

How do we get related videos using Kaltura javascript API?
Which service/action should be used to get all related videos of particular media ?
Thanks in advance for your help

What you should do is search the media tags. You can filter
namespace Kaltura{
class CodeExample{
static void Main(string[] args){
KalturaConfiguration config = new KalturaConfiguration(partnerId);
config.ServiceUrl = “”;
KalturaClient client = new KalturaClient(config);
KalturaBaseEntryFilter filter = new KalturaBaseEntryFilter();
String filter.tagsMultiLikeOr = “something”;
String filter.tagsMultiLikeAnd = “othersomething”;

KalturaFilterPager pager = null;
Object result = client.BaseEntryService.List(filter, pager);
}

You can also decide to show entries where the name of entry is similar to current, etc…

Thank you jess for your answer. I hope it will solve my problem :slight_smile:

Most welcome. Enjoy.

Hi Jess, is it possible to send bunch of media id’s from different categories and get a single playlist of those media id’s with all the associated information ?? for example, let say i send media id’s 10,11,66,78 in single request and get single playlist of containing that videos

Hi,

Not 100% sure I understand your question but the way to create a playlist is:
$playlist = new KalturaPlaylist();
$playlist->name = ‘test2’;
$playlist->type = KalturaEntryType::AUTOMATIC;
// the entry IDs you want to include:
$playlist->playlistContent = ‘0_k1p0dlpl,0_x60ncudo,0_x60ncudo’;
$playlist->playlistType = KalturaPlaylistType::STATIC_LIST;
$updateStats = null;
$result = $client->playlist->add($playlist, $updateStats);

Thanks for your reply. Can you please show me the code snippet for kWidget.embed in javascript. I want to play the videos without refreshing the page

http://player.kaltura.com/docs/index.php?path=kwidget

After using kwidget i am getting this error: Error getting sources from server. Please try again. Invalid playlist type. What could be the reason ?

Look at the error logs on the server side under /opt/kaltura/log/kaltura_api_v3.log if you are running you own hosted ENV.
If you are working on SaaS, you won’t be able to access these logs though.

Please attach your full code here while masking partnerId and secrets.

This is the code:

<*iv id=“myVideoTarget” style=“width:400px;height:330px;”></*iv>

HTML5LIB script
<scrit>
kWidget.embed({
‘targetId’: ‘myVideoTarget’,
‘wid’: ‘{PARTNER_ID}’,
‘uiconf_id’ : ‘{uiConfId}’,
‘entry_id’ : '1
*****8e’,
‘flashvars’: {
‘playlistAPI’:{
‘plugin’: true,
‘includeInLayout’: true,
‘autoPlay’: false,
‘autoInsert’:true,
‘kpl0Name’ : ‘test 4 item playlist’,
‘kpl0Url’ : 'http://www.kaltura.com/index.php/partnerservices2/executeplaylist?uid={uiConfId}&partner_id={PARTNER_ID}&subp_id={PARTNER_ID}00&format=8&ks={KS}&playlist_id=1_lz
**dt’
}
}
});
</scri
t>

Try:
# curl -I -v ‘http://www.kaltura.com/index.php/partnerservices2/executeplaylist?uid={uiConfId}&partner_id={PARTNER_ID}&subp_id={PARTNER_ID}00&format=8&ks={KS}&playlist_id=1_lz****dt

Replacing the tokens with proper values… what are you getting back?

Hi Jess, I want to play the video without refreshing the page. Currently, I am using autoembed script inside div elements. Currently, sending entry_id in query string but this needs page refresh. Is there any way to achieve the same without refreshing the page ?

Hi,

If you use a playlist then you can just move to the next entry without reloading the page.

Hi Jess, I am getting following error after using iframe embed along with “Access is denied”. Can you please tell me the reason ? I am dynamically appending src to iframe.

http://cdnapi.kaltura.com/html5/html5lib/v2.28/load.php?debug=false&lang=en&modules=acCheck,acPreview,base64_encode,class,controlBarContainer,currentTimeLabel,downloadPlugin,durationLabel,fullScreenBtn,kdark,keyboardShortcuts,largePlayBtn,liveAnalytics,liveStream,logo,matchMedia,nativeBridge,playPauseBtn,reportError,screenfull,scrubber,sideBarContainer,statisticsPlugin,topBarContainer,utf8_encode,volumeControl,watermarkPlugin|jquery.client,color,cookie,debouncedresize,hoverIntent,messageBox,mwEmbedUtil,mwExtension,naturalSize|

Thank you Jess for your valuable time and help you did.