summaryrefslogtreecommitdiff
path: root/chimere/static/jme/utils/jmeEmbedControls.js
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2012-03-07 22:15:24 +0100
committerÉtienne Loks <etienne.loks@peacefrogs.net>2012-03-07 22:15:24 +0100
commit72d8868224f99011a5e57109309d238f42fcbc8f (patch)
tree9db36ba788b05f0e6fecf74dfc8747ada0caadce /chimere/static/jme/utils/jmeEmbedControls.js
parent5174ba21c29556cd7b08e55e5aed73d8cb31259e (diff)
downloadChimère-72d8868224f99011a5e57109309d238f42fcbc8f.tar.bz2
Chimère-72d8868224f99011a5e57109309d238f42fcbc8f.zip
Add jme to the project
Diffstat (limited to 'chimere/static/jme/utils/jmeEmbedControls.js')
-rw-r--r--chimere/static/jme/utils/jmeEmbedControls.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/chimere/static/jme/utils/jmeEmbedControls.js b/chimere/static/jme/utils/jmeEmbedControls.js
new file mode 100644
index 0000000..99d9a0f
--- /dev/null
+++ b/chimere/static/jme/utils/jmeEmbedControls.js
@@ -0,0 +1,41 @@
+/*
+ * This script is a very simple utility to add predefined control-markup for rapid/quick start development with jme.
+ * Feel free to extend and change this markup for your needs.
+ */
+(function($){
+
+ var playerControls = '<div class="media-controls-wrapper"> \
+ <div class="media-controls" lang="en"> \
+ <a class="play-pause button"><span class="ui-icon ui-icon-play"> </span><span class="button-text">play / pause</span></a> \
+ <span class="current-time player-display"></span> \
+ <div class="timeline-slider"> \
+ <span class="handle-label">play position</span> \
+ <div class="progressbar"></div> \
+ </div> \
+ <span class="duration player-display"></span> \
+ <a class="mute-unmute button"><span class="ui-icon ui-icon-volume-on"> </span><span class="button-text">mute / unmute</span></a> \
+ <div class="volume-slider"><span class="handle-label">volume control</span></div> \
+ </div> \
+ </div>'
+ ;
+ var fullscreenBtn = '<a class="fullscreen button"><span class="ui-icon ui-icon-circle-zoomin"> </span><span class="button-text">zoomin / zoomout</span></a>';
+
+ $.fn.jmeEmbedControls = function(o){
+ return this
+ //append standard controls
+ .append(playerControls)
+ //add extra video controls
+ .each(function(){
+ //media-state makes only sense with video not audio
+ var hasVideo = $('video', this).after('<div class="media-state" />');
+ //include fullscreenn button only if plugin is included and we have a video-element
+ if( $.fn.enterFullWindow && hasVideo[0] ) {
+ $('div.media-controls', this).append(fullscreenBtn);
+ }
+ })
+ //register controls with jmeConttrol
+ .jmeControl(o)
+ ;
+ };
+
+})(jQuery); \ No newline at end of file