Copyright (C) 2007 Wayne Patterson http://www.flashyourweb.com
@version RC1 Date: 2007-12-23
@author Wayne Patterson <suprsidr@gmail.com>
Download
|
 |
|
The E2 XML Audio/Video Player communicates with your Gallery2 website via an external XML generator.
E2 is not part of the official Gallery2 package.
The E2 XML Audio/Video Player allows you to display your mp3s and flash videos on any webpage.
|
- E2.swf
- mediaRss.php
- usage.txt
I have changed the E2 over to
MediaRSS but still supporting my older frameworks for now. So you could rename to xml.php if you wish.
1. upload E2.swf and your mediaRss(.php) files to your gallery2 base directory.
(for now I would like to keep mediaRss.php and xml.php separate - until I switch the mini over)
2. edit line 29 of your mediaRss(.php) to reflect your setup (default will work for most).
| $ret = GalleryEmbed::init(array('fullInit' => true, 'embedUri' => '/gallery2/main.php', 'g2Uri' => '/gallery2/')); |
*Hint: If your gallery is embedded the embedUri needs to reflect you CMS' embedUri
3. place the following in your webpage where you want the E2 to appear:
<script type="text/javascript">
// <![CDATA[
function divResize(id, nw, nh) {
var obj = document.getElementById(id);
obj.style.width = nw + "px";
obj.style.height = nh + "px";
}
// ]]>
</script>
<div id="videoDiv" style="width:530px;height:600px;">
<embed width="100%" height="100%" align="middle" pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" name="E2Demo" bgcolor="#ffffff" allowFullScreen="true" quality="high" flashvars="xmlUrl=http://www.yoursite.com/gallery2/mediaRss.php&g2_itemId=30&color1=0x999999&color2=0x333333&albumSelect=false&siteInfoText=yoursitename" src="http://www.yoursite.com/gallery2/E2.swf"></embed>
</div>
The above code sample would render something similar to:
Flash player 9,0,115,0 or above is required to view this demo, click
here to upgrade.
Edit the g2_itemId in the xmlUrl to reflect the album you want to be displayed and also the site url.
*Hint: If you have url rewrite enabled, you may have to temporarily disable it to see the g2_itemId in your album's url.
*Note on Gallery style urls and Flash
Flash interprets &(ampersand) as a break, so you will need to replace them with the unicode equivelent %26 in the url only.
Continue adding your additional vars with the &(ampersand).
(case sensitive)
| External Variable |
Description/Possible Value |
| albumSelect |
Show the album dropdown true/false default true, so leave out for true |
| color1 |
Hex color code eg. 0x000000 default 0x999999 1st color in player gradient |
| color2 |
Hex color code eg. 0xFFFFFF default 0x333333 2nd color in player gradient |
| color3 |
Hex color code eg. 0xFFFFFF default 0xCCCCCC line/frame color in player |
| color4 |
Hex color code eg. 0xFFFFFF default 0x000000 bgcolor in fullscreen |
| siteInfoText |
YourCoolSite name - currently only shows in the right-click context menu |
| allowDownload |
Show the download button - true/false Default : false |
| allowFullscreen |
Show the fullscreen button - true/false Default : true |
| share |
Show the share button - true/false Default : false |
| htmlDiv |
Define the target html div for resizing only necessary for multiple players on same page. Default : videoDiv |
| swfUrl |
URL to the player swf for sharing. |
| Language |
| langDownload |
"Download" |
| langFullscreen |
"Fullscreen" |
| langNormal |
"Normal" |
| langPlay |
"Play" |
| langPause |
"Pause" |
| langForward |
"Forward" |
| langRewind |
"Rewind" |
| langMute |
"Mute" |
| langUnmute |
"Unmute" |
| langShare |
"Share" |
| langGenre |
"Genre" |
| langArtist |
"Artist" |
| langAlbum |
"Album" |
| langSong |
"Song" |
| langYear |
"Year" |
| langTrack |
"Track" |
| langInfo |
"Info" |
| langOpenList |
"Open List" |
| langCloseList |
"Close List" |
Add your external variables to your xmlUrl separated with an ampersand (&) ie.
xmlUrl=http://yoursite.com/gallery2/mediaRss.php
&g2_itemId=30&color1=0x999999&color2=0x333333&albumSelect=false
&siteInfoText=yoursitename
To avoid the "Click here to activate and use this control" blunder in IE7 we deploy a different method to embed our flash objects.
I prefer swfObject myself, but there are others like UFO, Flash's own ActiveContent....
Since we are using javascript to "write" our object to the page, we will first need to include our swfObject library in the <head> of our page:
<script type="text/javascript" src="http://www.yoursite.com/swfobject.js"></script>
next we need our html:
<script type="text/javascript">
// <![CDATA[
function divResize(id, nw, nh) {
var obj = document.getElementById(id);
obj.style.width = nw + "px";
obj.style.height = nh + "px";
}
// ]]>
</script>
<div id="videoDiv" style="width: 530px; height: 600px;">
<div id="xmlvideo" style="width: 100%; height: 100%;">Here we place alternate content for those without flash or javascript. It will be replaced by swfObject.</div>
</div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("http://www.yoursite.com/gallery2/E2.swf", "E2Demo", "100%", "100%", "9.0.28.0", "ffffff");
so.addParam("flashVars","xmlUrl=http://www.yoursite.com/gallery2/mediaRss.php&g2_itemId=30&color1=0x999999&color2=0x333333&albumSelect=false
&siteInfoText=yoursitename");
so.addParam("allowFullScreen","true");
so.write("xmlvideo");
// ]]>
</script>
Please refer to the swfObject site for further instructions.
If you pass a flvUrl the player will assume video/x-flv - required params: flvUrl, Height, Width, title, thumbUrl
<script type="text/javascript">
// <![CDATA[
function divResize(id, nw, nh) {
var obj = document.getElementById(id);
obj.style.width = nw + "px";
obj.style.height = nh + "px";
}
// ]]>
</script>
<div style="width: 520px; height: 275px;" id="flvResizableDiv">
<div style="width: 100%; height: 100%;" id="flvVideo">Flash player 9,0,115,0 or above is required to view this demo, click <a target="_blank" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">here</a> to upgrade. <br />
<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"><img src="http://www.flashyourweb.com/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=1184&g2_serialNumber=2" alt="get_flashplayer" title="get_flashplayer" /></a></div>
</div>
<script type="text/javascript">
// <![CDATA[
var so1 = new SWFObject("http://www.flashyourweb.com/fullscreen/dev/E2.swf", "flvDemo", "100%", "100%", "9.0.115.0", "ffffff");
so1.addParam("flashVars","flvUrl=http%3A%2F%2Fwww.flashyourweb.com%2Fgallery2%2Fmain.php%3Fg2_view%3Dcore.DownloadItem%26g2_itemId%3D665%26g2_serialNumber%3D6%26g2_GALLERYSID%3Df5d0e9529feaf9fc01504baf9b64adca&Width=550&Height=228&title=300+-+On2&allowDownload=true&share=true&swfUrl=http%3A%2F%2Fwww.flashyourweb.com%2Ffullscreen%2Fdev%2FE2.swf&thumbUrl=http%3A%2F%2Fwww.flashyourweb.com%2Fgallery2%2Fmain.php%3Fg2_view%3Dcore.DownloadItem%26g2_itemId%3D666%26g2_serialNumber%3D8%26g2_GALLERYSID%3Df5d0e9529feaf9fc01504baf9b64adca&langDownload=Download&langFullscreen=Fullscreen&langNormal=Normal&langPlay=Play&langPause=Pause&langForward=Forward&langRewind=Rewind&langMute=Mute&langUnmute=Unmute&langShare=Share&htmlDiv=flvResizableDiv&siteInfoText=FYWWiki&color1=0x244293&color2=0x0099ff&color3=0x000000&color4=0x232323");
so1.addParam("allowScriptAccess","always");
so1.addParam("allowFullScreen","true");
so1.addParam("wmode","transparent");
so1.write("flvVideo");
// ]]>
</script>
Flash player 9,0,115,0 or above is required to view this demo, click
here to upgrade.

If you pass a mp3Url the player will assume audio/mpeg - required params: mp3Url, title, thumbUrl
<div id="mp3Audio" style="width: 520px; height: 275px;">Flash player 9,0,115,0 or above is required to view this demo, click <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank">here</a> to upgrade. <br />
<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"><img title="get_flashplayer" alt="get_flashplayer" src="http://www.flashyourweb.com/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=1184&g2_serialNumber=2" /></a>
</div>
<script type="text/javascript">
// <![CDATA[
var so2 = new SWFObject("http://www.flashyourweb.com/fullscreen/dev/E2.swf", "mp3Demo", "520", "275", "9.0.115.0", "ffffff");
so2.addParam("flashVars","mp3Url=http%3A%2F%2Fwww.flashyourweb.com%2Fgallery2%2Fmain.php%3Fg2_view%3Dcore.DownloadItem%26g2_itemId%3D1078%26g2_serialNumber%3D5%26g2_GALLERYSID%3Df5d0e9529feaf9fc01504baf9b64adca&title=Mysterious+Tweet&allowDownload=true&share=true&swfUrl=http%3A%2F%2Fwww.flashyourweb.com%2Ffullscreen%2Fdev%2FE2.swf&thumbUrl=http%3A%2F%2Fwww.flashyourweb.com%2Fgallery2%2Fmain.php%3Fg2_view%3Dcore.DownloadItem%26g2_itemId%3D1079%26g2_serialNumber%3D4%26g2_GALLERYSID%3Df5d0e9529feaf9fc01504baf9b64adca&langArtist=Artist&langAlbum=Album&langSong=Song&langTrack=Track&langGenre=Genre&langYear=Year&langDownload=Download&langInfo=Info&langPlay=Play&langPause=Pause&langForward=Forward&langRewind=Rewind&langMute=Mute&langUnmute=Unmute&langShare=Share&htmlDiv=mp3Audio&color1=0xd82020&color2=0xff2626&color3=0x000000&color4=0xb10000");
so2.addParam("allowScriptAccess","always");
so2.addParam("wmode","transparent");
so2.write("mp3Audio");
// ]]>
</script>
Flash player 9,0,115,0 or above is required to view this demo, click
here to upgrade.
The list will not show in singlefile mode.
Another new feature of RC1 is the ability to allow sharing.
When enabled E2 will generate code to embed itself in any webpage with an easy cut/paste.
To enable just add the 2 new flashvars:
&share=true&swfUrl=http://www.yoursite.com/E2.swf (Obviously the real url to your E2.swf).
The above two examples have sharing enabled.
Any questions, comments, or suggestions are welcome.