This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
admin:indexing:powersearch:example [2011/11/22 21:32] doc |
admin:indexing:powersearch:example [2016/06/28 22:38] (current) |
||
|---|---|---|---|
| Line 17: | Line 17: | ||
| ==== Example ==== | ==== Example ==== | ||
| - | |||
| - | |||
| - | <html> | ||
| - | <script type="text/javascript"> | ||
| - | function isMSIE() | ||
| - | { | ||
| - | return '\v' == 'v'; | ||
| - | } | ||
| - | function addParam( targetElement, paramName, paramValue) | ||
| - | { | ||
| - | var paramElement = document.createElement( "param"); | ||
| - | paramElement.setAttribute( "name", paramName); | ||
| - | paramElement.setAttribute( "value", paramValue); | ||
| - | targetElement.appendChild( paramElement); | ||
| - | } | ||
| - | function loadVideo() | ||
| - | { | ||
| - | var sourceElement = document.getElementById( "scImg"); | ||
| - | |||
| - | var targetElement; | ||
| - | if (isMSIE()) | ||
| - | { | ||
| - | var div = document.createElement("div"); | ||
| - | div.innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'><param name='movie' value='http://content.screencast.com/users/omnidex/folders/Omnidex%20Demos/media/246eaae0-928e-4e11-b6b0-acd86f5f1563/scplayer.swf'></object>"; | ||
| - | targetElement = div.firstChild; | ||
| - | } | ||
| - | else | ||
| - | { | ||
| - | targetElement = document.createElement( "object"); | ||
| - | targetElement.setAttribute( "type", "application/x-shockwave-flash"); | ||
| - | targetElement.setAttribute( "data", "http://content.screencast.com/users/omnidex/folders/Omnidex%20Demos/media/246eaae0-928e-4e11-b6b0-acd86f5f1563/scplayer.swf"); | ||
| - | |||
| - | addParam( targetElement, "movie", "http://content.screencast.com/users/omnidex/folders/Omnidex%20Demos/media/246eaae0-928e-4e11-b6b0-acd86f5f1563/scplayer.swf"); | ||
| - | } | ||
| - | targetElement.setAttribute( "id", "scPlayer"); | ||
| - | targetElement.setAttribute( "width", "720"); | ||
| - | targetElement.setAttribute( "height", "540"); | ||
| - | |||
| - | addParam( targetElement, "quality", "high"); | ||
| - | addParam( targetElement, "bgcolor", "#FFFFFF"); | ||
| - | addParam( targetElement, "flashVars", "thumb=http://content.screencast.com/users/omnidex/folders/Omnidex%20Demos/media/246eaae0-928e-4e11-b6b0-acd86f5f1563/FirstFrame.png&containerwidth=720&containerheight=540&autohide=true&autostart=false&loop=false&showendscreen=true&showsearch=false&showstartscreen=true&tocdoc=left&xmp=sc.xmp&content=http://content.screencast.com/users/omnidex/folders/Omnidex%20Demos/media/246eaae0-928e-4e11-b6b0-acd86f5f1563/Omnidex%20ActiveCounts%20Demo.mp4&blurover=false"); | ||
| - | addParam( targetElement, "allowFullScreen", "true"); | ||
| - | addParam( targetElement, "scale", "showall"); | ||
| - | addParam( targetElement, "allowScriptAccess", "always"); | ||
| - | addParam( targetElement, "base", "http://content.screencast.com/users/omnidex/folders/Omnidex%20Demos/media/246eaae0-928e-4e11-b6b0-acd86f5f1563/"); | ||
| - | |||
| - | sourceElement.parentNode.replaceChild( targetElement, sourceElement); | ||
| - | } | ||
| - | </script> | ||
| - | <a id="scImg" href="" onClick="javascript:loadVideo(); return false;">View a demonstration of the PowerSearch feature</a> | ||
| - | </html> | ||
| - | |||
| - | |||