You are here

function _facebook_video_settings in Facebook Wall 7

Function to set video auto play setting .

1 call to _facebook_video_settings()
facebook-wall.tpl.php in ./facebook-wall.tpl.php

File

./facebook_wall.module, line 385
Get the current facebook wall posts of the given user or page.

Code

function _facebook_video_settings($video_scouce) {
  if (variable_get('facebook_wall_autoplay_video', '0')) {
    $op = 'true';
  }
  else {
    $op = 'false';
  }
  if (stristr($video_scouce, 'autoplay=1')) {
    $video_scouce = str_replace('autoplay=1', 'autoplay=' . variable_get('facebook_wall_autoplay_video', '0'), $video_scouce);
  }
  elseif (stristr($video_scouce, '?autoplay=0')) {
    $video_scouce = str_replace('?autoplay=0', '?autoplay=' . variable_get('facebook_wall_autoplay_video', '0'), $video_scouce);
  }
  elseif (stristr($video_scouce, 'auto_play=true')) {
    $video_scouce = str_replace("auto_play=true", "auto_play={$op}", $video_scouce);
  }
  elseif (stristr($video_scouce, 'auto_play=false')) {
    $video_scouce = str_replace("auto_play=false", "auto_play={$op}", $video_scouce);
  }
  else {
    $video_scouce = '';
  }
  return $video_scouce;
}