Contents

XOOPS + JQuery Media = xoMedia

Creating Rich Media XOOPS sites with JQuery and JQMedia

XOOPS and JQMedia Integration
xoMedia Article | Archive

This article provides instructions on adding sitewide rich media to XOOPS websites using JQuery and the JQMedia plugin.  JQMedia uses a simple text link to render object embed code for players of all popular media file types. JQmedia also renders iframe code for any online html or pdf document.

JQMedia is an extremely powerful object embed tool. Please visit the JQMedia Plugin website to learn how to access all of the script's features.

xoMedia Features

  • Embeds players for most any media file type.
  • Iframes web pages and pdf documents.
  • Uses a simple html anchor tag with class="media" to display multiple players.
  • Theme integration.  No core files are changed.
  • Direct Xoops dhtmltext editor integration.  One button inserts most all media and iframe documents.

Supported Media Players and File Types

The JQMedia Plugin provides default mappings of file formats to media players. They are as follows:
PlayerFile Formats
Quicktimeaif,aiff,aac,au,bmp,gsm,mov,mid,midi,mpg,mpeg,mp4,m4a,psd,qt,qtif,qif,qti,snd,tif,tiff,wav,3g2,3pg
Flashflv, mp3, swf
Windows Media Playerasx, asf, avi, wma, wmv
Real Playerra, ram, rm, rpm, rv, smi, smil
Silverlightxaml
iframehtml, pdf

Requirements

* For convenience I have created the xoMedia Archive that contains everything you need except the JWPlayer. The xoMedia archive also contains the files needed to integrate jquery media with the xoops dhtml text editor.

The xoMedia archive contains script versions current with this article's publish date (1/20/2010) and may not be updated often. It is always recommended to get the latest code from the above sources.

Integrating JQuery Media with XOOPS

This is easier than it looks. Check that your xoops install contains xoop_lib/Frameworks/jquery/jquery.js and then upload the flash player and the xoMedia archive. Modify your theme to include the scripts and begin accessing your site's new rich media features with simple html anchor tags.

1) Upload the JWPlayer

Get the JWPlayer, extract the zip file, rename player.swf to mediaplayer.swf and upload it to your XOOPS root directory.

2) Add the JQuery and swfObject scripts to your theme

Sample Theme Framed by JQMedia

Method 1:

Call the JQuery and swfObject scripts from the Google api by adding the following to your theme's head:

<script src="http://www.google.com/jsapi "></script>
<script>
google.load("jquery.min", "1.3.2");
google.load("swfobject", "2.1");
</script>

OR

Method 2: Use local scripts

XOOPS 2.4 includes JQuery with the core. It is located in xoops_lib/Frameworks/jquery.

Call the local script by adding this to your theme's head:

<script type="text/javascript" src="<{xoAppUrl browse.php?Frameworks/jquery/jquery.js}>"></script>

Upload the xoops_lib/Frameworks/swfobject folder from the xoMedia archive. Add this to your theme:

<script type="text//javascript" src="<{xoAppUrl browse.php?Frameworks/swfobject/swfobject.js}>"></script>

3) Include the JQuery Metadata and Media Plugins

Get the latest JQuery Metadata and JQMedia plugin scripts* and upload the .js files to xoops_lib/Frameworks/jquery/plugins.
Add the following to your theme's head:

<script type="text/javascript" src="<{xoAppUrl browse.php?Frameworks/jquery/plugins/jquery.metadata.js}>"></script>
<script type="text/javascript" src="<{xoAppUrl browse.php?Frameworks/jquery/plugins/jquery.media.js}>"></script>

Accessing the JQuery Media Plugin

The JQMedia plugin uses anchor tags containing class="media" to access the script. JQMedia renders object embed code for each player depending on the media's file type. A text link is displayed if javascript is disabled or a script fails to load.

Add a media link to your html:

Video Link:
<a class="media" href="myvideo.flv">My Video</a>

