Hi I attempted to add a scribd codec to the video filter codec.inc file. However on trying to use this the site doesnot appear until the codec related lines have been deleted from the codec.inc file. Here are the codes I wanted to insert
$codecs['scribd'] = array(
'name' => t('Scribd'),
'sample_url' => 'http://scribd.net/?document_id=9455032&access_key=key-2loz4jwna9lnne3yj90k&page=1&viewMode=list',
'callback' => 'video_filter_scribd',
'instructions' => t('You need to construct your own URL, using the "Wordpress Embed" code from Scribd, extract the "document_id" and "access_key" parts, and form the URL like this: scribd.net/?document_id=9455032&access_key=key-2loz4jwna9lnne3yj90k&page=1&viewMode=list'),
'regexp' => '/scribd\.net\/\?document_id=([a-z0-9]+).*access_key=([a-z0-9-]+).*page=([a-z0-9]+).*viewMode=([a-z]+)/',
'ratio' => 600 / 820,
'control_bar_height' => 38,
);
function video_filter_scribd($video) {
$video['source'] = 'http://d1.scribdassets.com/ScribdViewer.swf?document_id=' . $video['codec']['matches'][1] . '&access_key=' . ($video['codec']['matches'][2] . '&page=($video['codec']['matches'][3] . '&viewMode=($video['codec']['matches'][4] );
return video_filter_flash($video);
}
Note that the codec is a modified form of the slideshare codec.
The embed code for a scribd document is
<a title="View Radiation Oncology Physics on Scribd" href="http://www.scribd.com/doc/9455032/Radiation-Oncology-Physics" style="margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;">Radiation Oncology Physics</a> <object id="doc_7283" name="doc_7283" height="600" width="100%" type="application/x-shockwave-flash" data="http://d1.scribdassets.com/ScribdViewer.swf" style="outline:none;" > <param name="movie" value="http://d1.scribdassets.com/ScribdViewer.swf"> <param name="wmode" value="opaque"> <param name="bgcolor" value="#ffffff"> <param name="allowFullScreen" value="true"> <param name="allowScriptAccess" value="always"> <param name="FlashVars" value="document_id=9455032&access_key=key-2loz4jwna9lnne3yj90k&page=1&viewMode=list"> <embed id="doc_7283" name="doc_7283" src="http://d1.scribdassets.com/ScribdViewer.swf?document_id=9455032&access_key=key-2loz4jwna9lnne3yj90k&page=1&viewMode=list" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="600" width="100%" wmode="opaque" bgcolor="#ffffff"></embed> </object>
Comments
Comment #1
blackdog commentedThere's a growing need for other types (than video) of codecs it seems. I'm really happy that this module provides an easy way to get something like this going, but I'm not really sure what to do with it. Maybe someone should fork it and create another filter module that can handle these types of services...
Comment #2
pavlosdanI realise this issue has been postponed for a long time now but I wasn't sure if it was better openning a duplicate issue for this.
Attached is my initial stab at integrating Scribd with Video Filter (branch 7.x-3.x).
Marking this as needs work as it is just a first stab at it currently and it probably needs some polishing as well.
I based it on the youtube html5 codec.
As I wanted to keep it as simple as possible for users and not have them construct their own urls, the url used to add a scribd document should be the first one in the embed dialog that scribds supplies to the user (Share Fullscreen URL).
Comment #3
damienmckennaThis needs to be tidied up to match the current APIs.