Author: sevein
Date: Wed Sep 23 12:58:23 2009
New Revision: 3477
Log:
Improvements in audio and video components, fixing issue 236:
- flowplayer swf updated to 3.1.3
- Added flowplayer plugin for audio representation/playback
- Added flowplayer plugin for controls personalization
- flashembed (jquery-tools) updated to 1.1.1
- flowplayer ui themed like qubit default css style
- Integration into showAudioComponent
- Removed old and unnecessary files.
Added:
trunk/web/flowplayer/flowplayer.audio.swf (contents, props changed)
trunk/web/flowplayer/flowplayer.controls.swf (contents, props changed)
trunk/web/flowplayer/flowplayer.swf (contents, props changed)
Deleted:
trunk/web/flowplayer/FlowPlayerDark.swf
trunk/web/vendor/flowplayer/flow.embed.js
trunk/web/vendor/flowplayer/flowPlayer.js
Modified:
trunk/apps/qubit/modules/digitalobject/actions/showAudioComponent.class.php
trunk/apps/qubit/modules/digitalobject/actions/showVideoComponent.class.php
trunk/apps/qubit/modules/digitalobject/templates/_showAudio.php
trunk/apps/qubit/modules/digitalobject/templates/_showVideo.php
trunk/web/css/flowPlayer.css
trunk/web/vendor/flowplayer/flashembed.min.js
Modified:
trunk/apps/qubit/modules/digitalobject/actions/showAudioComponent.class.php
==============================================================================
--- trunk/apps/qubit/modules/digitalobject/actions/showAudioComponent.class.php
Wed Sep 23 12:57:36 2009 (r3476)
+++ trunk/apps/qubit/modules/digitalobject/actions/showAudioComponent.class.php
Wed Sep 23 12:58:23 2009 (r3477)
@@ -37,12 +37,13 @@
{
$this->getResponse()->addJavaScript('/vendor/jquery');
$this->getResponse()->addJavaScript('/vendor/flowplayer/flashembed.min.js');
- $this->getResponse()->addJavaScript('/vendor/flowplayer/flow.embed.js');
$this->getResponse()->addStylesheet('flowPlayer');
- $this->pathToFlowPlayer = public_path('flowplayer/FlowPlayerDark.swf');
+ $this->pathToFlowPlayer = public_path('flowplayer/flowplayer.swf');
+ $this->pathToFlowPlayerAudioPlugin =
public_path('flowplayer/flowplayer.audio.swf');
// Get representation by usage type, audio objects haven't derivatives
- $this->representation =
$this->digitalObject->getRepresentationByUsage(QubitTerm::MASTER_ID);
+ $representation = $this->digitalObject->getFullPath();
+ $this->pathToAudioFile = public_path($representation);
}
}
\ No newline at end of file
Modified:
trunk/apps/qubit/modules/digitalobject/actions/showVideoComponent.class.php
==============================================================================
--- trunk/apps/qubit/modules/digitalobject/actions/showVideoComponent.class.php
Wed Sep 23 12:57:36 2009 (r3476)
+++ trunk/apps/qubit/modules/digitalobject/actions/showVideoComponent.class.php
Wed Sep 23 12:58:23 2009 (r3477)
@@ -37,10 +37,9 @@
{
$this->getResponse()->addJavaScript('/vendor/jquery');
$this->getResponse()->addJavaScript('/vendor/flowplayer/flashembed.min.js');
- $this->getResponse()->addJavaScript('/vendor/flowplayer/flow.embed.js');
$this->getResponse()->addStylesheet('flowPlayer');
- $this->pathToFlowPlayer = public_path('flowplayer/FlowPlayerDark.swf');
+ $this->pathToFlowPlayer = public_path('flowplayer/flowplayer.swf');
// Get representation by usage type
$this->representation =
$this->digitalObject->getRepresentationByUsage($this->usageType);
Modified: trunk/apps/qubit/modules/digitalobject/templates/_showAudio.php
==============================================================================
--- trunk/apps/qubit/modules/digitalobject/templates/_showAudio.php Wed Sep
23 12:57:36 2009 (r3476)
+++ trunk/apps/qubit/modules/digitalobject/templates/_showAudio.php Wed Sep
23 12:58:23 2009 (r3477)
@@ -1,23 +1,77 @@
<?php use_helper('Javascript') ?>
-
<?php echo javascript_tag(<<<EOF
- // select all link tags with "flowplayer" class and "video-enable" them.
+ // select all link tags with "flowplayer" class and "audio-enable" them.
$(function() {
- $("a.flowplayer").flowembed("$pathToFlowPlayer", {
+ $('a.flowplayer').flashembed('$pathToFlowPlayer', {
+ config:
+ {
clip: {
- autoplay: true,
- autoBuffering: true
+ autoPlay: false,
+ autoBuffering: true,
+ image: '/~jesus/qubit/web/images/generic-icons/blank.png',
+ url: "$pathToAudioFile"
+ },
+ plugins: {
+ audio: {
+ url: '$pathToFlowPlayerAudioPlugin'
+ },
+ controls: { // This plugin is automatically loaded by flowplayer
+
+ // TODO: i18n tooltips
+ tooltips: {
+ // buttons: false,
+ // play: '',
+ // pause: '',
+ // mute: '',
+ // unmute: '',
+ // stop: '',
+ // fullscreen: '',
+ // fullscreenExit: '',
+ // next: '',
+ // previous: '',
+ // scrubber: true
+ // volume: true
+ },
+
+ // Coloring properties
+ backgroundColor: '#006699',
+ backgroundGradient: 'low',
+ timeColor: '#ffffff',
+ durationColor: '#000000',
+ progressColor: '#000000',
+ progressGradient: 'low',
+ bufferColor: '#ffffff',
+ bufferGradient: 'low',
+ sliderColor: '#999999',
+ sliderGradient: 'low',
+ buttonColor: '#ff9d3c',
+ buttonOverColor: '#000000',
+ volumeSliderColor: '#999999',
+ volumeSliderGradient: 'low',
+ timeBgColor: '#006699',
+
+ // Position, dimensions, ...,
+ height: '30px',
+
+ // Visibility properties and buttons
+ autohide: 'never',
+ hideDelay: 4000,
+ all: true,
+ playlist: false,
+ fullscreen: false
+ }
}
- });
+ }
+ })
});
EOF
) ?>
-<a id="flowplayer" class="flowplayer" href="<?php echo
public_path($representation->getFullPath()) ?>">
+<a class="flowplayer flowplayerAudio" href="<?php echo $pathToAudioFile ?>">
<img src="/~jesus/qubit/web/images/generic-icons/blank.png" />
</a>
<!-- link to download master -->
-<?php if ($link != null): ?>
- <?php echo link_to(__('download audio'),$link) ?>
+<?php if ($pathToAudioFile != null): ?>
+ <?php echo link_to(__('download audio'),$pathToAudioFile) ?>
<?php endif; ?>
\ No newline at end of file
Modified: trunk/apps/qubit/modules/digitalobject/templates/_showVideo.php
==============================================================================
--- trunk/apps/qubit/modules/digitalobject/templates/_showVideo.php Wed Sep
23 12:57:36 2009 (r3476)
+++ trunk/apps/qubit/modules/digitalobject/templates/_showVideo.php Wed Sep
23 12:58:23 2009 (r3477)
@@ -14,7 +14,7 @@
});
EOF
) ?>
- <a class="flowplayer" href="<?php echo
public_path($representation->getFullPath()) ?>">
+ <a class="flowplayer flowplayerVideo" href="<?php echo
public_path($representation->getFullPath()) ?>">
<?php echo image_tag($thumbnail->getFullPath()) ?>
</a>
<?php else: ?>
Modified: trunk/web/css/flowPlayer.css
==============================================================================
--- trunk/web/css/flowPlayer.css Wed Sep 23 12:57:36 2009 (r3476)
+++ trunk/web/css/flowPlayer.css Wed Sep 23 12:58:23 2009 (r3477)
@@ -1,26 +1,17 @@
-/* dimensions for both splash image and the player wrapper */
+/* dimensions for both splash image and the player wrapper */
a.flowplayer, a.flowplayer img {
display:block;
- width:450px;
- height:350px;
border:0px;
margin-left: auto;
margin-right: auto;
-}
-
-/* play button on top of splash screen */
-div.playButton {
- background:url('../images/play.png') no-repeat;
- width:50px;
- height:50px;
- position:relative;
- top:-190px;
- left:200px;
- opacity:0.9;
- margin-bottom:-50px;
-}
-
-/* play button upon mouseover */
-div.playButton:hover {
- opacity:1.0;
}
+
+a.flowplayerAudio {
+ width:450px;
+ height:30px;
+}
+
+a.flowplayerVideo {
+ width:450px;
+ height:350px;
+}
\ No newline at end of file
Added: trunk/web/flowplayer/flowplayer.audio.swf
==============================================================================
Binary file. No diff available.
Added: trunk/web/flowplayer/flowplayer.controls.swf
==============================================================================
Binary file. No diff available.
Added: trunk/web/flowplayer/flowplayer.swf
==============================================================================
Binary file. No diff available.
Modified: trunk/web/vendor/flowplayer/flashembed.min.js
==============================================================================
--- trunk/web/vendor/flowplayer/flashembed.min.js Wed Sep 23 12:57:36
2009 (r3476)
+++ trunk/web/vendor/flowplayer/flashembed.min.js Wed Sep 23 12:58:23
2009 (r3477)
@@ -1,16 +1,16 @@
-/**
- * flashembed 0.29. Adobe Flash embedding script
+/*
+ * jquery.tools 1.1.1 - The missing UI library for the Web
*
- * http://flowplayer.org/tools/flash-embed.html
- *
- * Copyright (c) 2008 Tero Piirainen ([email protected])
- *
- * Released under the MIT License:
- * http://www.opensource.org/licenses/mit-license.php
+ * [tools.flashembed-1.0.4]
*
- * >> Basically you can do anything you want but leave this header as is <<
+ * Copyright (c) 2009 Tero Piirainen
+ * http://flowplayer.org/tools/
*
- * version 0.01 - 03/11/2008
- * version 0.29 - 06/08/2008
+ * Dual licensed under MIT and GPL 2+ licenses
+ * http://www.opensource.org/licenses
+ *
+ * -----
+ *
+ * File generated: Fri Sep 18 14:18:33 GMT+00:00 2009
*/
-function flashembed(root,userParams,flashvars){if(typeof
root=='string'){root=document.getElementById(root);}function
extend(to,from){if(from){for(key in
from){if(from.hasOwnProperty(key)){to[key]=from[key];}}}}var
params={src:'#',width:'100%',height:'100%',version:null,loadEvent:null,onFail:null,expressInstall:null,allowfullscreen:true,allowscriptaccess:'always',quality:'high',bgcolor:'#ffffff',type:'application/x-shockwave-flash',pluginspage:'http://www.adobe.com/go/getflashplayer'};if(typeof
userParams=='string'){userParams={src:userParams};}extend(params,userParams);var
evt=params.loadEvent;params.loadEvent=null;function load(){var
version=getVersion();var required=params.version;var
express=params.expressInstall;if(!root){return;}if(!required||isSupported(required)){params.onFail=params.version=params.expressInstall=null;root.innerHTML=getHTML();return
root.firstChild;}else if(params.onFail){var
ret=params.onFail.call(params,getVersion(),flashvars);if(ret){root.innerHTM
L=ret;}}else
if(required&&express&&isSupported([6,65])){extend(params,{src:express});flashvars={MMredirectURL:location.href,MMplayerType:'PlugIn',MMdoctitle:document.title};root.innerHTML=getHTML();}else{if(root.innerHTML.replace(/\s/g,'')!==''){}else{root.innerHTML="<h2>Flash
version "+required+" or greater is required</h2>"+"<h3>"+(version[0]>0?"Your
version is "+version:"You have no flash plugin installed")+"</h3>"+"<p>Download
latest version from <a
href='"+params.pluginspage+"'>here</a></p>";}}root['on'+evt]=null;}if(evt){if(!root){return;}root['on'+evt]=function(){return
load();};}else{return load();}function isSupported(version){var
now=getVersion();var
ret=(now[0]>version[0])||(now[0]==version[0]&&now[1]>=version[1]);return
ret;}function concatVars(vars){var out="";for(var key in
vars){if(vars[key]){out+=[key]+'='+asString(vars[key])+'&';}}return
out.substring(0,out.length-1);}function getHTML(){var html="";if(typeof
flashvars=='function'){flashvars=flashvars();}if(n
avigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){html='<embed
type="application/x-shockwave-flash"
';if(params.id){extend(params,{name:params.id});}for(var key in
params){if(params[key]!==null){html+=[key]+'="'+params[key]+'"\n\t';}}if(flashvars){html+='flashvars=\''+concatVars(flashvars)+'\'
/>';}}else{html='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
';html+='width="'+params.width+'"
height="'+params.height+'"';if(document.all&&parseInt(navigator.appVersion,10)<=6){params.id="_"+(""+Math.random()).substring(5);}if(params.id){html+='
id="'+params.id+'"';}html+='>';html+='\n\t<param name="movie"
value="'+params.src+'"
/>';params.id=params.src=params.width=params.height=null;for(var k in
params){if(params[k]!==null){html+='\n\t<param name="'+k+'"
value="'+params[k]+'" />';}}if(flashvars){html+='\n\t<param name="flashvars"
value=\''+concatVars(flashvars)+'\' />';}html+="</object>";}return
html;}function getVersion(){var version=[0,0];if(navig
ator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var
_d=navigator.plugins["Shockwave Flash"].description;if(typeof
_d!="undefined"){_d=_d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var
_m=parseInt(_d.replace(/^(.*)\..*$/,"$1"),10);var
_r=/r/.test(_d)?parseInt(_d.replace(/^.*r(.*)$/,"$1"),10):0;version=[_m,_r];}}else
if(window.ActiveXObject){try{var _a=new
ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{_a=new
ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version=[6,0];_a.AllowScriptAccess="always";}catch(ee){if(version[0]==6){return;}}try{_a=new
ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(eee){}}if(typeof
_a=="object"){_d=_a.GetVariable("$version");if(typeof
_d!="undefined"){_d=_d.replace(/^\S+\s+(.*)$/,"$1").split(",");version=[parseInt(_d[0],10),parseInt(_d[2],10)];}}}return
version;}function
asString(obj){switch(typeOf(obj)){case'string':return'"'+obj.replace(new
RegExp('(["\\\\])','g'),'\\$1')+'"';case'array':return'['+map(obj,func
tion(el){return asString(el);}).join(',')+']';case'object':var str=[];for(var
prop in
obj){if(obj.hasOwnProperty(prop)){str.push('"'+prop+'":'+asString(obj[prop]));}}return'{'+str.join(',')+'}';}return
String(obj).replace(/\s/g," ").replace(/\'/g,"\"");}function
typeOf(obj){if(obj===null||obj===undefined){return false;}var type=typeof
obj;return(type=='object'&&obj.push)?'array':type;}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};});}function
map(arr,func){var newArr=[];for(var i in
arr){if(arr.hasOwnProperty(i)){newArr[i]=func(arr[i]);}}return
newArr;}flashembed.getVersion=getVersion;flashembed.isSupported=isSupported;return
root;}if(typeof
jQuery=='function'){(function($){$.fn.extend({flashembed:function(params,flashvars){return
this.each(function(){flashembed(this,params,flashvars);});}});})(jQuery);}
\ No newline at end of file
+(function(){var e=typeof jQuery=="function";var
i={width:"100%",height:"100%",allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:null,onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(e){jQuery.tools=jQuery.tools||{};jQuery.tools.flashembed={version:"1.0.4",conf:i}}function
j(){if(c.done){return false}var
l=document;if(l&&l.getElementsByTagName&&l.getElementById&&l.body){clearInterval(c.timer);c.timer=null;for(var
k=0;k<c.ready.length;k++){c.ready[k].call()}c.ready=null;c.done=true}}var
c=e?jQuery:function(k){if(c.done){return
k()}if(c.timer){c.ready.push(k)}else{c.ready=[k];c.timer=setInterval(j,13)}};function
f(l,k){if(k){for(key in k){if(k.hasOwnProperty(key)){l[key]=k[key]}}}return
l}function g(k){switch(h(k)){case"string":k=k.replace(new
RegExp('(["\\\\])',"g"),"\\$1");k=k.replace(/^\s?(\d+)%/,"$1pct");return'"'+k+'"';case"array":return"["+b(k,function(n){return
g(n)}).join(",")+"]";case"function":return'"function()"';case"object":var
l=[];for(var m in
k){if(k.hasOwnProperty(m)){l.push('"'+m+'":'+g(k[m]))}}return"{"+l.join(",")+"}"}return
String(k).replace(/\s/g," ").replace(/\'/g,'"')}function
h(l){if(l===null||l===undefined){return false}var k=typeof
l;return(k=="object"&&l.push)?"array":k}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function
b(k,n){var m=[];for(var l in k){if(k.hasOwnProperty(l)){m[l]=n(k[l])}}return
m}function a(r,t){var q=f({},r);var s=document.all;var n='<object
width="'+q.width+'"
height="'+q.height+'"';if(s&&!q.id){q.id="_"+(""+Math.random()).substring(9)}if(q.id){n+='
id="'+q.id+'"'}if(q.cachebusting){q.src+=((q.src.indexOf("?")!=-1?"&":"?")+Math.random())}if(q.w3c||!s){n+='
data="'+q.src+'" type="application/x-shockwave-flash"'}else{n+='
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'}n+=">";if(q.w3c||s){n+='<param
name="movie" value="'+q.src+'" />'}q.width=q.height=q.id=q
.w3c=q.src=null;for(var l in q){if(q[l]!==null){n+='<param name="'+l+'"
value="'+q[l]+'" />'}}var o="";if(t){for(var m in
t){if(t[m]!==null){o+=m+"="+(typeof
t[m]=="object"?g(t[m]):t[m])+"&"}}o=o.substring(0,o.length-1);n+='<param
name="flashvars" value=\''+o+"' />"}n+="</object>";return n}function
d(m,p,l){var k=flashembed.getVersion();f(this,{getContainer:function(){return
m},getConf:function(){return p},getVersion:function(){return
k},getFlashvars:function(){return l},getApi:function(){return
m.firstChild},getHTML:function(){return a(p,l)}});var q=p.version;var
r=p.expressInstall;var
o=!q||flashembed.isSupported(q);if(o){p.onFail=p.version=p.expressInstall=null;m.innerHTML=a(p,l)}else{if(q&&r&&flashembed.isSupported([6,65])){f(p,{src:r});l={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title};m.innerHTML=a(p,l)}else{if(m.innerHTML.replace(/\s/g,"")!==""){}else{m.innerHTML="<h2>Flash
version "+q+" or greater is required</h2><h3>"+(k[0]>0?"Your versi
on is "+k:"You have no flash plugin
installed")+"</h3>"+(m.tagName=="A"?"<p>Click here to download latest
version</p>":"<p>Download latest version from <a
href='http://www.adobe.com/go/getflashplayer'>here</a></p>");if(m.tagName=="A"){m.onclick=function(){location.href="http://www.adobe.com/go/getflashplayer"}}}}}if(!o&&p.onFail){var
n=p.onFail.call(this);if(typeof
n=="string"){m.innerHTML=n}}if(document.all){window[p.id]=document.getElementById(p.id)}}window.flashembed=function(l,m,k){if(typeof
l=="string"){var
n=document.getElementById(l);if(n){l=n}else{c(function(){flashembed(l,m,k)});return}}if(!l){return}if(typeof
m=="string"){m={src:m}}var o=f({},i);f(o,m);return new
d(l,o,k)};f(window.flashembed,{getVersion:function(){var
m=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave
Flash"]=="object"){var l=navigator.plugins["Shockwave
Flash"].description;if(typeof
l!="undefined"){l=l.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var
n=parseInt(l.replace(/^(.*)\..*$/,"$1"),1
0);var
r=/r/.test(l)?parseInt(l.replace(/^.*r(.*)$/,"$1"),10):0;m=[n,r]}}else{if(window.ActiveXObject){try{var
p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(q){try{p=new
ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");m=[6,0];p.AllowScriptAccess="always"}catch(k){if(m[0]==6){return
m}}try{p=new
ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(o){}}if(typeof
p=="object"){l=p.GetVariable("$version");if(typeof
l!="undefined"){l=l.replace(/^\S+\s+(.*)$/,"$1").split(",");m=[parseInt(l[0],10),parseInt(l[2],10)]}}}}return
m},isSupported:function(k){var m=flashembed.getVersion();var
l=(m[0]>k[0])||(m[0]==k[0]&&m[1]>=k[1]);return
l},domReady:c,asString:g,getHTML:a});if(e){jQuery.fn.flashembed=function(l,k){var
m=null;this.each(function(){m=flashembed(this,l,k)});return
l.api===false?this:m}}})();
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---