require_once("externals/facebook-sdk/src/facebook.php");
$config = array();
$config['appId'] = 'XXXXXXXXXXXXXXXXXXXXXXXX';
$config['secret'] = 'XXXXXXXXXXXXXXXXXXXXXXXXX'; $config['fileUpload'] =true;
$facebook = new Facebook($config)
;
and I can post video like
$facebook->api('/me/feed', 'post', array(
'message' => $message,
'link' => 'http://www.test.org/videos/'.$video['video_id'].'/'.$_POST['title'],
'type'=>'video',
'source'=>$video['embed'],
'picture'=> $pic,
'name'=> $_POST['title'],
'caption'=>'this is a test' ,
'description'=> $_POST['desc'])
);
How can I do the same for audio? Shall I just change video to audio and provide the url of that audio?
Well. as per the date, facebook is NOT supporting audio files (according to the best of ma knowledge). Hence you will not be able to do what you want to do. What you can do is, upload them to a third party server and share the link. Or use a third party app like Spotify.
Hope this helps.