// Flowplayer API Connector
VideoJS.tech.flowplayer = {
name: "Flowplayer",
supported: function(){
if (flowplayer) {
return true;
} else {
return false;
}
},
canPlaySource: function(sourceObj){
if (sourceObj.type in _V_.tech.flowplayer.supports.format) { return "maybe"; }
},
supports: {
format: {
"video/flv": "FLV",
"video/x-flv": "FLV",
"video/mp4": "MP4",
"video/m4v": "MP4"
},
// Optional events that we can manually mimic with timers
event: {
progress: false,
timeupdate: false
}
},
init: function(sourceObj){
var player = this;
flowplayer(
this.box.id, // Where it will put the swf object inside of
{
src: 'http://releases.flowplayer.org/swf/flowplayer-3.2.5.swf',
wmode: 'opaque'
},
{
clip: {
url: sourceObj.src,
autoPlay: false,
scaling: "fit",
onBegin: _V_.proxy(this, function(){
this.triggerEvent("loadstart");
})
},
autoPlay: true,
onLoad: function() {
player.tels.flowplayer = document.getElementById(player.box.id+"_api");
player.tels.flowplayer.className = "vjs-tech";
player.tels.flowplayer.api = this; // Need to re-establish API on object
player.triggerEvent("techready");
},
// Hide Flowplayer's big play button
play: {opacity: 0},
// Hide Flowplayer's controls
plugins: { controls: { autoHide: "always" } },
plugins: { controls: null }
}
);
},
api: {
setupTriggers: function(){
// Map flowplayer events to video.js events
var map = [
{ f:"onStart", v:"play" },
{ f:"onResume", v:"play" },
{ f:"onPause", v:"pause" },
{ f:"onVolume", v:"volumechange" },
{ f:"onError", v:"error" }
];
_V_.each(map, _V_.proxy(this, function(item){
this.tels.flowplayer.api[item.f](_V_.proxy(this, function(e){ this.triggerEvent(item.v, e); }));
}));
},
play: function(){ this.tels.flowplayer.api.play(); },
pause: function(){ this.tels.flowplayer.api.pause(); },
paused: function(){
return !this.tels.flowplayer.api.isPlaying(); // More accurate than isPaused
},
currentTime: function(){ return this.tels.flowplayer.api.getTime(); },
setCurrentTime: function(seconds){ this.tels.flowplayer.api.seek(seconds); },
duration: function(){
var clip = this.tels.flowplayer.api.getClip();
return (clip) ? clip.duration : 0;
},
buffered: function(){
var status = this.tels.flowplayer.api.getStatus();
return _V_.createTimeRange(status.bufferStart, status.bufferEnd);
},
volume: function(){ return _V_.round(this.tels.flowplayer.api.getVolume() / 100, 2); },
setVolume: function(percentAsDecimal){ this.tels.flowplayer.api.setVolume(parseInt(percentAsDecimal * 100)); },
muted: function(){ return this.volume() == 0; },
setMuted: function(bool){
if (bool) {
this.values.mutedVol = this.volume();
this.volume(0);
} else {
this.volume(this.values.mutedVol);
}
},
supportsFullScreen: function(){
return false; // Flash does not allow fullscreen through javascript
// Maybe at click listener, and say "click screen".
},
enterFullScreen: function(){ this.tels.flowplayer.api.toggleFullscreen(); },
readError: function(eventArguments){
var errorCode = arguments[0],
errorMessage = arguments[1];
return errorMessage;
},
src: function(src){
this.setClip(src);
},
load: function(){
// Flowplayer always auto loads
}
}
};
/*
* flowplayer.js 3.2.4. The Flowplayer API
*
* Copyright 2009 Flowplayer Oy
*
* This file is part of Flowplayer.
*
* Flowplayer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Flowplayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Flowplayer. If not, see .
*
* Date: 2010-08-25 12:48:46 +0000 (Wed, 25 Aug 2010)
* Revision: 551
*/
(function(){function g(o){console.log("$f.fireEvent",[].slice.call(o))}function k(q){if(!q||typeof q!="object"){return q}var o=new q.constructor();for(var p in q){if(q.hasOwnProperty(p)){o[p]=k(q[p])}}return o}function m(t,q){if(!t){return}var o,p=0,r=t.length;if(r===undefined){for(o in t){if(q.call(t[o],o,t[o])===false){break}}}else{for(var s=t[0];p1){var t=arguments[1],q=(arguments.length==3)?arguments[2]:{};if(typeof t=="string"){t={src:t}}t=i({bgcolor:"#000000",version:[9,0],expressInstall:"http://static.flowplayer.org/swf/expressinstall.swf",cachebusting:true},t);if(typeof o=="string"){if(o.indexOf(".")!=-1){var s=[];m(n(o),function(){s.push(new b(this,k(t),k(q)))});return new d(s)}else{var r=c(o);return new b(r!==null?r:o,t,q)}}else{if(o){return new b(o,t,q)}}}return null};i(window.$f,{fireEvent:function(){var o=[].slice.call(arguments);var q=$f(o[0]);return q?q._fireEvent(o.slice(1)):null},addPlugin:function(o,p){b.prototype[o]=p;return $f},each:m,extend:i});if(typeof jQuery=="function"){jQuery.fn.flowplayer=function(q,p){if(!arguments.length||typeof arguments[0]=="number"){var o=[];this.each(function(){var r=$f(this);if(r){o.push(r)}});return arguments.length?o[arguments[0]]:new d(o)}return this.each(function(){$f(this,k(q),p?k(p):{})})}}})();(function(){var h=document.all,j="http://www.adobe.com/go/getflashplayer",c=typeof jQuery=="function",e=/(\d+)[^\d]+(\d+)[^\d]*(\d*)/,b={width:"100%",height:"100%",id:"_"+(""+Math.random()).slice(9),allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:[3,0],onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function i(m,l){if(l){for(var f in l){if(l.hasOwnProperty(f)){m[f]=l[f]}}}return m}function a(f,n){var m=[];for(var l in f){if(f.hasOwnProperty(l)){m[l]=n(f[l])}}return m}window.flashembed=function(f,m,l){if(typeof f=="string"){f=document.getElementById(f.replace("#",""))}if(!f){return}if(typeof m=="string"){m={src:m}}return new d(f,i(i({},b),m),l)};var g=i(window.flashembed,{conf:b,getVersion:function(){var m,f;try{f=navigator.plugins["Shockwave Flash"].description.slice(16)}catch(o){try{m=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");f=m&&m.GetVariable("$version")}catch(n){try{m=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");f=m&&m.GetVariable("$version")}catch(l){}}}f=e.exec(f);return f?[f[1],f[3]]:[0,0]},asString:function(l){if(l===null||l===undefined){return null}var f=typeof l;if(f=="object"&&l.push){f="array"}switch(f){case"string":l=l.replace(new RegExp('(["\\\\])',"g"),"\\$1");l=l.replace(/^\s?(\d+\.?\d+)%/,"$1pct");return'"'+l+'"';case"array":return"["+a(l,function(o){return g.asString(o)}).join(",")+"]";case"function":return'"function()"';case"object":var m=[];for(var n in l){if(l.hasOwnProperty(n)){m.push('"'+n+'":'+g.asString(l[n]))}}return"{"+m.join(",")+"}"}return String(l).replace(/\s/g," ").replace(/\'/g,'"')},getHTML:function(o,l){o=i({},o);var n='";return n},isSupported:function(f){return k[0]>f[0]||k[0]==f[0]&&k[1]>=f[1]}});var k=g.getVersion();function d(f,n,m){if(g.isSupported(n.version)){f.innerHTML=g.getHTML(n,m)}else{if(n.expressInstall&&g.isSupported([6,65])){f.innerHTML=g.getHTML(i(n,{src:n.expressInstall}),{MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title})}else{if(!f.innerHTML.replace(/\s/g,"")){f.innerHTML="
Flash version "+n.version+" or greater is required
"+(k[0]>0?"Your version is "+k:"You have no flash plugin installed")+"