Playlist order by

I’ve created a playlist that shows only entries created since a certain date.

I try to order the results by plays and it does not work.

does anyone have any experience with this?


Please share your code but basically, the following should work:

$client = new KalturaClient($config);
$filter = new KalturaMediaEntryFilter();
$filter->orderBy = '-plays';
$pager = null;
$result = $client->baseEntry->listAction($filter, $pager);

You can also do “+plays” to reverse the order, i.e asc or desc.

when trying to filter a playlist using -plays it does not work correctly.
No actual order is being applied:

$client = new KalturaClient($config);
$id = ‘0_b8kxlslx’;
$detailed = null;
$playlistContext = null;
$filter = new KalturaMediaEntryFilterForPlaylist();
$filter->orderBy = ‘-plays’;
$pager = null;
$result = $client->playlist->execute($id, $detailed, $playlistContext, $filter, $pager);