سؤال

I used the Facebook PHP SDK to upload a YouTube Video in the FB user wall. I used the "source" option in "/USER_ID/feed/" of Graph API. USER_ID is the logged in user's Facebook ID.

My code was working fine. But Facebook made some changes in their API and the code is not working anymore. Only the Youtube video image is showing but the Youtube video is not playing in facebook.

My code looks like this:-

$params =   array(
                    'access_token'  =>  $fbToken,
                    'message'       =>  $name.' has shared a Vhybe',
                    'link'          =>  $link,
                    'name'          =>  'Vhybe Social',
                    'caption'       =>  $title,
                    'description'   =>  $content
                    );

$sourceUrl  =   "https://www.youtube.com/v/".$videoId;
$imageUrl   =   "http://i4.ytimg.com/vi/".$videoId."/default.jpg";
$params['source']   =   $sourceUrl;
$params['picture']  =   $imageUrl;

$result = $facebook->api(
    '/'.$userId.'/feed/',
    'POST',
    $params
);

I tried the "Graph API explorer" tool from the Facebook developer tools section URL => https://developers.facebook.com/tools/

But i am getting the same results.

If the above process to upload Youtube video to user wall has been deprecated can you please suggest me an alternate process.

Thanks in advance.

Sincerely,

Sourav Mukherjee

هل كانت مفيدة؟

المحلول

Well the above code is working fine again. I did not make any changes in my code.

Looks like Facebook corrected their own issue.

Sincerely,

Sourav Mukherjee

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top