JWPlayer2
Log-in
|
Macros
:
JWPlayer2
Top Menu
Show
:
Comments
Attachments
History
Information
Print
:
Print
Print preview
Export as PDF
Export as RTF
Export as HTML
Export as XAR
Wiki code for
JWPlayer2
Hide Line numbers
1: ############################################################################## 2: ## Xwiki integration of JWPlayer using SWFObject 2.0. 3: ## See Macros/JWPlayer2JSPL_Test 4: ## Usage: 5: ## ---- 6: ## #includeMacros("Macros.LoadJS")## 7: ## #loadjs_xwiki_init()## 8: ## #includeMacros("Macros.JWPlayer2")## 9: ## #jwplayer_xwiki_init()## 10: ## ... 11: ## #jwplayer("jwplayer", "jwplayer_embed(’jwplayer’, ’http://democracynow.blip.tv/rss’, null, null);")## 12: ## ---- 13: ## Note: jwplayer_embed() and other utility functions are defined in object 14: ## XWiki.JavaScriptExtension[0] and XWiki.JavaScriptExtension[1]. 15: ## Copyright (C) 2009, Niels Mayer. All Rights Reserved. http://nielsmayer.com 16: ############################################################################# 17: {pre} 18: ## 19: ## Init from XWiki.JavaScriptExtension[*] and XWiki.StyleSheetExtension[*] 20: ## 21: #macro(jwplayer_xwiki_init) ## { 22: ## CSS in objects XWiki.StyleSheetExtension[*] concatenated & injected into document HEAD as 23: ## <link rel=’stylesheet’ type=’text/css’ href=’/xwiki/bin/ssx/Macros/JWPlayer2?language=en’/> 24: $xwiki.ssx.use("Macros.JWPlayer2")## 25: ## JavaScript in XWiki.JavaScriptExtension[*] concatenated & injected into document HEAD as 26: ## <script type=’text/javascript’ src=’/xwiki/bin/jsx/Macros/JWPlayer2?language=en’></script> 27: $xwiki.jsx.use("Macros.JWPlayer2")## 28: #end ## } 29: ## 30: ## JW Player goes here in the DOM 31: ## 32: #macro(jwplayer_create $name $onload) ## { 33: <div id="$name" name="$name"><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Flash Plugin to play audio/video files.</a></div> 34: #if( "$!onload" != "" ){pre}<script type="text/javascript">${onload}</script>{/pre}#end## 35: #end ## } 36: ## 37: ## Alternative to jwplayer() macro above, which doesn’t set ’id’/’name’ and uses class instead. In 38: ## Exhibit Lenses (popup bubbles), Id’s given in the template will be stripped in the instantiation, 39: ## class specifications will be maintained unchanged. The undisplayed div (the template episode-lens) will 40: ## be named by the desired id, whereas the actual instance containing the correct div&location to 41: ## place the player will only have a name/class. For this situation, the the exhibit lens-template’s 42: ## ex:onshow callback needs to get the correct div, and explicitly set id/name, otherwise the 43: ## jwplayer’s playerReady() callback never fires (on Linux/FF3) which will causes 44: ## jwplayer_create_generic() to fail in the case where it is given an initialization 45: ## closure to execute. This closure is where the JS variable for the jw player gets init’d. 46: ## Here is the exhibit ex:onshow callback: 47: ## function playerFromEpisodeLens(lens_elmt) { 48: ## var playerid = "${doc.name}-jwplayer"; 49: ## // finds div with class="NPRPods3-jwplayer" created by macro jwplayer_in_exhibit_lens_template("${doc.name}-jwplayer","") 50: ## var player = SimileAjax.jQuery(’div.’ + playerid, lens_elmt)[0]; 51: ## if (player != null) { // if found the player... give it an id/name as JWplayer expects. 52: ## player.id = playerid; //give it an id like jwplayer expects for playerReady() to work. 53: ## player.name = playerid; //give it a name to fix issue w/ playerReady() on linux/ff not getting called. 54: ## } ... } 55: ## 56: #macro(jwplayer_in_exhibit_lens_template $name $onload) ## { 57: <div class="$name"><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Flash Plugin to play audio/video files.</a></div>## 58: #if( "$!onload" != "" )<script type="text/javascript">${onload}</script>#end## 59: #end ## } 60: {/pre}
Search
Navigation:
Home
What's New
Site Timeline
Featured Apps:
NPR Podcasts
Fav Music Podcasts
KCRW Podcasts
Exhibit Presidents
Topics:
NPM's Blog ...
Site News
Photos
Todos
Sandbox
Fedora10
Timeline
Exhibit
CreateResources
Recently Modified
$rdoc.displayTitle
|
XWikiPreferences
|
XWikiAllGroup
|
NielsMayer.com
|
ShellScriptReturningListOfOldKernels
Recently Created
ShellScriptReturningListOfOldKernels
|
HowToHackPluginsForFireFox3_5_x86_64
|
FeedExperiment4
|
Thinbox
|
JWPlayer2