Skip to content

Commit

Permalink
New Feature: Enabled noConflict option for use with jQuery.noConflict…
Browse files Browse the repository at this point in the history
…(true)
  • Loading branch information
thepag committed Apr 13, 2011
1 parent 068d2c5 commit 6332af9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
14 changes: 7 additions & 7 deletions actionscript/Jplayer.as
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
* jPlayer Plugin for jQuery JavaScript Library
* http://www.happyworm.com/jquery/jplayer
*
* Copyright (c) 2009 - 2010 Happyworm Ltd
* Copyright (c) 2009 - 2011 Happyworm Ltd
* Dual licensed under the MIT and GPL licenses.
* - http://www.opensource.org/licenses/mit-license.php
* - http://www.gnu.org/copyleft/gpl.html
*
* Author: Mark J Panaghiston
* Version: 2.0.0
* Date: 20th December 2010
* Version: 2.0.9
* Date: 13th April 2011
*
* FlashVars expected: (AS3 property of: loaderInfo.parameters)
* id: (URL Encoded) Id of jPlayer instance
* id: (URL Encoded: String) Id of jPlayer instance
* vol: (Number) Sets the initial volume
* muted: (Boolean) Sets the initial muted state
* muted: (Boolean in a String) Sets the initial muted state
* jQuery: (URL Encoded: String) Sets the jQuery var name. Used with: someVar = jQuery.noConflict(true);
*
* Compiled using: Adobe Flash CS4 Professional
* Jplayer.fla
Expand Down Expand Up @@ -59,9 +60,8 @@ package {
public function Jplayer() {
flash.system.Security.allowDomain("*");

jQuery = "jQuery('#" + loaderInfo.parameters.id + "').jPlayer";
jQuery = loaderInfo.parameters.jQuery + "('#" + loaderInfo.parameters.id + "').jPlayer";
commonStatus.volume = Number(loaderInfo.parameters.vol);
commonStatus.muted = Boolean(loaderInfo.parameters.muted);
commonStatus.muted = loaderInfo.parameters.muted == "true";

stage.scaleMode = StageScaleMode.NO_SCALE;
Expand Down
Binary file modified actionscript/Jplayer.fla
Binary file not shown.
Binary file modified jquery.jplayer/Jplayer.swf
Binary file not shown.
18 changes: 12 additions & 6 deletions jquery.jplayer/jquery.jplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
* jPlayer Plugin for jQuery JavaScript Library
* http://www.jplayer.org
*
* Copyright (c) 2009 - 2010 Happyworm Ltd
* Copyright (c) 2009 - 2011 Happyworm Ltd
* Dual licensed under the MIT and GPL licenses.
* - http://www.opensource.org/licenses/mit-license.php
* - http://www.gnu.org/copyleft/gpl.html
*
* Author: Mark J Panaghiston
* Version: 2.0.8
* Date: 5th April 2011
* Version: 2.0.9
* Date: 13th April 2011
*/

(function($, undefined) {
Expand Down Expand Up @@ -192,8 +192,8 @@
$.jPlayer.prototype = {
count: 0, // Static Variable: Change it via prototype.
version: { // Static Object
script: "2.0.8",
needFlash: "2.0.0",
script: "2.0.9",
needFlash: "2.0.9",
flash: "unknown"
},
options: { // Instanced in $.jPlayer() constructor
Expand Down Expand Up @@ -226,6 +226,7 @@
// globalVolume: false, // Not implemented: Set to make volume changes affect all jPlayer instances
// globalMute: false, // Not implemented: Set to make mute changes affect all jPlayer instances
idPrefix: "jp", // Prefix for the ids of html elements created by jPlayer. For flash, this must not include characters: . - + * / \
noConflict: "jQuery",
errorAlerts: false,
warningAlerts: false
},
Expand Down Expand Up @@ -542,7 +543,12 @@

// Add the flash solution if it is being used.
if(this.flash.used) {
var htmlObj, flashVars = 'id=' + escape(this.internal.self.id) + '&vol=' + this.options.volume + '&muted=' + this.options.muted;
var htmlObj,
flashVars =
'jQuery=' + encodeURI(this.options.noConflict)
+ '&id=' + encodeURI(this.internal.self.id)
+ '&vol=' + this.options.volume
+ '&muted=' + this.options.muted;

// Code influenced by SWFObject 2.2: http://code.google.com/p/swfobject/
// Non IE browsers have an initial Flash size of 1 by 1 otherwise the wmode affected the Flash ready event.
Expand Down

0 comments on commit 6332af9

Please sign in to comment.