It seems that quotes are not always escaped correctly. The following works for me to use the viral video plugin:

  flowplayer_add('#video-player', array(
      'playlist' => array(
        array(
          'url' => '<splash_image_url>',
          'scaling' => 'orig',
        ),
        array(
          'url' => '<video_url>',
          'autoPlay' => FALSE, // Turn autoplay off
        ),
      ),
      'plugins' => array(
        'viral' => array(
          'url' => 'flowplayer.viralvideos.swf',
          'share' => array(
            'description' =>  'This is the description',
          ),
        ),
      ),
    )
  );

But when I change 'This is the description' to $vars['node']->title and the title contains an ', that breaks the player.

Comments

patmacs’s picture

You can use $vars["node"]->title
" and ' are swappable. Or a forwardslash before the character you want to escape.

alienresident’s picture

Yan,

I was having this issue when the client I was using a ' in the file names. I used preg_replace to filter and rencode (', &, +). I have adapted it for your use case but I haven't tested the code.

  /* Re-encode ', &, +  which otherwise break flowplayer */   
  $patterns = array ("/'/","/&/","/\+/");
  $replace = array ("%2527","%26","%2B");
  $description = preg_replace($patterns, $replace, $vars['node']->title);  

 flowplayer_add('#video-player', array(
      'playlist' => array(
        array(
          'url' => '<splash_image_url>',
          'scaling' => 'orig',
        ),
        array(
          'url' => '<video_url>',
          'autoPlay' => FALSE, // Turn autoplay off
        ),
      ),
      'plugins' => array(
        'viral' => array(
          'url' => 'flowplayer.viralvideos.swf',
          'share' => array(
            'description' => $description,
          ),
        ),
      ),
    )
  );
yan’s picture

ok alienresident, but shouldn't the module do that?