Files - Audio player, playlist widget for -> My audio files, Group audio files, and All other availible audio files

By Fred

Hello everyone I creating a player / playlist widget and player using Jplayer.
And I am strugling to get the correct files in the right playlist.

The playlist is done as well the player. Only the way to get the files is not correct.
For My playlist i have this


$my_files = elgg_get_entities(array(
        'type'         => 'object',
        'subtype'    => 'file',
        'limit'       => $number,
        'owner_guid' => $owner_guid,
        'no_results' => elgg_echo("file:none"),
    ));

if (!$my_files){
        $my_files = array('no_results'   => elgg_echo('file:none'));
    }
echo elgg_view('jplayer/aplaylist', array('my_guid' => $my_files));

where "aplaylist" is refining only the audio and inserting inside the correct playlist
There i get all my files including the the ones in groups

I have also tried something using relationship  to get only friends music and i get all files available
$f_files = elgg_get_entities(array(
        'type'                 => 'object',
        'subtype'              => 'file',
        'limit'              => $number,
        'relationship'         => 'friend',
        'relationship_guid' => $owner_guid,
        'full_view'         => false,
        'no_results'        => elgg_echo("file:none"),
    ));

 

Any ideas how to do this ?
I have also tried subtracting one array from the other but it does seem to be correct.
Anyone know how to do do this ?

Thanks
 

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking