Commit 50219efd authored by Aaron Wells's avatar Aaron Wells Committed by Gerrit Code Review
Browse files

Update mahara-flashplayer to be based on flowplayer 3.2.18

Bug 1316375

Change-Id: Id5289bb6392a1e2d1f3d3d9b2dea91fba4298408
parent be08f86a
......@@ -447,11 +447,11 @@ class PluginBlocktypeInternalmedia extends PluginBlocktype {
}
define('BLOCKTYPE_INTERNALMEDIA_JS_INCLUDED', true);
if ($asarray) {
return array(get_config('wwwroot').'artefact/file/blocktype/internalmedia/mahara-flashplayer/mahara-flashplayer-3.2.6.js',
return array(get_config('wwwroot').'artefact/file/blocktype/internalmedia/mahara-flashplayer/mahara-flashplayer.js',
get_config('wwwroot') . 'artefact/file/blocktype/internalmedia/swfobject.js',
);
}
return '<script src="'.get_config('wwwroot').'artefact/file/blocktype/internalmedia/mahara-flashplayer/mahara-flashplayer-3.2.6.js"></script>
return '<script src="'.get_config('wwwroot').'artefact/file/blocktype/internalmedia/mahara-flashplayer/mahara-flashplayer.js"></script>
<script src="' . get_config('wwwroot') . 'artefact/file/blocktype/internalmedia/swfobject.js" type="text/javascript"></script>';
}
......
......@@ -5,7 +5,7 @@ This is a modified version of FlowPlayer. In accordance with the FlowPlayer
GPL license, it has been renamed to "mahara-flashplayer" for distribution.
Website: https://gitorious.org/mahara/mahara-flashplayer
Version: 3.2.16dev
Version: 3.2.18
This flash video player is used by the Mahara internal media blocktype. The
primary modification made from the original project is that it has been
......
/**
* flowplayer.js 3.2.6. The Flowplayer API
/*!
* flowplayer.js The Flowplayer API
*
* Copyright 2009 Flowplayer Oy
* Copyright 2009-2011 Flowplayer Oy
*
* This file is part of Flowplayer.
*
......@@ -18,10 +18,8 @@
* You should have received a copy of the GNU General Public License
* along with Flowplayer. If not, see <http://www.gnu.org/licenses/>.
*
* Date: 2010-08-25 12:48:46 +0000 (Wed, 25 Aug 2010)
* Revision: 575
*/
(function() {
!function() {
/*
FEATURES
......@@ -138,6 +136,10 @@
to[evt].push(fn);
}
// escape & and = in config written into flashvars (issue #21)
function queryescape(url) {
return url.replace(/&amp;/g, '%26').replace(/&/g, '%26').replace(/=/g, '%3D');
}
// generates an unique id
function makeId() {
......@@ -258,7 +260,8 @@
}
// 1. clip properties, 2-3. metadata, 4. updates, 5. resumes from nested clip
if (arg1 && "onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(evt) != -1) {
//#148 add onMetaDataChange event to extend clip properties, this was needed to prevent regular updates during stream switching.
if (arg1 && "onBeforeBegin,onMetaData,onMetaDataChange,onStart,onUpdate,onResume".indexOf(evt) != -1) {
// update clip properties
extend(target, arg1);
......@@ -531,8 +534,6 @@ function Player(wrapper, params, conf) {
load: function(fn) {
if (!self.isLoaded() && self._fireEvent("onBeforeLoad") !== false) {
var onPlayersUnloaded = function() {
html = wrapper.innerHTML;
// do not use splash as alternate content for flashembed
if (html && !flashembed.isSupported(params.version)) {
wrapper.innerHTML = "";
......@@ -565,14 +566,6 @@ function Player(wrapper, params, conf) {
unload: function(fn) {
// if we are fullscreen on safari, we can't unload as it would crash the PluginHost, sorry
if (this.isFullscreen() && /WebKit/i.test(navigator.userAgent)) {
if ( fn ) { fn(false); }
return self;
}
// unload only if in splash state
if (html.replace(/\s/g,'') !== '') {
......@@ -585,6 +578,11 @@ function Player(wrapper, params, conf) {
// try closing
try {
if (api) {
// issue511
if (api.fp_isFullscreen()) {
api.fp_toggleFullscreen();
}
api.fp_close();
// fire unload only when API is present
......@@ -600,7 +598,11 @@ function Player(wrapper, params, conf) {
if ( fn ) { fn(true); }
};
setTimeout(clean, 50);
if (/WebKit/i.test(navigator.userAgent) && ! /Chrome/i.test(navigator.userAgent)) {
setTimeout(clean, 0);
} else {
clean();
}
}
else if ( fn ) { fn(false); }
......@@ -720,7 +722,7 @@ function Player(wrapper, params, conf) {
},
getVersion: function() {
var js = "flowplayer.js 3.2.6";
var js = "flowplayer.js @VERSION";
if (self.isLoaded()) {
var ver = api.fp_getVersion();
ver.push(js);
......@@ -737,6 +739,14 @@ function Player(wrapper, params, conf) {
},
setClip: function(clip) {
each(clip, function(key, val) {
if (typeof val == 'function') {
bind(listeners, key, val);
delete clip[key];
} else if (key == 'onCuepoint'){
$f(wrapper).getCommonClip().onCuepoint(clip[key][0], clip[key][1]);
}
});
self.setPlaylist([clip]);
return self;
},
......@@ -745,6 +755,11 @@ function Player(wrapper, params, conf) {
return playerIndex;
},
bufferAnimate: function(enable) {
api.fp_bufferAnimate(enable === undefined || enable);
return self;
},
_swfHeight: function() {
return api.clientHeight;
}
......@@ -946,7 +961,7 @@ function Player(wrapper, params, conf) {
playerId = wrapper.id || "fp" + makeId();
apiId = params.id || playerId + "_api";
params.id = apiId;
conf.playerId = playerId;
html = wrapper.innerHTML;
// plain url is given as config
......@@ -954,9 +969,7 @@ function Player(wrapper, params, conf) {
conf = {clip:{url:conf}};
}
if (typeof conf.clip == 'string') {
conf.clip = {url: conf.clip};
}
conf.playerId = playerId;
// common clip is always there
conf.clip = conf.clip || {};
......@@ -967,6 +980,10 @@ function Player(wrapper, params, conf) {
conf.clip.url = wrapper.getAttribute("href", 2);
}
if (conf.clip.url) {
conf.clip.url = queryescape(conf.clip.url);
}
commonClip = new Clip(conf.clip, -1, self);
// playlist
......@@ -983,6 +1000,10 @@ function Player(wrapper, params, conf) {
clip = {url: "" + clip};
}
if (clip.url) {
clip.url = queryescape(clip.url);
}
// populate common clip properties to each clip
each(conf.clip, function(key, val) {
if (val !== undefined && clip[key] === undefined && typeof val != 'function') {
......@@ -1040,8 +1061,7 @@ function Player(wrapper, params, conf) {
function doClick(e) {
// ipad/iPhone --> follow the link if plugin not installed
var hasiPadSupport = self.hasiPadSupport && self.hasiPadSupport();
if (/iPad|iPhone|iPod/i.test(navigator.userAgent) && !/.flv$/i.test(playlist[0].url) && ! hasiPadSupport ) {
if (/iPad|iPhone|iPod/i.test(navigator.userAgent) && !/.flv$/i.test(playlist[0].url) && ! checkForIpadSupport() ) {
return true;
}
......@@ -1051,6 +1071,10 @@ function Player(wrapper, params, conf) {
return stopEvent(e);
}
function checkForIpadSupport() {
return self.hasiPadSupport && self.hasiPadSupport();
}
function installPlayer() {
// defer loading upon click
if (html.replace(/\s/g, '') !== '') {
......@@ -1066,7 +1090,8 @@ function Player(wrapper, params, conf) {
} else {
// prevent default action from wrapper. (fixes safari problems)
if (wrapper.addEventListener) {
//#195 check if we have ipad support and not block click events
if (wrapper.addEventListener && !checkForIpadSupport()) {
wrapper.addEventListener("click", stopEvent, false);
}
// load player
......@@ -1116,6 +1141,16 @@ function Iterator(arr) {
this.size = function() {
return arr.length;
};
var self = this;
for(name in Player.prototype) {
self[name] = function() {
var args = arguments;
self.each(function() {
this[name].apply(this, args);
});
};
}
}
// these two variables are the only global variables
......@@ -1176,8 +1211,8 @@ window.flowplayer = window.$f = function() {
params = extend({
bgcolor: "#000000",
version: [9, 0],
expressInstall: "http://static.flowplayer.org/swf/expressinstall.swf",
version: [10, 1],
expressInstall: "http://releases.flowplayer.org/swf/expressinstall.swf",
cachebusting: false
}, params);
......@@ -1197,13 +1232,13 @@ window.flowplayer = window.$f = function() {
// select node by id
} else {
var node = el(arg);
return new Player(node !== null ? node : arg, params, conf);
return new Player(node !== null ? node : clone(arg), clone(params), clone(conf));
}
// arg is a DOM element
} else if (arg) {
return new Player(arg, params, conf);
return new Player(arg, clone(params), clone(conf));
}
}
......@@ -1267,10 +1302,10 @@ if (typeof jQuery == 'function') {
//}}}
})();
}();
/**
* @license
* jQuery Tools 3.2.6 / Flashembed - New wave Flash embedding
* jQuery Tools @VERSION / Flashembed - New wave Flash embedding
*
* NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
*
......@@ -1279,10 +1314,10 @@ if (typeof jQuery == 'function') {
* Since : March 2008
* Date : @DATE
*/
(function() {
!function() {
var IE = document.all,
URL = 'http://www.adobe.com/go/getflashplayer',
URL = 'http://get.adobe.com/flashplayer',
JQUERY = typeof jQuery == 'function',
RE = /(\d+)[^\d]+(\d+)[^\d]*(\d*)/,
GLOBAL_OPTS = {
......@@ -1294,7 +1329,6 @@ if (typeof jQuery == 'function') {
// flashembed defaults
allowfullscreen: true,
allowscriptaccess: 'always',
wmode: 'opaque',
quality: 'high',
// flashembed specific options
......@@ -1359,10 +1393,14 @@ if (typeof jQuery == 'function') {
conf: GLOBAL_OPTS,
getVersion: function() {
var fo, ver;
var fo, ver, plugin;
try {
ver = navigator.plugins["Shockwave Flash"].description.slice(16);
plugin = navigator.plugins["Shockwave Flash"];
// Safari 6 reports version even when disabled
// but [0, 0] should be returned (#167)
if (plugin[0].enabledPlugin != null)
ver = plugin.description.slice(16);
} catch(e) {
try {
......@@ -1378,7 +1416,7 @@ if (typeof jQuery == 'function') {
}
ver = RE.exec(ver);
return ver ? [ver[1], ver[3]] : [0, 0];
return ver ? [1 * ver[1], 1 * ver[(ver[1] * 1 > 9 ? 2 : 3)] * 1] : [0, 0];
},
asString: function(obj) {
......@@ -1393,7 +1431,8 @@ if (typeof jQuery == 'function') {
obj = obj.replace(new RegExp('(["\\\\])', 'g'), '\\$1');
// flash does not handle %- characters well. transforms "50%" to "50pct" (a dirty hack, I admit)
obj = obj.replace(/^\s?(\d+\.?\d+)%/, "$1pct");
obj = obj.replace(/^\s?(\d+\.?\d*)%/, "$1pct")
return '"' +obj+ '"';
case 'array':
......@@ -1491,7 +1530,8 @@ if (typeof jQuery == 'function') {
// express install
} else if (opts.expressInstall && f.isSupported([6, 65])) {
root.innerHTML = f.getHTML(extend(opts, {src: opts.expressInstall}), {
MMredirectURL: location.href,
//xss fix #357
MMredirectURL: encodeURIComponent(location.href),
MMplayerType: 'PlugIn',
MMdoctitle: document.title
});
......@@ -1509,7 +1549,8 @@ if (typeof jQuery == 'function') {
(root.tagName == 'A' ? "<p>Click here to download latest version</p>" :
"<p>Download latest version from <a href='" + URL + "'>here</a></p>");
if (root.tagName == 'A') {
//#526. allow click through event for flash installation message when using div containers.
if (root.tagName == 'A' || root.tagName == "DIV") {
root.onclick = function() {
location.href = URL;
};
......@@ -1555,7 +1596,7 @@ if (typeof jQuery == 'function') {
if (JQUERY) {
// tools version number
jQuery.tools = jQuery.tools || {version: '3.2.6'};
jQuery.tools = jQuery.tools || {version: '@VERSION'};
jQuery.tools.flashembed = {
conf: GLOBAL_OPTS
......@@ -1563,10 +1604,9 @@ if (typeof jQuery == 'function') {
jQuery.fn.flashembed = function(opts, conf) {
return this.each(function() {
jQuery(this).data("flashembed", flashembed(this, opts, conf));
$(this).data("flashembed", flashembed(this, opts, conf));
});
};
}
})();
}();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment