Sun Carter
Sun Carter

Reputation: 57

How to return SSL resource for Facebook Video Embed

I am trying to use embed_html from Graph API but the calls are not returning SSL using return_ssl_results=1, is there away to return the embed code for ssl?

Upvotes: 2

Views: 218

Answers (1)

ShawnDaGeek
ShawnDaGeek

Reputation: 4150

try{} to rewrite the urls of the source before adding to the object. This worked pretty well for me.

  • $fvalue[source] is the source url of a post that contains a video,
  • you can do with $fvalue[embed_html] too.

if($fvalue[source]){
   $reWrite = array("autoplay=1" => "autoplay=0", "http://" => "https://");
   $getEmbed = $fvalue[source];
   $strAuto = strtr($getEmbed, $reWrite);
   echo '<object style="float:left; clear:left; margin: 5px;"><param name="autostart" value="0"><embed autostart="false" src="'.$strAuto.'"></embed></object>';
}

Upvotes: 1

Related Questions