javascript playlist test for Macros.JWPlayer
Log-in
|
Macros
:
javascript playlist test for Macros.JWPlayer
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
javascript playlist test for Macros.JWPlayer
Hide Line numbers
1: ############################################################################## 2: ## Macros.JWPlayerJSPL_Test: Test Macros.JWPlayer2 w/ external playlist in 3: ## JavaScript -- see object Xwiki.JavaScriptExtension[0]. 4: ## Copyright (C) 2009, Niels Mayer. All Rights Reserved. http://nielsmayer.com 5: ############################################################################# 6: ## JavaScript Playlist taken from http://home5.inet.tele.dk/nyboe/flash/mediaplayer4/JW_API_xmpl_5-2-4-0.html 7: ## suggested in http://www.longtailvideo.com/support/forum/JavaScript-Interaction/12797/creating-dynamic-playlist 8: ## note each playlist item is defined as: 9: ## jwplayer_jspl[n] = { 10: ## author:"", 11: ## description:"", 12: ## duration:"", 13: ## file:"", 14: ## link:"", 15: ## image:"", 16: ## start:"", 17: ## title:"", 18: ## type:"" 19: ## } 20: ## For the_jw_obj.sendEvent("LOAD", file_or_jspl); 21: ## file_or_jspl parameter can be a file/URL (string) or a JavaScript Playlist (array) 22: ## Playlist format: 23: ## jwplayer_jspl[n] = { 24: ## author:"", 25: ## description:"", 26: ## duration:"", 27: ## file:"", 28: ## link:"", 29: ## image:"", 30: ## start:"", 31: ## title:"", 32: ## type:"" 33: ## } 34: ## 35: ## Load and initialize LoadJS: defines injectJS(url) required by JWPlayer 36: ## 37: #includeMacros("Macros.LoadJS")## 38: #loadjs_xwiki_init()## 39: ## 40: ## Load and initialize JWPlayer after LoadJS. 41: ## 42: #includeMacros("Macros.JWPlayer2")## 43: #jwplayer_xwiki_init()## 44: ## 45: ## Load JavaScript playlist from object XWiki.JavaScriptExtension[0] into 46: ## js variable jwplayer_jspl, used below in parameter to jwplayer_embed_generic() 47: ## function(jwpl){jwpl.sendEvent(’LOAD’, jwplayer_jspl);}. This function called 48: ## by jwplayer’s playerReady() calback when player has been instantiated, and 49: ## causes the javascript-based playlist to get loaded. 50: ## 51: $xwiki.jsx.use("$doc.fullName")## 52: ## 53: ## Local Css XWiki.StyleSheetExtension[0] 54: ## 55: $xwiki.ssx.use("$doc.fullName")## 56: ## 57: ## Display begins here... 58: ## 59: 1.1.1.1.1 Test for [Macros.JWPlayer2?viewer=code] using JavaScript Controls 60: <div class="jwframe"> ## --------------------- BEGIN JW PLAYER ------------------------- 61: #set( $jw_name = "jwplayer$doc.name" )## 62: #jwplayer_create("$jw_name", "initPlayerJSPL_Test(’$jw_name’);")## 63: </div> ##"jwframe" ---------------------- END JW PLAYER -------------------------- 64: 65: ## 66: ## Right Column 67: ## 68: 69: <div id="rightcol"> 70: <div id="dat"> 71: 1.1.1.1.1 RECEIVED UPDATES 72: <div id="pid"></div> 73: <div id="item"></div> 74: <div id="stat"></div> 75: <div id="tim"></div> 76: <div id="ldd"></div> 77: <div id="vol"></div> 78: <div id="mut"></div> 79: 80: 1.1.1.1.1 ITEM DATA 81: <div id="itm"></div> 82: <div id="itmsDat"></div> 83: </div> ##end divi#rightcol 84: </div> ##end div#dat 85: 86: ## 87: ## Left Column 88: ## 89: 90: 1.1.1.1.1 SEND EVENTS (click a playlist to start) 91: <button onclick="loadFile(’http://blip.tv/?1=1&s=posts&skin=rss’)">BLIP.tv Playlist</button> ## works because has appropriate [cross-domain-security>http://developer.longtailvideo.com/trac/wiki/FlashSecurity] setup (see also [1>http://www.longtailvideo.com/support/forum/Modules/5752/Frustrated-] [2>http://www.longtailvideo.com/support/forum/Setup-Problems/5833/XML-playlist-location-that-contains-querystring]) 92: <button onclick="loadFile(’http://democracynow.blip.tv/rss’)">DemocracyNow! Blip.TV Playlist</button> 93: <button onclick="loadFile(’http://gdata.youtube.com/feeds/api/standardfeeds/recently_featured’)">YouTube Playlist</button> 94: <button onclick="loadFile(jwplayer_jspl)">JavaScript Playlist</button> 95: <button onclick="loadFile(’/xwiki/bin/view/Macros/JWPlayer_PlayList_XML?xpage=plain’)">XML Playlist</button> 96: <button onclick="loadFile(’/xwiki/bin/view/Macros/JWPlayer_PlayList?xpage=plain’)">ASX Playlist</button> 97: <br /> 98: <button onclick="the_jw_obj.sendEvent(’ITEM’,(currentItem>=0)?currentItem:0)">Play</button> 99: <button onclick="the_jw_obj.sendEvent(’STOP’)">Stop</button> 100: <button onclick="the_jw_obj.sendEvent(’PLAY’)">Play/Pause</button> 101: <button onclick="the_jw_obj.sendEvent(’LINK’,(currentItem>=0)?currentItem:0)">Browse</button> 102: <button onclick="the_jw_obj.sendEvent(’PREV’)">Prev</button> 103: <button onclick="the_jw_obj.sendEvent(’NEXT’)">Next</button> 104: <button onclick="the_jw_obj.sendEvent(’SEEK’, currentPosition-30)">-30s</button> 105: <button onclick="the_jw_obj.sendEvent(’SEEK’, currentPosition+30)">+30s</button> 106: <br /> 107: <button onclick="the_jw_obj.sendEvent(’VOLUME’, currentVolume-10)">Volume -10%</button> 108: <button onclick="the_jw_obj.sendEvent(’VOLUME’, currentVolume+10)">Volume +10%</button> 109: <button onclick="the_jw_obj.sendEvent(’MUTE’)">Mute Toggle</button> 110: 111: 1.1.1.1.1 VIDEO FRAMERATE UNEVEN? ENABLE/DISABLE CALLBACKS 112: <input id="loadedListenerToggle" type="checkbox" onclick="loadedListenerToggle(this)" /> 113: addModelListener("LOADED", "loadedListener"); 114: <br/> 115: <input id="positionListenerToggle" type="checkbox" checked="checked" onclick="positionListenerToggle(this)" /> 116: addModelListener("TIME", "positionListener"); 117: <br/> 118: <input id="quietListenerToggle" type="checkbox" onclick="quietListenerToggle(this)" /> 119: addModelListener("TIME", "quietListener"); 120: <br/> 121: 122: 1.1.1.1.1 EDIT PLAYLIST 123: <button onclick="loadCheckedPlaylistData()">Load selected Items only</button> 124: <br /> 125: <span id="plstDat"></span> 126: <button onclick="alert(’Length of playlist: ’+getLength())">Get the length of the playlist</button>
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