Music link:
<a class="media { width: 468, height:20 }" href="mymp3.mp3">My MP3</a>

Iframes:
<a class="media {width: 640, height:600 }" href="mydocument.pdf">pdf in iframe</a>
<a class="media {width: 640, height:600, type: 'html' }" href="mypage.html">web page in iframe</a>
 

Changing the Jquery Media Default Variables

The script provides two methods to change all default settings without modifying the original script.

1) Change default settings via a script in the theme's head.

<script type="text/javascript">
// Override default player dimensions
$(function() {
$('a.media').media( { width: 480, height: 360 } );
});

// Assign players by media type (.extPlayer)
$.fn.media.defaults.flvPlayer = '<{xoAppUrl mediaplayer.swf}>';
$.fn.media.defaults.mp3Player = '<{xoAppUrl mediaplayer.swf}>';

// map a media type to a specific player
$.fn.media.mapFormat('wav', 'quicktime');
</script>

2) Set variables in the media link.

Example: <a class="media { width:320, height:30 }" href="mymedia.mp3">My Music</a>
Resets the players dimensions

XOOPS dhtml Text Editor and Jquery Media

The integration of JQMedia with the xoops dhtmltext editor enables the display of iframe pages and all popular media types thru one button on the user interface.

1) Get the xoMedia Archive and extract to your computer.

2) Edit the language constants in class/textsanitizer/media/media.php

3) Upload the media folder to xoops/class/textsanitizer/.

4) Edit your xoops/class/textsanitizer/config.php (around line 27) to include the new media extension and turn off the obsolete iframe, flash, mp3 and wmp extensions.

"media" => 1, //add this to turn on the media extension
"iframe" => 0, //Turn off
"image" => 1,
"flash" => 0, //Turn off
"youtube" => 1,
"mp3" => 0, //Turn off
"wmp" => 0, //Turn off

5) Upload the media button image to xoops/images/forms

Using the JQMedia extension in the XOOPS dhtml Text Editor

xoopscode:
[media=480,360,false,My Video]http://mysite/myvideo.mov[/media]
[media=width,height,autostart,title]media url[/media]

Conclusion

You should now have a fully functional xoMedia site. Webmasters can now display rich media content by adding media anchor tags to any block, template or theme. Your members can now display their media in your forums and news articles using the dhtmltext editor.

Retrieved from "http://wikiwebshow.com/modules/mediawiki/index.php?title=XoMedia"

This page has been accessed 1,257 times. This page was last modified 15:37, 24 January 2010. Content is available under Wiki Web Show.


Wiki Web Show

Wiki - XoMedia

Main Menu

Login

Username:

Password:

Remember me



Lost Password?

Register now!

Site Tools

Search
Site:
Wiki:
Translate
Tranlate Page To Spanish Tranlate Page To French Translate Page To Italian Translate Page To Japanese Tranlate Page To Portuguese Tranlate Page To Chinese
Site Map |Info |Contact

WebShow Module For XOOPS


Wiki Web Show is homebase for the WebShow Module for the XOOPS open source content management system (CMS).

Latest: WebShow V 0.71_beta

Documentation:
About WebShow
Change Log
WebShow Help
Download WebShow

Development:
This site is currently running Web Show version .71_beta. Please help us develop and test our module by reporting errors that occur when using the Web Show media player and catalog.



Wiki - XoMedia

Graspr Network
Graspr Network shares its ad revenue with affiliates that produce, publish and distribute How to Videos thru Graspr.com.

XOMEDIA

xoMedia combines XOOPS with JQMedia to reach new horizons in rich media cms web sites.

[media=150,20,false,Sample MP3]http://wikiwebshow.com/modules/webshow/media/music/song1.mp3[/media]
This custom block contains media displayed from code created by the xoops dhtml text editor.

Our web show directory catalogs and plays video, music, animation and slideshow multimedia.

http://wikiwebshow.com/modules/mediawiki/index.php?title=XoMedia
WikiWebShow © 2007-2009