aboutsummaryrefslogtreecommitdiff
path: root/libraries/phpvideotoolkit/examples/common/pluginobject
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/phpvideotoolkit/examples/common/pluginobject')
-rw-r--r--libraries/phpvideotoolkit/examples/common/pluginobject/CHANGELOG2
-rw-r--r--libraries/phpvideotoolkit/examples/common/pluginobject/LICENSE18
-rw-r--r--libraries/phpvideotoolkit/examples/common/pluginobject/OPTIONS76
-rw-r--r--libraries/phpvideotoolkit/examples/common/pluginobject/README83
-rw-r--r--libraries/phpvideotoolkit/examples/common/pluginobject/SUPPORTED PLUGINS32
-rw-r--r--libraries/phpvideotoolkit/examples/common/pluginobject/pluginobject.js669
-rw-r--r--libraries/phpvideotoolkit/examples/common/pluginobject/plugins/divx.js76
-rw-r--r--libraries/phpvideotoolkit/examples/common/pluginobject/plugins/flash.js191
-rw-r--r--libraries/phpvideotoolkit/examples/common/pluginobject/plugins/flash/expressInstall.swfbin0 -> 773 bytes
-rw-r--r--libraries/phpvideotoolkit/examples/common/pluginobject/plugins/flashmedia.js136
-rw-r--r--libraries/phpvideotoolkit/examples/common/pluginobject/plugins/quicktime.js112
-rw-r--r--libraries/phpvideotoolkit/examples/common/pluginobject/plugins/realplayer.js85
-rw-r--r--libraries/phpvideotoolkit/examples/common/pluginobject/plugins/shockwave.js42
-rw-r--r--libraries/phpvideotoolkit/examples/common/pluginobject/plugins/windowsmediaplayer.js119
14 files changed, 1641 insertions, 0 deletions
diff --git a/libraries/phpvideotoolkit/examples/common/pluginobject/CHANGELOG b/libraries/phpvideotoolkit/examples/common/pluginobject/CHANGELOG
new file mode 100644
index 0000000..e28827f
--- /dev/null
+++ b/libraries/phpvideotoolkit/examples/common/pluginobject/CHANGELOG
@@ -0,0 +1,2 @@
+[0.1.0.alpha] [1.04.2008]
+ - Initial Release.
diff --git a/libraries/phpvideotoolkit/examples/common/pluginobject/LICENSE b/libraries/phpvideotoolkit/examples/common/pluginobject/LICENSE
new file mode 100644
index 0000000..47888a8
--- /dev/null
+++ b/libraries/phpvideotoolkit/examples/common/pluginobject/LICENSE
@@ -0,0 +1,18 @@
+PluginObject Copyright (c) 2008 Oliver Lillie <http://www.buggedcom.co.uk>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions: The above copyright
+notice and this permission notice shall be included in all copies or
+substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE. \ No newline at end of file
diff --git a/libraries/phpvideotoolkit/examples/common/pluginobject/OPTIONS b/libraries/phpvideotoolkit/examples/common/pluginobject/OPTIONS
new file mode 100644
index 0000000..102dd44
--- /dev/null
+++ b/libraries/phpvideotoolkit/examples/common/pluginobject/OPTIONS
@@ -0,0 +1,76 @@
+
+Required Options
+- width
+ The width of the media.
+- height
+ The height of the media.
+
+
+Optional Options
+- require_min_version
+ If a minimum version of plugin is to be used you can then set an integer or string
+ version. For example, '6.0.4' or 6. If set to false no version checking is carried out
+ but checks are made to see if the plugin does exist.
+- auto_load
+ Determines if unloaded plugin sources should be dynamically loaded at runtime.
+- auto_embed
+ Determines if the plugin should be embeded automagically when the DOM is ready. If set
+ to false then you will have to call the write() function yourself.
+- force_plugin
+ If you wish to force a particular plugin type as opposed to the autodetected type.
+ The value would be one of the plugin Plugin values, ie one of the values in
+ PluginObject.Plugins.Flash or similar.
+- force_into_id
+ If you wish to embed the object into a particular element provide the element id to
+ this option. Note: if no id is supplied PO will automatically attempt
+ to embed the media into the current element.
+- force_plugin_id
+ When PO creates the embed html it will automagically create it's own
+ unique id. If you want to force a plugin id set it here.
+- params
+ Any extra params you wish to provide the media with.
+- attributes
+ Any extra element attributes you wish to provide the media with.
+
+
+Media Placeholder Options
+- placeholder
+ If you wish to use a click to display placeholder set this to the url of the
+ image to use.
+- placeholder_alt
+ The placeholder image alt text to use.
+- placeholder_title
+ The title in the placeholder href.
+- placeholder_autoplay
+ Autoplays the media (if applicable) when the placeholder is clicked and the media is embeded.
+
+
+On Fail Options
+- on_fail_message
+ The message that is displayed if the version is incorrect, note this is only
+ displayed if options.on_fail_redirect = false.
+- on_fail_redirect
+ If you wish for a redirection if the player fails then set this to the url
+ you wish to redirect to.
+- on_fail_callback
+ If you wish to use a custom on fail callback method. This will be called before
+ the on_fail_message and on_fail_redirect methods are checked. If you wish to fall
+ back from your custom callback to these methods, this function must return a false
+ (boolean) value.
+
+
+Skip Detection Options
+- skip_detect_allow
+ If you wish to use a click to display placeholder set this to the url of the
+ image to use.
+- memorise_detect_status
+ The placeholder image alt text to use.
+- memorise_cookie_expiry
+ The title in the placeholder href.
+- memorise_cookie_path
+ The title in the placeholder href.
+- memorise_cookie_domain
+ The title in the placeholder href.
+- memorise_cookie_secure
+ The title in the placeholder href.
+
diff --git a/libraries/phpvideotoolkit/examples/common/pluginobject/README b/libraries/phpvideotoolkit/examples/common/pluginobject/README
new file mode 100644
index 0000000..4b9fd04
--- /dev/null
+++ b/libraries/phpvideotoolkit/examples/common/pluginobject/README
@@ -0,0 +1,83 @@
+-----------
+INFO
+-----------
+Q] What is PluginObject?
+A] PluginObject is an end-all solution to embedding browser based plugins. For
+ those of you familiar with SWFObject, PluginObject is remarkably similar,
+ except with PluginObject you are not just limited to the Flash Plugin.
+
+Q] What plugins are supported?
+A] See OPTIONS (below) for more information.
+
+Q] I already use SWFObject, is there any point in using PluginObject instead?
+A] Most likely, no. If you are using SWFObject already and your site only
+ utilizes the Flash plugin then there is no need to update your site.
+ However if you use multiple plugins across your site then updating from
+ your current solution to PluginObject may hold certain advantages.
+
+Q] What are the advantages of PluginObject?
+A] 1. Multiple plugin support. PluginObject already supports over 7 different
+ types of plugins and with PluginObject's architecture being easy to extend
+ then it has never before been easier to embed plugins.
+ 2. Same code, different plugin. The same code is used to embed all plugin
+ types, so there is not much to learn.
+ 3. Autoloading javascript libraries. If you're using a dynamic page and you
+ are not sure what plugin will be required on your page, then don't worry,
+ don't load all the libraries regardless of wether or not you will use them.
+ PluginObject takes care of everything, simply load the base pluginobject.js
+ file and embed your plugins as normal. PluginObject will dynamically load
+ the required javascript as soon as the library is required.
+ 4. Automatic placeholders across all plugins even if the plugin does not
+ support it! Every wanted an easy way of providing placeholder support on a
+ plugin that doesn't support it, well now any plugin that is supported by
+ PluginObject can make use of placeholders. (Placeholders are images that
+ are loaded in-place of the plugin when the page loads. The user is then
+ required to 'activate' the plugin by clicking on the placeholder)
+
+Q] Which library should I use, PluginObject or SWFObject?
+A] The answer is realistically either as they both provide the same
+ functionality. However if you are using multiple plugins on your site then
+ PluginObject provides a uniform way of embedding them. But if you are
+ using only the Flash plugin then SWFObject is probably the best choice for
+ you as SWFObject is only 8kb and the combination of the PluginObject and
+ Flash Plugin code is 14.5kb.
+
+-----------
+DEMOS
+-----------
+See DEMOS for more information about PluginObject demos
+
+-----------
+CHANGES
+-----------
+See CHANGELOG for version changes.
+
+-----------
+SUPPORTED PLUGINS
+-----------
+See SUPPORTED PLUGINS for a list of plugins that PluginObject supports. If you
+wish to add a plugin to the repository add it to the bug tracker at
+Sourceforge as a Feature Request.
+
+-----------
+OPTIONS
+-----------
+See OPTIONS for a list of options and detailed explanations about each one.
+
+-----------
+UPDATING
+-----------
+The new home of pluginobject is located at Sourceforge. Whilst I will make
+every effort to update the files at every location it is updated you should
+always check the Sourceforge repository for the latest version.
+
+http://sourceforge.net/projects/pluginobject/
+
+
+
+
+Regards,
+bugged
+
+
+/* SVN FILE: $Id$ */
diff --git a/libraries/phpvideotoolkit/examples/common/pluginobject/SUPPORTED PLUGINS b/libraries/phpvideotoolkit/examples/common/pluginobject/SUPPORTED PLUGINS
new file mode 100644
index 0000000..75b9568
--- /dev/null
+++ b/libraries/phpvideotoolkit/examples/common/pluginobject/SUPPORTED PLUGINS
@@ -0,0 +1,32 @@
+-----------
+PLUGINS
+-----------
+
+FLASH
+- default extensions; swf, flash
+
+QUICKTIME
+- default extensions; mov, mpeg, mpg, avi, acc, qt, wav, au
+
+REALPLAYER
+- default extensions; ra, ram, rv, rpm
+
+WINDOWS MEDIA PLAYER
+- default extensions; wmv, wma, wvx, wax, asf, asx
+
+DIVX PLAYER
+- default extensions; divx
+
+SHOCKWAVE
+- default extensions; dcr
+
+-----------
+SPECIAL
+-----------
+
+FLASH MEDIA
+- Automatically embeds media within Jeroen Wijering's Flash Media Player
+ http://www.jeroenwijering.com/
+- default extensions; mp3, flv, jpg, jpeg, png, gif
+
+
diff --git a/libraries/phpvideotoolkit/examples/common/pluginobject/pluginobject.js b/libraries/phpvideotoolkit/examples/common/pluginobject/pluginobject.js
new file mode 100644
index 0000000..8806327
--- /dev/null
+++ b/libraries/phpvideotoolkit/examples/common/pluginobject/pluginobject.js
@@ -0,0 +1,669 @@
+if(typeof [].inArray !== 'function')
+{
+ Array.prototype.inArray = function(s)
+ {
+ var i = this.length;
+ if (i > 0)
+ {
+ do {
+ if (this[i] === s) return true;
+ } while (i--);
+ }
+ return false;
+ };
+}
+// create object
+PO = {
+tist : (new Date())
+};
+// create reference object for keeping track of placeholder callbacks
+PO.R = {};
+// create reference object for keeping track of callbacks.
+PO.C = {
+ _c: {},
+ register: function()
+ {
+
+ },
+ commit: function(n, a)
+ {
+ if(d._f[i].s) return d._f[i].s[d._f[i].f].apply(d._f[i].s, a);
+ else return d._f[i].f.apply(d._f[i], a);
+ }
+};
+
+// file extension maps used for automagically translating files
+// It should be noted that the looping order will start with Flash and work it's way down
+// through the list, so you should list the plugins in order of priority because
+// most plugins can handle similar files. For example you could play mp3's in Quicktime,
+// WindowsMediaPlayer or Realplayer but preference is given to FlashMedia if automagically
+// guessing.
+PO.Plugins = {
+ Flash : { src:'flash', dependencies:null, name:'Flash', ext:['swf', 'flash'] },
+ FlashMedia : { src:'flashmedia', dependencies:['Flash'], name:'FlashMedia', ext:['mp3', 'flv', /*'swf', 'mpg', 'mpeg'*/, 'jpg', 'jpeg', 'png', 'gif'] }, // uses Jeroen's Media Player http://www.jeroenwijering.com/?item=JW_FLV_Media_Player
+ Quicktime : { src:'quicktime', dependencies:null, name:'Quicktime', ext:['mov', 'mpeg', 'mpg', 'avi', 'acc', 'qt', 'wav', 'au'] },
+ RealPlayer : { src:'realplayer', dependencies:null, name:'RealPlayer', ext:['ra', 'ram', 'rv', 'rpm'] },
+ WindowsMediaPlayer : { src:'windowsmediaplayer', dependencies:null, name:'WindowsMediaPlayer', ext:['wmv', 'wma', 'wvx', 'wax', 'asf', 'asx'] },
+ Divx : { src:'divx', dependencies:null, name:'DivX', ext:['divx'] },
+ Shockwave : { src:'shockwave', dependencies:null, name:'Shockwave', ext:['dcr'] }
+};
+
+// the library object that contains the loaded plugin libraries
+PO.L = {};
+
+// The message library
+PO.M = {
+ throw_errors: true,
+ throw_debug: true,
+ Debug : {
+ OnForce : 'PluginObject: The plugin you tried to force embed "%src%" could not be embedded using the plugin specified by options.force_plugin. Attempting to automagically guess the plugin type.',
+ OnRequireLoad : 'PluginObject: The plugin you tried to force embed "%src%" could not be embedded as you have disabled auto loading of plugin libraries in options.auto_load.'
+ },
+ Error : {
+ OnFail : 'The current version of the %library% plugin is too old. You currently have version %version% but you need at least version %required% to view this plugin. We suggest that you upgrade %library% to the latest version. To upgrade please <a href="%upgrade%" target="_blank">click here</a>. However, you may wish to try running the plugin in your current version <a href="%nodetect%">click here</a>.',
+ OnAutoMagic : 'PluginObject ERROR: The plugin you tried to force embed "%src%" could not be embedded automagically. Perhaps you need to specify which plugin to use by setting the Plugin in options.force_plugin.',
+ OnLibrary : 'PluginObject ERROR: The plugin library you tried to use was successfully loaded, however it has either loaded an incorrect file or you have malformed library code as the "%library%" library cannot be accessed.',
+ OnWrite : 'PluginObject ERROR: It was not possible embed "%src%" because the element "%elm%" was not found in the DOM.',
+ OnWriteSealed : 'PluginObject ERROR: It was not possible embed "%src%" because the DOM has already finished loading so document.write(); could not be used.',
+ OnWriteSealedDyLoad : 'PluginObject ERROR: It was not possible embed "%src%" because the DOM has already finished loading so document.write(); could not be used. HOWEVER, this has only occurred because the plugin library was required to dynamically load. You can get around this issue by including the required libraries after the pluginobject script link, or specifing an element id to load the media into using option.force_into_id.'
+ },
+ parse : function(m, r)
+ {
+ if(r)
+ {
+ for(var a in r)
+ {
+ m = m.split('%'+a+'%').join(r[a]);
+ }
+ }
+ return m;
+ },
+ call: function(m, r, t)
+ {
+ m = PO.M.parse(m, r);
+ if(t == 'e' && PO.M.throw_errors)
+ {
+ if(PO.U.Browser.IE) alert(m);
+ else throw new Error(m);
+ }
+ else if(PO.U.HasConsole && PO.M.throw_debug) console.log(m);
+ }
+};
+
+// The default options object
+PO.Options = {
+ /**
+ * Required Options
+ * - width
+ * The width of the media.
+ * - height
+ * The height of the media.
+ */
+ width : null,
+ height : null,
+
+ /**
+ * Optional Options
+ * - require_min_version
+ * If a minimum version of plugin is to be used you can then set an integer or string
+ * version. For example, '6.0.4' or 6. If set to false no version checking is carried out
+ * but checks are made to see if the plugin does exist.
+ * - auto_load
+ * Determines if unloaded plugin sources should be dynamically loaded at runtime.
+ * - auto_embed
+ * Determines if the plugin should be embeded automagically when the DOM is ready. If set
+ * to false then you will have to call the write() function yourself.
+ * - force_plugin
+ * If you wish to force a particular plugin type as opposed to the autodetected type.
+ * The value would be one of the plugin Plugin values, ie one of the values in
+ * PluginObject.Plugins.Flash or similar.
+ * - force_into_id
+ * If you wish to embed the object into a particular element provide the element id to
+ * this option. Note: if no id is supplied PO will automatically attempt
+ * to embed the media into the current element.
+ * - force_plugin_id
+ * When PO creates the embed html it will automagically create it's own
+ * unique id. If you want to force a plugin id set it here.
+ * - params
+ * Any extra params you wish to provide the media with.
+ * - attributes
+ * Any extra element attributes you wish to provide the media with.
+ * - no_cache
+ * Append a random query string to the url so it doesn't cache.
+ */
+ require_min_version : 1,
+ auto_load : true,
+ auto_load_prefix : 'plugins/',
+ auto_load_suffix : '.js',
+ auto_embed : true,
+ force_plugin : null,
+ force_into_id : null,
+ force_plugin_id : null,
+ params : {},
+ attributes : {},
+ no_cache : false,
+
+ /**
+ * Media Placeholder Options
+ * - placeholder
+ * If you wish to use a click to display placeholder set this to the url of the
+ * image to use.
+ * - placeholder_alt
+ * The placeholder image alt text to use.
+ * - placeholder_title
+ * The title in the placeholder href.
+ * - placeholder_autoplay
+ * Autoplays the media (if applicable) when the placeholder is clicked and the media is embeded.
+ */
+ placeholder : false,
+ placeholder_alt : 'PluginObject placeholder.',
+ placeholder_title : 'Click to view plugin.',
+ placeholder_autoplay : true,
+
+ /**
+ * On Fail Options
+ * - on_fail_message
+ * The message that is displayed if the version is incorrect, note this is only
+ * displayed if options.on_fail_redirect = false.
+ * - on_fail_redirect
+ * If you wish for a redirection if the player fails then set this to the url
+ * you wish to redirect to.
+ * - on_fail_callback
+ * If you wish to use a custom on fail callback method. This will be called before
+ * the on_fail_message and on_fail_redirect methods are checked. If you wish to fall
+ * back from your custom callback to these methods, this function must return a false
+ * (boolean) value.
+ */
+ on_fail_message : PO.M.Error.OnFail,
+ on_fail_redirect : false,
+ on_fail_callback : null,
+
+ /**
+ * Skip Detection Options
+ * - skip_detect_allow
+ * If you wish to use a click to display placeholder set this to the url of the
+ * image to use.
+ * - memorise_detect_status
+ * The placeholder image alt text to use.
+ * - memorise_cookie_expiry
+ * The title in the placeholder href.
+ * - memorise_cookie_path
+ * The title in the placeholder href.
+ * - memorise_cookie_domain
+ * The title in the placeholder href.
+ * - memorise_cookie_secure
+ * The title in the placeholder href.
+ */
+ skip_detect_allow : true,
+ skip_detect_key : 'skipdetect',
+ memorise_detect_status : true,
+ memorise_cookie_expiry : new Date().getTime()+31449600000,
+ memorise_cookie_path : '/',
+ memorise_cookie_domain : null,
+ memorise_cookie_secure : false
+};
+
+// Utility methods
+var _ua = navigator.userAgent.toLowerCase();
+var _up = navigator.platform.toLowerCase();
+PO.U = {
+// borrowed from prototype and jquery
+ Browser: {
+ Version : (_ua.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],
+ Safari : /webkit/.test(_ua),
+ Opera : !!window.opera,
+ IE : !!(window.attachEvent && !window.opera),
+ Mozilla : /mozilla/.test(_ua) && !/(compatible|webkit)/.test(_ua),
+ MobileSafari : !!_ua.match(/apple.*mobile.*safari/),
+ Gecko : _ua.indexOf('gecko') > -1 && _ua.indexOf('khtml') == -1
+ },
+// borrowed from swfobject
+ Platform: {
+ Win : /win/.test(_up ? _up : ua),
+ Apple : /mac/.test(_up ? _up : ua),
+ Linux : /linux/.test(_up ? _up : ua)
+ },
+ HasConsole : (window.console ? console.log : false),
+ merge: function(u, d)
+ {
+ var c = {}, p;
+ for (p in u)
+ {
+ if(typeof u[p] != 'function')
+ {
+ c[p] = u[p];
+ }
+ }
+ for (p in d)
+ {
+ if(typeof d[p] != 'function')
+ {
+ if(typeof c[p] == 'undefined') c[p] = d[p];
+ }
+ }
+ return c;
+ },
+ determinePluginType: function(s, t)
+ {
+// type is hard set, validate
+ if(t)
+ {
+ if(!t || typeof t != 'object' || (!t.src || !t.name || !t.ext))
+ {
+ PO.M.call(PO.M.Debug.OnForce, {src:s}, 'd');
+ t = false;
+ }
+ return t;
+ }
+// automagically guess plugin type from extension
+ if(!t)
+ {
+ var ext = s.split('.').pop().toLowerCase();
+ for(var a in PO.Plugins)
+ {
+ if(PO.Plugins[a].ext.inArray(ext))
+ {
+ return PO.Plugins[a];
+ }
+ }
+ }
+ PO.M.call(PO.M.Error.OnAutoMagic, {src:s}, 'd');
+ return false;
+ },
+ loadPlugin: function(p, c, o)
+ {
+ if(p.dependencies)
+ {
+ for(var i=0, a=p.dependencies.length; i<a; i++)
+ {
+ var pc, lp = p.dependencies[i];
+ if(i == a-1)
+ {
+ p.dependencies = null;
+ pc = {f:PO.U.loadPlugin, a:[p, c, o]};
+ }
+ else pc = null;
+ PO.U.loadPlugin(PO.Plugins[lp], pc, o);
+ }
+ return;
+ }
+ if(!PO.U._lpref[p.src]) PO.U._lpref[p.src] = [];
+ var l = o.auto_load_prefix+p.src+o.auto_load_suffix, s, i = PO.U._lpref[p.src].push({p:p, c:c})-1;
+ if(PO.DOM.Sealed || !PO.U.Browser.IE)
+ {
+ if (document.createElement && (s = document.createElement('script')))
+ {
+ s.src = l;
+ s.type = 'text/javascript';
+ s.onload = s.onreadystatechange = function(e)
+ {
+ PO.U._loadPlugin(p.src, i, e);
+ };
+ var h = document.getElementsByTagName('head')[0];
+ if (h) h.appendChild(s);
+ }
+ }
+ else
+ {
+ document.write('<scr'+'ipt type="text/javascript" src="'+l+'" onreadystatechange="PO.U._loadPlugin(\''+p.src+'\', '+i+', event);" onload="PO.U._loadPlugin(\''+p.src+'\', '+i+', event);"></'+'script>');
+ }
+ },
+ _lpref: {},
+ _loadPlugin: function(ref, i, e)
+ {
+ if(e.type == 'readystatechange' && e.srcElement.readyState != 'complete') return;
+ var c = PO.U._lpref[ref][i];
+ if(c.p.loaded == 2) return;
+ c.p.loaded = 2;
+ if(c.c) c.c.f.apply(c.c, c.c.a);
+ },
+ hash: function(l)
+ {
+ var c = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz", h ='', cl = c.length;
+ for (var i=0; i<l; i++)
+ {
+ var r = Math.floor(Math.random() * cl);
+ h += c.substring(r,r+1);
+ }
+ return h;
+ },
+ getParam: function(p)
+ {
+ var q = document.location.search || document.location.hash;
+ if(q)
+ {
+ var s = q.indexOf(p +'=');
+ var e = (q.indexOf('&', s) > -1) ? q.indexOf('&', s) : q.length;
+ if (q.length > 1 && s > -1)
+ {
+ return q.substring(q.indexOf('=', s)+1, e);
+ }
+ }
+ return null;
+ }
+};
+
+// DOM ready binding code lifted/inspired by jquery
+PO.DOM = {
+ Sealed: false,
+ Ready : false,
+ Bound : false,
+ _f : [],
+ register: function(f, a, s)
+ {
+ var d = PO.DOM;
+ if(d.Ready)
+ {
+ if(s) s[f].apply(s, a);
+ else f.apply(null, a);
+ return;
+ }
+ PO.DOM._f.push({f:f, a:a, s:s});
+ },
+ commit: function(e)
+ {
+ var d = PO.DOM;
+ if((e && e.load) || d.Ready)
+ {
+ d.Sealed = true;
+ if(d.Ready) return;
+ }
+ d.Ready = true;
+ for(var i=0, l=d._f.length; i<l; i++)
+ {
+ if(d._f[i].s) d._f[i].s[d._f[i].f].apply(d._f[i].s, d._f[i].a);
+ else d._f[i].f.apply(d._f[i], d._f[i].a);
+ }
+ },
+ bind: function()
+ {
+ if(this.Bound) return;
+ this.Bound = true;
+
+// Mozilla, and webkit nightlies
+ if (document.addEventListener && !PO.U.Browser.Opera) document.addEventListener('DOMContentLoaded', PO.DOM.commit, false);
+
+// If IE is used and is not in a frame
+// Continually check to see if the document is ready
+ if (PO.U.Browser.IE && window == top)
+ {
+ (function()
+ {
+ if (PO.DOM.Ready) return;
+ try
+ {
+// If IE is used, use the trick by Diego Perini
+// http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll('left');
+ }
+ catch( error )
+ {
+ setTimeout(arguments.callee, 0);
+ return;
+ }
+ PO.DOM.commit();
+ })();
+ }
+
+// Opera
+ if (PO.U.Browser.Opera) document.addEventListener('DOMContentLoaded', function ()
+ {
+ if (PO.DOM.Ready) return;
+ for (var i = 0; i < document.styleSheets.length; i++)
+ {
+ if (document.styleSheets[i].disabled)
+ {
+ setTimeout(arguments.callee, 0);
+ return;
+ }
+ }
+ PO.DOM.commit();
+ }, false);
+
+// Safari
+ if (PO.U.Browser.Safari)
+ {
+ var stl = document.getElementsByTagName('link'), a, sl=0, sts, stsl;
+ for(a=0, l=stl.length; a<l; a++)
+ {
+ if(stl.item(a).getAttribute('rel') == 'stylesheet') sl += 1;
+ }
+ (function(){
+ if (PO.DOM.Ready) return;
+ if (document.readyState != 'loaded' && document.readyState != 'complete')
+ {
+ setTimeout( arguments.callee, 0 );
+ return;
+ }
+ var sts = document.getElementsByTagName('style');
+ stsl = sts.length;
+ if (document.styleSheets.length != sl+stsl)
+ {
+ setTimeout(arguments.callee, 0);
+ return;
+ }
+ PO.DOM.commit();
+ })();
+ }
+
+// A fallback to window.onload, that will always work
+ if (typeof window.addEventListener != 'undefined') window.addEventListener('load', PO.DOM.commit, false);
+ else if (typeof document.addEventListener != 'undefined') document.addEventListener('load', PO.DOM.commit, false);
+ else if (typeof window.attachEvent != 'undefined') window.attachEvent('onload', PO.DOM.commit);
+ else if (typeof window.onload == 'function')
+ {
+ var wol = window.onload;
+ window.onload = function()
+ {
+ wol();
+ PO.DOM.commit();
+ };
+ }
+ else window.onload = PO.DOM.commit;
+ }
+};
+
+PO.embed = function(src, opt)
+{
+ o = PO.U.merge(opt, PO.Options);
+ p = PO.U.determinePluginType(src, o.force_plugin);
+ if(p)
+ {
+ if(p.loaded > 0)
+ {
+ if(!PO.L[p.name])
+ {
+ setTimeout(PO.embed, 10, src, opt);
+ return;
+ }
+ if(!PO.L[p.name])
+ {
+ PO.M.call(PO.M.Error.OnLibrary, {src:src, library:p.name}, 'e');
+ return false;
+ }
+ var sk = o._skip_detect_key = o.skip_detect_key+'-'+p.name, gp = PO.U.getParam(sk), cn = 'PO-'+p.name+'-Memory=', sd = false;
+ if(gp)
+ {
+ sd = gp == 'true';
+ if(o.memorise_detect_status)
+ {
+ var t = (new Date()).getTime(), e = o.memorise_cookie_expiry, c = cn + gp
+ + '; expires=' + (new Date( t > e ? t + e : e )).toGMTString()
+ + (o.memorise_cookie_path ? '; path=' + o.memorise_cookie_path : '')
+ + (o.memorise_cookie_domain ? '; domain=' + o.memorise_cookie_domain : '')
+ + (o.memorise_cookie_secure ? '; secure' : '');
+ }
+ }
+ else
+ {
+ if(o.memorise_detect_status)
+ {
+ var cp = document.cookie.indexOf(escape(cn)+'='), cv = false;
+ if(cp != -1)
+ {
+ var pv = p + cn.length, ep = document.cookie.indexOf(';', pv);
+ cv = unescape(document.cookie.substring(pv, ep != -1 ? ep : null));
+ sd = cv == 'true';
+ }
+ }
+ }
+ o._skip_detect = (sd && o.skip_detect_allow);
+ o.attributes = PO.U.merge(o.attributes, {
+ width : o.width,
+ height : o.height
+ });
+ return PO.L[p.name].create(src, o, p);
+ }
+ else if(o.auto_load)
+ {
+ opt.force_plugin = p;
+ PO.U.loadPlugin(p, {f:PO.embed, a:[src, opt]}, o);
+ return true;
+ }
+ else
+ {
+ PO.M.call(PO.M.Debug.OnRequireLoad, {src:src, library:p.name}, 'd');
+ return false;
+ }
+ }
+};
+
+// the player version object for detecting which is correct version
+// orginal idea geoff stearns and swfobject.
+PO.U.PlayerVersion = function(v)
+{
+ var ma = parseInt(v[0]);
+ this.ma = ma != null ? ma : 0;
+ this.mi = parseInt(v[1]) || 0;
+ this.r = parseInt(v[2]) || 0;
+};
+PO.U.PlayerVersion.prototype = {
+ validate: function(v)
+ {
+ if(this.ma < v.ma) return false;
+ if(this.ma > v.ma) return true;
+ if(this.mi < v.mi) return false;
+ if(this.mi > v.mi) return true;
+ return !(this.r < v.r);
+ },
+ toString: function()
+ {
+ return [this.ma, this.mi, this.rev].join('.');
+ }
+};
+
+// the object embed writer
+PO.ObjectEmbed = function(src, o, lp, rp)
+{
+ this._id = o._id = o.force_plugin_id ? o.force_plugin_id : 'PluginObject-'+PO.U.hash(8)+'-'+(new Date()).getTime();
+ this.src = src;
+ this.plugin = lp;
+ this._rp = rp;
+ o.attributes = PO.U.merge(o.attributes, {
+ codebase : o.codebase,
+ class_id : o.class_id,
+ mime_type : o.mime_type
+ });
+ o.attributes = PO.U.merge({
+ width : o.width,
+ height : o.height
+ }, o.attributes);
+ this.options = o;
+ this.attributes = o.attributes || {};
+ this.params = o.params || {};
+ this.Version = {
+ Required : o.version ? new PO.U.PlayerVersion(o.version.toString().split('.')) : new PO.U.PlayerVersion([1,0,0]),
+ Valid : false,
+ Installed : false
+ };
+
+ if(o.no_cache) this.src += (this.src.indexOf('?') === -1 ? '?' : '&') + (new Date()).getTime();
+
+ if(!o._skip_detect) this.Version.Installed = lp.detectVersion(o, this.Version.Required);
+ if(o._skip_detect || this.Version.Installed != -1)
+ {
+ this.Version.Valid = o._skip_detect ? true : this.Version.Installed.validate(this.Version.Required);
+ if(o.auto_embed && o.force_into_id) PO.DOM.register('write', [], this);
+ else this.write();
+ }
+};
+PO.ObjectEmbed.prototype = {
+ write: function()
+ {
+ var el, o = this.options, h, elnf;
+ if(typeof o.force_into_id == 'string')
+ {
+ if(!(el = document.getElementById(o.force_into_id))) PO.M.call(PO.M.Error.OnWrite, {src:this.src, elm:o.force_into_id}, 'e');
+ }
+ elnf = typeof el == 'undefined';
+ if(this.Version.Valid)
+ {
+ h = (o.placeholder) ? this._placeholder() : this._html();
+ if(elnf)
+ {
+ if(PO.DOM.Ready && this._rp.loaded == 2) PO.M.call(PO.M.Error.OnWriteSealedDyLoad, {src:this.src}, 'e');
+ else document.write(h);
+ }
+ else el.innerHTML = h;
+ return true;
+ }
+ else
+ {
+ if(o.on_fail_redirect)
+ {
+ document.location.replace(o.on_fail_redirect);
+ }
+ else
+ {
+ var nd = document.location.href, m;
+ nd += (nd.indexOf('?') == -1 ? '?' : '&')+o._skip_detect_key+'=true';
+ m = PO.M.parse(o.on_fail_message, {library:this._rp.name, version:this.Version.Installed.toString(), required:this.Version.Required.toString(), upgrade:o.upgrade_url, nodetect:nd});
+ if(elnf)
+ {
+ if(PO.DOM.Sealed) alert(m);
+ else document.write(m);
+ }
+ else el.innerHTML = m;
+ }
+ }
+ return false;
+ },
+ _placeholder: function()
+ {
+ var o = this.options, h;
+ PO.R[this._id] = this;
+ h = '<img id="PlaceHolder-'+this._id+'" src="'+o.placeholder+'" width="'+o.width+'" height="'+o.height+'" title="'+o.placeholder_title+'" alt="'+o.placeholder_alt+'" style="cursor:pointer;" onclick="PO.R[\''+this._id+'\']._activate();" />';
+ if(!o.force_into_id) h = '<div id="Wrapper-'+this._id+'">'+h+'</div>';
+ return h;
+ },
+ _activate: function()
+ {
+ var o = this.options, el = document.getElementById('PlaceHolder-'+this._id);
+ o.placeholder = null;
+ el.parentNode.removeChild(el);
+ if(!o.force_into_id) o.force_into_id = 'PlaceHolder-Wrapper-'+this._id;
+ this.write();
+ },
+ _html: function()
+ {
+ var h = '', a = this.attributes, p = this.params;
+ if(PO.U.Browser.IE)
+ {
+ h = '<object id="'+ this._id +'" classid="'+ a.class_id +'" codebase="'+a.codebase+'" width="'+ a.width +'" height="'+ a.height +'"><param name="src" value="'+ this.src +'" />';
+ for(var key in p) h += '<param name="'+ key +'" value="'+ p[key] +'" />';
+ h += "</object>";
+ }
+// PC IE
+ else
+ {
+ h = '<embed type="'+ a.mime_type +'" src="'+ this.src +'" width="'+ a.width +'" height="'+ a.height +'" id="'+ this._id +'" name="'+ this._id +'" pluginspace="'+o.upgrade_url+'" ';
+ for(var key in p) h += [key] +'="'+ p[key] +'" ';
+ h += '/>';
+ }
+ return h;
+ }
+};
+
+// bind the on content callbacks
+PO.DOM.bind();
+PluginObject = PO;
diff --git a/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/divx.js b/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/divx.js
new file mode 100644
index 0000000..7e1bd3a
--- /dev/null
+++ b/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/divx.js
@@ -0,0 +1,76 @@
+PO.L.DivX = {
+
+ options: {
+ upgrade_url : 'http://go.divx.com/plugin/download/',
+ class_id : 'clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616',
+ codebase : 'http://go.divx.com/plugin/DivXBrowserPlugin.cab',
+ mime_type : 'video/divx'
+ },
+
+// scripting sdk avaiable here
+// http://download.divx.com/player/DivXWebPlayer_WebmasterSDK.zip
+ params: {
+// mode : null, // null, zero, mini, large, full
+// minVersion : '0.0.0',
+// allowContextMenu : true,
+// autoPlay : false,
+// loop : false,
+// bannerEnabled : false,
+// bufferingMode : 'auto', // null, auto, full
+// previewImage : null,
+// previewMessage : '',
+// previewMessageFontSize : 12,
+// movieTitle : null
+ },
+ attributes: {},
+
+ create: function(src, o, p)
+ {
+ o = PO.U.merge(o, PO.L.DivX.options);
+
+ o.params = PO.U.merge(o.params || {}, PO.L.DivX.params);
+ o.attributes = PO.U.merge(o.attributes || {}, PO.L.DivX.attributes);
+
+ if(o.placeholder && o.placeholder_autoplay) o.params.autoPlay = true;
+
+ return new ObjectEmbed(src, o, PO.L.DivX, p);
+ },
+
+ _installed_version: false,
+ detectVersion: function(o, rv)
+ {
+// this code is lifted/adapted from http://includes.stage6.com/javascript/divx_plugin.js?v4
+ if(PO.L.DivX._installed_version) return PO.L.DivX._installed_version;
+ var pv = new PO.U.PlayerVersion([0,0,0]);
+ if(navigator.plugins && navigator.mimeTypes["application/x-mplayer2"] && navigator.mimeTypes["application/x-mplayer2"].enabledPlugin)
+ {
+ navigator.plugins.refresh(false); // not entirley sure this is neccesary?
+ var rc = new RegExp('divx.*?((web)|(browser))', 'i');
+ for (var i=0; i < navigator.plugins.length; i++)
+ {
+ var x = navigator.plugins[i];
+ if (rc.text(x.name))
+ {
+ var a = x.description.indexOf('version '), v = '1.0.0';
+ if (a != -1) v = x.description.substring(a + 8);
+ pv = new PO.U.PlayerVersion(v.split('.'));
+ break;
+ }
+ }
+ }
+ else
+ {
+ var dp = false, dpv = false;
+ execScript('on error resume next: dp = IsObject(CreateObject("npdivx.DivXBrowserPlugin.1"))', 'VBScript');
+ if(dp)
+ {
+ execScript('on error resume next: dpv = CreateObject("npdivx.DivXBrowserPlugin.1").GetVersion()', 'VBScript');
+ pv = new PO.U.PlayerVersion(dpv.split('.'));
+ }
+ }
+ PO.L.DivX._installed_version = pv;
+ return pv;
+ }
+
+};
+PO.Plugins.DivX.loaded = 1; \ No newline at end of file
diff --git a/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/flash.js b/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/flash.js
new file mode 100644
index 0000000..cdfc97a
--- /dev/null
+++ b/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/flash.js
@@ -0,0 +1,191 @@
+PO.M.Debug.OnExpressInstall = 'PluginObject: Flash Player version "%ver%" is outdated. Version "%verreq%" is required. Running express install.';
+PO.L.Flash = {
+
+ options: {
+ upgrade_url : 'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash',
+ class_id : 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000',
+ codebase : 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
+ mime_type : 'application/x-shockwave-flash',
+ quality : 'high',
+ bgcolor : null,
+ bgcolour : null,
+ use_express_install : false,
+ do_express_install : false,
+ express_install_swf : 'plugins/flash/expressinstall.swf'
+ },
+
+ variables: {}, // these are flashvars
+
+// best docs
+// http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
+ params: {
+// swliveconnect : false,
+// play : true,
+// loop : false,
+// menu : true,
+// quality : 'high',
+// scale : 'showall',
+// align : null,
+// salign : 'tl',
+// wmode : 'window',
+// bgcolor : null,
+// base : ''
+ },
+ attributes: {},
+
+ create: function(src, o, p)
+ {
+ o = PO.U.merge(o, PO.L.Flash.options);
+
+ o.params = PO.U.merge(o.params || {}, PO.L.Flash.params);
+ o.variables = PO.U.merge(o.variables || {}, PO.L.Flash.variables);
+ o.attributes = PO.U.merge(o.attributes || {}, PO.L.Flash.attributes);
+
+ if(o.do_express_install)
+ {
+ o.params.MMplayerType = PO.U.Browser.IE ? 'Active-X' : 'Plugin';
+ if(PO.U.Browser.IE)
+ {
+ o.params.wmode = 'transparent';
+// to complete <------------------------------------------------------------------------------
+ }
+ }
+
+ var v = [];
+ for(var a in o.variables)
+ {
+ v.push(a+'='+escape(o.variables[a]));
+ }
+ if(v.length) o.params.flashvars = v.join('&');
+
+ if(!o.params.bgcolor)
+ {
+ var bg = o.bgcolour ? o.bgcolour : (o.bgcolor ? o.bgcolor : false);
+ if(bg) o.params.bgcolor = bg;
+ }
+ o.params.quality = o.quality;
+
+ return new PO.ObjectEmbed(src, o, PO.L.Flash, p);
+ },
+
+ _express_install_active: false,
+ _installed_version: false,
+ detectVersion: function(o, rv)
+ {
+// most of this is lifted/adapted directly from swfobject methods
+// SWFObject v2.0 rc1 <http://code.google.com/p/swfobject/>
+// Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
+ if(PO.L.Flash._installed_version) return PO.L.Flash._installed_version;
+ var pv = new PO.U.PlayerVersion([0, 0, 0]), ma, mi, rev, d, pva;
+ if (typeof navigator.plugins != 'undefined' && typeof navigator.plugins['Shockwave Flash'] == 'object')
+ {
+ d = navigator.plugins['Shockwave Flash'].description;
+ if (d)
+ {
+ d = d.replace(/^.*\s+(\S+\s+\S+$)/, '$1');
+ ma = parseInt(d.replace(/^(.*)\..*$/, '$1'), 10);
+ min = parseInt(d.replace(/^.*\.(.*)\s.*$/, '$1'), 10);
+ rev = /r/.test(d) ? parseInt(d.replace(/^.*r(.*)$/, '$1'), 10) : 0;
+ pv = new PO.U.PlayerVersion([ma, mi, rev]);
+ }
+ }
+ else if (typeof window.ActiveXObject != 'undefined')
+ {
+ var a = null, fp6_crash = false;
+ try
+ {
+ a = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.7');
+ }
+ catch(e)
+ {
+ try
+ {
+ a = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
+ pva = [6,0,21];
+ a.AllowScriptAccess = 'always'; // Introduced in fp6.0.47
+ }
+ catch(e)
+ {
+ if (pva[0] == 6)
+ {
+ fp6_crash = true;
+ }
+ }
+ if (!fp6_crash)
+ {
+ try
+ {
+ a = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
+ }
+ catch(e) {}
+ }
+ }
+ if (!fp6_crash && typeof a == 'object')
+ {
+ try
+ {
+ d = a.GetVariable('$version');
+ if (d)
+ {
+ d = d.split(' ')[1].split(',');
+ pva = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+ }
+ }
+ catch(e) {}
+ }
+ pv = new PO.U.PlayerVersion(pva);
+ }
+ PO.L.Flash._installed_version = pv;
+
+ if(pv.ma == 8 && PO.U.Platform.Win)
+ {
+// again copied/adapted from swfobject, see credits above
+ window.attachEvent('onunload', function ()
+ {
+ var o = document.getElementsByTagName('object');
+ if (o)
+ {
+ var ol = o.length;
+ for (var i = 0; i < ol; i++)
+ {
+ o[i].style.display = 'none';
+ for (var x in o[i])
+ {
+ if (typeof o[i][x] == 'function') o[i][x] = function() {};
+ }
+ }
+ }
+ });
+ }
+ if(!pv.validate(rv) && o.use_express_install && pv.validate(new PO.U.PlayerVersion([6,0,65])) && (PO.U.Platform.Win || PO.U.Platform.Apple))
+ {
+// again copied/adapted from swfobject, see credits above
+ PO.L.Flash._express_install_active = true;
+ PO.M.call(PO.M.Debug.OnExpressInstall, {ver:pv.toString(), verreq:rv.toString()}, 'd');
+// if(!o.force_into_id)
+// {
+// h = '<div id="PO_Wrapper_'+this._id+'">'+h+'</div>';
+// }
+ return -1;
+ }
+ return pv;
+ },
+
+ expressInstallCallback: function()
+ {
+// again copied/adapted from swfobject, see credits above
+ if (PO.L.Flash._express_install_active && storedAltContent)
+ {
+ var obj = document.getElementById('SWFObjectExprInst');
+ if (obj)
+ {
+ obj.parentNode.replaceChild(storedAltContent, obj);
+ storedAltContent = null;
+ PO.L.Flash._express_install_active = false;
+ }
+ }
+ }
+};
+// for use with the swfobject express install so simple swaps can be made.
+swfobject = { expressInstallCallback: PO.Plugins.Flash.expressInstallCallback };
+PO.Plugins.Flash.loaded = 1;
diff --git a/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/flash/expressInstall.swf b/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/flash/expressInstall.swf
new file mode 100644
index 0000000..86958bf
--- /dev/null
+++ b/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/flash/expressInstall.swf
Binary files differ
diff --git a/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/flashmedia.js b/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/flashmedia.js
new file mode 100644
index 0000000..ceb9043
--- /dev/null
+++ b/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/flashmedia.js
@@ -0,0 +1,136 @@
+// uses http://www.jeroenwijering.com/?item=JW_FLV_Media_Player
+PO.L.FlashMedia = {
+
+ options:{
+ player : 'plugins/flash/mediaplayer.swf',
+ auto_fix_path : true, // fixes the src path so it is treated as relative to the html document. only applies if the src url doesn't contain http at the start of the url
+ auto_adjust_height : true, // auto adjust the display height so the video fits correctly and if a playlist is used so does that.
+ use_type_mapping : true // automagically maps file extensions to specifc types.
+ },
+// for more information on the variables you should use this page http://code.longtailvideo.com/trac/wiki/FlashVars#Fileproperties
+// these variables are for v4 of the jw player and above
+ variables : {
+// General
+ config : null, // (undefined): location of a XML file with flashvars. Useful for short embed codes or CDN stream redirecting. example.
+// File properties
+ author : null, // (undefined): author of the video, shown in the display or playlist.
+ captions : null, // (undefined): location of a TT captions XML file.
+ description : null, // (undefined): text description of the file.
+ duration : 0, // (0): duration of the file in seconds.
+ file : null, // (undefined): location of the mediafile or playlist to play.
+ image : null, // (undefined): location of a preview image; shown in display and playlist.
+ link : null, // (undefined): url to an external page the display, controlbar and playlist can link to.
+ start : 0, // (0): position in seconds where playback has to start.
+ title : null, // (undefined): title of the video, shown in the display or playlist.
+ type : null, // (undefined): type of file, can be sound, image, video, youtube, camera, http or rtmp. Use this to override auto-detection.
+// Colors
+ backcolor : 'FFFFFF', // (FFFFFF): background color of the controlbar and playlist.
+ frontcolor : '000000', // (000000): color of all icons and texts in the controlbar and playlist.
+ lightcolor : '000000', // (000000): color of an icon or text when you rollover it with the mouse.
+ screencolor : '000000', // (000000): background color of the display.
+// Layout
+ controlbar : 'bottom', // (bottom): position of the controlbar. Can be set to bottom, over and none.
+ controlbarsize : 20, // (20): height of the controlbar in pixels.
+ height : 400, // (400): height of the display (not the entire player!) in pixels.
+ logo : null, // (undefined): location of an external jpg,png or gif image to show in the display.
+ playlist : 'none', // (none): position of the playlist. Can be set to bottom, over, right or none.
+ playlistsize : 180, // (180): size of the playlist. When below or above, this refers to the height, when right, this refers to the width of the playlist.
+ skin : null, // (undefined): location of a SWF file with the player graphics.
+ width : 280, // (280): width of the display (not the entire player!) in pixels.
+// Playback
+ autostart : false, // (false): automatically start the player on load.
+ bufferlength : 0.1, // (0.1): number of seconds of the file that has to be loaded before starting.
+ displayclick : 'play', // (play): what to do when one clicks the display. Can be play, link, fullscreen, none, mute, next.
+ item : 0, // (0): playlistitem that should start to play. Use this to set a specific start-item.
+ mute : false, // (false): mute all sounds on startup. Is saved as cookie.
+ quality : true, // (true): enables high-quality playback. This sets the smoothing of videos on/off, the deblocking of videos on/off and the dimensions of the camera small/large. Is saved as cookie.
+ repeat : 'none', // (none): set to list to play the entire playlist once and to always to continously play the song/video/playlist.
+ shuffle : false, // (false): shuffle playback of playlistitems.
+ state : 'IDLE', // (IDLE): current playback state of the player (IDLE, BUFFERING, PLAYING, PAUSED, COMPLETED).
+ stretching : 'uniform',// (uniform): defines how to resize images in the display. Can be none (no stretching), exactfit (disproportionate), uniform (stretch with black borders) or fill (uniform, but completely fill the display).
+ volume : 90, // (90): startup volume of the player. Is saved as cookie.
+// External
+ abouttext : null, // (undefined): text to show in the rightclick menu. Please do not change this if you don't have a commercial license! When undefined it shows the player version.
+ aboutlink : 'http://www.jeroenwijering.com/?page=about', // (http://www.jeroenwijering.com/?page=about): url to link to from the rightclick menu. Do not change this if you don't have a commercial license!
+ client : null, // (Flash MAC X,0,XXX,0): Version and platform of the Flash client plugin. Useful to check for e.g. MP4 playback or fullscreen capabilities.
+ id : 'ply', // (ply): ID of the player within the javascript DOM. Useful for javascript interaction.
+ linktarget : '_blank', // (_blank): browserframe where the links from display are opened in. Some possibilities are '_self' (same frame) , '_blank' (new browserwindow) or 'none' (links are ignored in the player, so javascript can handle it).
+ streamer : null, // (undefined): location of a server to use for streaming. Can be an RTMP application (here's an example) or external PHP/ASP file to use for HTTP streaming. If set to lighttpd, the player presumes a Lighttpd server is used to stream videos.
+ tracecall : null // (undefined): name of a javascript function that can be used for tracing the player activity. All events from the view, model and controller are sent there.
+
+ },
+ params: {
+ allowfullscreen:true
+ },
+ attributes: {},
+ typemap:{
+ ut : 'youtube',
+ youtube : 'youtube',
+ tube : 'youtube',
+ mp3 : 'sound',
+ m4a : 'sound',
+ m4b : 'sound',
+ m4p : 'sound',
+ m4v : 'sound',
+ m4r : 'sound',
+ aac : 'sound',
+ '3gp' : 'video',
+ mp4 : 'video',
+ flv : 'video',
+ swf : 'video',
+ jpg : 'image',
+ jpeg: 'image',
+ gif : 'image',
+ png : 'image',
+ mpg : 'video',
+ mpeg: 'video'
+ },
+
+ create: function(src, o, p)
+ {
+ var fo = PO.U.merge(PO.L.Flash.options, PO.L.FlashMedia.options), h = document.location.href;
+ o = PO.U.merge(o, fo);
+ if(o.auto_fix_path && src.indexOf('http') === -1)
+ {
+ src = h.substr(0, h.lastIndexOf('/')+1) + src;
+ }
+
+ var fa = PO.U.merge(PO.L.Flash.attributes, PO.L.FlashMedia.attributes);
+ o.attributes = PO.U.merge(o.attributes || {}, fa);
+
+ var fv = PO.U.merge(PO.L.Flash.variables, PO.L.FlashMedia.variables);
+ o.variables = PO.U.merge(o.variables || {}, fv);
+ o.variables.file = src;
+ if(!o.variables.width) o.variables.width = o.width;
+ if(!o.variables.height) o.variables.height = o.height;
+ if(o.auto_adjust_height)
+ {
+ o.height += o.variables.controlbarsize;
+ if(o.variables.playlist !== 'none')
+ {
+ o.height += o.variables.playlistsize;
+ }
+ }
+
+ if(o.use_type_mapping && o.variables.type === null)
+ {
+ var e = src.split('.').pop().toLowerCase();
+ if(PO.L.FlashMedia.typemap[e]) o.variables.type = PO.L.FlashMedia.typemap[e];
+ }
+ for(var a in o.variables)
+ {
+ if(o.variables[a] === null) delete o.variables[a];
+ }
+
+ var fp = PO.U.merge(PO.L.Flash.params, PO.L.FlashMedia.params);
+ o.params = PO.U.merge(o.params || {}, PO.L.FlashMedia.params);
+ o.bgcolour = o.variables.backcolor;
+
+ if(!o.variables.id) o.variables.id = o.force_id ? o.force_id : 'PluginObject-'+PO.U.hash(8)+'-'+(new Date()).getTime();
+
+ if(o.placeholder && o.placeholder_autoplay) o.variables.autostart = true;
+
+ return PO.L.Flash.create(o.player, o, PO.Plugins.Flash, p);
+ }
+};
+PO.Plugins.FlashMedia.loaded = 1; \ No newline at end of file
diff --git a/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/quicktime.js b/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/quicktime.js
new file mode 100644
index 0000000..a54f66f
--- /dev/null
+++ b/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/quicktime.js
@@ -0,0 +1,112 @@
+PO.L.Quicktime = {
+
+ options: {
+ upgrade_url : 'http://www.apple.com/quicktime/download/',
+ class_id : 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
+ codebase : 'http://www.apple.com/qtactivex/qtplugin.cab',
+ mime_type : 'video/quicktime',
+ auto_adjust_height : true,
+ bgcolor : null,
+ bgcolour : null
+ },
+
+// best info
+// http://developer.apple.com/documentation/QuickTime/Conceptual/QTScripting_HTML/QTScripting_HTML_Document/chapter_1000_section_5.html#//apple_ref/doc/uid/TP40001525-2-QuickTimeltEMBEDgtandltOBJECTgtParameters
+ params: {
+// allowembedtagoverrides : true,
+// autohref : false,
+// autoplay : false,
+// bgcolor : '#ffffff',
+// controller : true,
+// correction : 'none',
+// dontflattenwhensaving : true,
+// enablehref : false,
+// enablejavascript : false,
+// endtime : null,
+// fov : 0,
+// goto : null,
+// // hotspotn : null,
+// href : null,
+// kioskmode : true,
+// loop : false,
+// movieid : null,
+// moviename : null,
+// movieqtlist : null,
+// node : null,
+// pan : 0,
+// playeveryframe : false,
+// qtnext : null,
+// qtsrc : null,
+// // url : null,
+// qtsrcchokespeed : null,
+// qtsrcdontusebrowser : false,
+// saveembedtags : true,
+// scale : 'tofit',
+// showlogo : true,
+// starttime : null,
+// target : 'myself',
+// targetcache : true,
+// tilt : 0,
+// urlsubstitute : '',
+// volume : 60
+ },
+ attributes: {},
+
+ create: function(src, o, p)
+ {
+ o = PO.U.merge(o, PO.L.Quicktime.options);
+
+ o.params = PO.U.merge(o.params || {}, PO.L.Quicktime.params);
+ o.attributes = PO.U.merge(o.attributes || {}, PO.L.Quicktime.attributes);
+
+ var e = src.split('.').pop().toLowerCase();
+ if(e != 'mp3' && o.auto_adjust_height && (typeof o.params.controller == 'undefined' || o.params.controller))
+ {
+ o.height += 16;
+ }
+
+ var bg = o.bgcolour ? o.bgcolour : (o.bgcolor ? o.bgcolor : false);
+ if(bg) o.params.bgcolor = bg;
+
+ if(o.placeholder && o.placeholder_autoplay) o.params.autoplay = true;
+
+ return new PO.ObjectEmbed(src, o, PO.L.Quicktime, p);
+ },
+
+ _installed_version: false,
+ detectVersion: function(o, rv)
+ {
+ if(PO.L.Quicktime._installed_version) return PO.L.Quicktime._installed_version;
+ var pv = new PO.U.PlayerVersion([0, 0, 0]);
+ if(navigator.plugins && navigator.mimeTypes.length)
+ {
+ for (var i=0; i < navigator.plugins.length; i++)
+ {
+ var x = navigator.plugins[i];
+ if (x.name.indexOf("QuickTime") > -1)
+ {
+ pv = new PO.U.PlayerVersion(x.name.replace(/([a-z]|[A-Z]|-|\s)+/, '').split('.'));
+ break;
+ }
+ }
+ }
+ else
+ {
+ pv = new PO.U.PlayerVersion([1,0,0]);
+ try
+ {
+ var axo = new ActiveXObject("QuickTimeCheckObject.QuickTimeCheck.1");
+ if (axo.QuickTimeVersion)
+ {
+// get the leading 3 hex digits
+ var v = axo.QuickTimeVersion >> 16;
+ pv = new PO.U.PlayerVersion([(v & 0xf00) >> 8, (v & 0x0f0) >> 4, v & 0x00f]);
+ }
+ }
+ catch(e) {}
+ }
+ PO.L.Quicktime._installed_version = pv;
+ return pv;
+ }
+};
+PO.Plugins.Quicktime.loaded = 1;
diff --git a/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/realplayer.js b/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/realplayer.js
new file mode 100644
index 0000000..c638210
--- /dev/null
+++ b/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/realplayer.js
@@ -0,0 +1,85 @@
+PO.L.RealPlayer = {
+
+ options: {
+ upgrade_url : 'http://www.real.com/',
+ class_id : 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
+ mime_type : 'audio/x-pn-realaudio-plugin',
+ bgcolor : null,
+ bgcolour : null
+ },
+
+// best info available
+// http://www.w3schools.com/media/media_realvideo.asp
+ params: {
+// backgroundcolor : null,
+// center : 'true',
+// controls : 'All', // see below
+// console : null,
+// autostart : false,
+// nolabels : false,
+// reset : false,
+// autogotoURL : null
+ },
+ attributes: {},
+/*
+ All - Displays a full player with all controls.
+ InfoVolumePanel - Title, author, and copyright and volume slider.
+ InfoPanel - Title, author, and copyright.
+ ControlPanel - Position slider, play, pause, and stop buttons.
+ StatusPanel - Messages, current time position, and clip length.
+ PlayButton - Play and pause buttons.
+ StopButton - Stop button.
+ VolumeSlider - Volume slider.
+ PositionField - Position and clip length.
+ StatusField - Messages.
+ ImageWindow - The video image
+ StatusBar - Status, position and channels.
+*/
+ create: function(src, o, p)
+ {
+ o = PO.U.merge(o, PO.L.RealPlayer.options);
+
+ o.params = PO.U.merge(o.params || {}, PO.L.RealPlayer.params);
+ o.attributes = PO.U.merge(o.attributes || {}, PO.L.RealPlayer.attributes);
+
+ var bg = o.params.backgroundcolor ? o.params.backgroundcolor : (o.bgcolour ? o.bgcolour : (o.bgcolor ? o.bgcolor : '#FFFFFF'));
+ if(bg.charAt(0) != '#' && bg.length == 6) bg = '#' + bg;
+ o.params.backgroundcolor = bg;
+
+ if(!o.params.console) o.params.console = PO.U.hash(8);
+
+ if(o.placeholder && o.placeholder_autoplay) o.params.autostart = true;
+
+ return new PO.ObjectEmbed(src, o, PO.L.RealPlayer, p);
+ },
+
+ _installed_version: false,
+ detectVersion: function(o, rv)
+ {
+ if(PO.L.RealPlayer._installed_version) return PO.L.RealPlayer._installed_version;
+ var pv = false;
+ if(navigator.plugins && navigator.mimeTypes.length)
+ {
+ for (var i=0; i < navigator.plugins.length; i++)
+ {
+ var x = navigator.plugins[i];
+ if (x.name.indexOf('RealPlayer') > -1)
+ {
+ pv = true;
+ }
+ }
+ }
+ else
+ {
+ execScript('on error resume next: rp1 = IsObject(CreateObject("rmocx.RealPlayer G2 Control"))', 'VBScript');
+ execScript('on error resume next: rp2 = IsObject(CreateObject("RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)"))', 'VBScript');
+ execScript('on error resume next: rp3 = IsObject(CreateObject("RealVideo.RealVideo(tm) ActiveX Control (32-bit)"))', 'VBScript');
+ pv = (rp1 || rp2 || rp3);
+ }
+ pv = new PO.U.PlayerVersion([(pv === true) ? 1 : 0, 0, 0]);
+ PO.L.RealPlayer._installed_version = pv;
+ return pv;
+ }
+
+};
+PO.Plugins.RealPlayer.loaded = 1;
diff --git a/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/shockwave.js b/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/shockwave.js
new file mode 100644
index 0000000..6af0b2e
--- /dev/null
+++ b/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/shockwave.js
@@ -0,0 +1,42 @@
+PO.L.Shockwave = {
+
+ options: {
+ upgrade_url : 'http://www.adobe.com/shockwave/download/',
+ class_id : 'clsid:166B1BCA-3F9C-11CF-8075-44455354000',
+ codebase : 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab',
+ mime_type : 'application/x-director'
+ },
+
+ params: {},
+ attributes: {},
+
+ create: function(src, o, p)
+ {
+ o = PO.U.merge(o, PO.L.Shockwave.options);
+
+ o.params = PO.U.merge(o.params || {}, PO.L.Shockwave.params);
+ o.attributes = PO.U.merge(o.attributes || {}, PO.L.Shockwave.attributes);
+
+ return new ObjectEmbed(src, o, PO.L.Shockwave, p);
+ },
+
+ _installed_version: false,
+ detectVersion: function(o, rv)
+ {
+ if(PO.L.Shockwave._installed_version) return PO.L.Shockwave._installed_version;
+ var pv = new PO.U.PlayerVersion([0,0,0]);
+ if (navigator.mimeTypes && navigator.mimeTypes["application/x-director"]&& navigator.mimeTypes["application/x-director"].enabledPlugin)
+ {
+// http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15722&sliceId=1
+// todo
+ }
+ else
+ {
+// todo
+ }
+ PO.L.Shockwave._installed_version = pv;
+ return pv;
+ }
+
+};
+PO.Plugins.Shockwave.loaded = 1; \ No newline at end of file
diff --git a/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/windowsmediaplayer.js b/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/windowsmediaplayer.js
new file mode 100644
index 0000000..2abe5c1
--- /dev/null
+++ b/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/windowsmediaplayer.js
@@ -0,0 +1,119 @@
+PO.L.WindowsMediaPlayer = {
+
+ options: {
+ upgrade_url : PO.U.Browser.Linux ? 'http://www.videolan.org/vlc/' : (PO.U.Platform.Apple ? 'http://www.flip4mac.com/wmv_download.htm' : 'http://www.microsoft.com/windows/windowsmedia/download/AllDownloads.aspx'),
+ class_id : 'clsid:22D6f312-B0F6-11D0-94AB-0080C74C7E95',
+ codebase : 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab',
+ mime_type : {
+ 'audio/x-pn-realaudio-plugin' : []
+ },
+ bgcolor : null,
+ bgcolour : null
+ },
+
+ params: {
+// AudioStream : true,
+// AutoSize : true,
+// AutoStart : true, // Sets if the player should start automatically
+// AnimationAtStart : true, // Sets if an animation should show while the file loads
+// AllowScan : true,
+// AllowChangeDisplaySize : true,
+// AutoRewind : false,
+// Balance : false,
+// BaseURL : null,
+// BufferingTime : 5,
+// CaptioningID : null,
+// ClickToPlay : false, // Sets if the player should start when the user clicks in the play area
+// CursorType : false,
+// CurrentPosition : true,
+// CurrentMarker : false,
+// DefaultFrame : null,
+// DisplayBackColor : false,
+// DisplayForeColor : 16777215,
+// DisplayMode : false,
+// DisplaySize : false,
+// Enabled : true,
+// EnableContextMenu : true,
+// EnablePositionControls : true,
+// EnableFullScreenControls: false,
+// EnableTracker : true,
+// // Filename : null, // The URL of the file to play
+// InvokeURLs : true,
+// Language : true,
+// Mute : false,
+// PlayCount : 1,
+// PreviewMode : false,
+// Rate : 1,
+// SAMILang : null,
+// SAMIStyle : null,
+// SAMIFileName : null,
+// SelectionStart : true,
+// SelectionEnd : true,
+// SendOpenStateChangeEvents : true,
+// SendWarningEvents : true,
+// SendErrorEvents : true,
+// SendKeyboardEvents : false,
+// SendMouseClickEvents : false,
+// SendMouseMoveEvents : false,
+// SendPlayStateChangeEvents : true,
+// ShowCaptioning : false,
+// ShowControls : true, // Sets if the player controls should show
+// ShowAudioControls : true, // Sets if the audio controls should show
+// ShowDisplay : false, // Sets if the display should show
+// ShowGotoBar : false, // Sets if the GotoBar should show
+// ShowPositionControls : true,
+// ShowStatusBar : false,
+// ShowTracker : true,
+// TransparantAtStart : false,
+// VideoBorderWidth : false,
+// VideoBorderColor : false,
+// VideoBorder3D : false,
+// Volume : -200,
+// WindowlessVideo : false
+ },
+ attributes: {},
+
+ create: function(src, o, p)
+ {
+ o = PO.U.merge(o, PO.L.WindowsMediaPlayer.options);
+
+ o.params = PO.U.merge(o.params || {}, PO.L.WindowsMediaPlayer.params);
+ o.attributes = PO.U.merge(o.attributes || {}, PO.L.WindowsMediaPlayer.attributes);
+
+ var bg = o.bgcolour ? o.bgcolour : (o.bgcolor ? o.bgcolor : false);
+ if(bg) o.params.bgcolor = bg;
+
+ if(o.placeholder && o.placeholder_autoplay) o.params.AutoStart = true;
+
+ return new PO.ObjectEmbed(src, o, PO.L.WindowsMediaPlayer, p);
+ },
+
+ _installed_version: false,
+ detectVersion: function(o, rv)
+ {
+ if(PO.L.WindowsMediaPlayer._installed_version) return PO.L.WindowsMediaPlayer._installed_version;
+ var pv = false,a;
+ if(navigator.plugins && navigator.plugins.length > 0)
+ {
+ np = navigator.plugins;
+ for (a=0; a < np.length; a++ )
+ {
+ if(np[a].name.indexOf('Windows Media') > -1)
+ {
+ pv = true;
+ break;
+ }
+ }
+ }
+ else
+ {
+ execScript('on error resume next: mp2 = IsObject(CreateObject("MediaPlayer.MediaPlayer.1"))', 'VBScript');
+ pv = (mp2);
+ }
+ pv = new PO.U.PlayerVersion([(pv === true) ? 1 : 0, 0, 0]);
+ PO.L.WindowsMediaPlayer._installed_version = pv;
+ return pv;
+ }
+
+};
+PO.Plugins.WindowsMediaPlayer.loaded = 1;