The embed code in the current module is for flash which Scribd has abandoned. This is needed for any content to be seen on iDevices. Can someone come up with a patch to change it to HTML5 which is the current preferred embed for Scribd? I'd do it, but alas, I am not a programmer. Should be fairly simple though if you know what you're doing. Thanks!

Comments

rstryker’s picture

I imagine anyone using iPaper is experiencing pain over this. I'd like to see a flash-free implementation as well.

kmatwill’s picture

Yes, this is huge! Please change from flash.

erutan’s picture

I took a quick stab at this yesterday but just ended up with unstyled content - aside from the api call there's some functionality tied to the flash embed. If the cient wants more work done on it I'll take it further and post back. My skills lie with in browser designing and some sysadmin, so this isn't native territory for me. :)

I checked on the scribd site and made the following changes to ipaper.module:

function theme_ipaper_viewer($node) {
 
  $extraJS = variable_get('ipaper_extraJS', '');
  if($node->secure)
    $extraJS .= ipaper_generate_securesig($node);
  $output = "
  <script type=text/javascript src='http://www.scribd.com/javascripts/scribd_api.js'></script>
  <div id='embedded_doc_$node->doc_id'>
    <a href='http://www.scribd.com'>Scribd</a></br />". theme('ipaper_full_text', $node) ."
  </div>
  <script type=text/javascript>
    var scribd_doc = scribd.Document.getDoc($node->doc_id, '$node->access_key');
    scribd_doc.addParam('jsapi_version', 2 );
    $extraJS
	scribd_doc.addEventListener('docReady', onDocReady);
    scribd_doc.write('embedded_doc_$node->doc_id');
  </script>
  ";

  return $output ."\n";
}

The issue was probably with theme_ipaper_embed_code which had a lot of flash embed code in it. Merely changing it to the following just gave me unstyled text (there's undoubtably some easy way to get the HTML5 wrapper in there):

function theme_ipaper_embed_code($node) {
  if($node->secure)
  	return $output ."\n";
  $keys = array(
    '!doc_id' => $node->doc_id,
    '!access_key' => $node->access_key,
  );
  $output = t($output, $keys);
  $output = check_plain($output);
  return $output;
}
kmatwill’s picture

Well, it would be much appreciated if someone could figure it out. thanks for your attempt!

simonbcfa’s picture

Hi All

We recently had an issue with this (for a D6 site we are looking to update)

As an interim measure i took the code from the scribd field form D7 and copied it over, seems to work fine

I replaced the theme_ipaper_view with this

function theme_ipaper_viewer($node) {
  $doc_id = $node->doc_id;
  $access_key = $node->access_key;

  $output = array(
      '<script type="text/javascript" src="http://www.scribd.com/javascripts/scribd_api.js"></script>',
      '<div id="embedded_doc_' . $doc_id . '" class="collapsible collapsed"></div>',
      '<script type="text/javascript">',
      'var scribd_doc = scribd.Document.getDoc("' . $doc_id . '", "' . $access_key . '");',
      'scribd_doc.addParam("jsapi_version", 2);',

    );
  
  // Set height
  $height = '800';
  if (!empty($height)) {
    $output[] = 'scribd_doc.addParam("height", ' . $height . ');';
  }

  // Set Mode
  $mode = 'slideshow';
  if (!empty($mode)) {
    $output[] = 'scribd_doc.addParam("mode", "' . $mode . '");';
  }

  // Set allow_share
  $allow_share = 'false';
  $output[] = 'scribd_doc.addParam("allow_share", ' . $allow_share . ');';

  $output[] = 'scribd_doc.write("embedded_doc_' . $doc_id . '");';
  $output[] = '</script>';
  
  return implode("\n", $output);
}

Because we are not setting the height in iPaper i placed in what works for our site, the mode we use is slideshow, same deal.

Anyway I hope that helps

barinder’s picture

Issue summary: View changes

Thanks @simonbcfa #5, worked for me as well.