]> git.parisson.com Git - telemeta.git/commitdiff
added volume, still some changes to do in the playlist management and popups
authorriccardo <riccardo@parisson.com>
Tue, 29 Mar 2011 14:10:26 +0000 (16:10 +0200)
committerriccardo <riccardo@parisson.com>
Tue, 29 Mar 2011 14:10:26 +0000 (16:10 +0200)
telemeta/htdocs/js/playerUtils.js
telemeta/htdocs/timeside/skins/lab/img/volume.png
telemeta/htdocs/timeside/skins/lab/style.css
telemeta/htdocs/timeside/src/player.js
telemeta/htdocs/timeside/src/soundprovider.js

index 93b0c51c660a55de60ed94b4254fa3fed9f19ad0..a6f30038258d234f645babd799cb1b70dd55d82f 100644 (file)
@@ -36,7 +36,9 @@ function load_sound() {
         
         TimeSide.load(function() {
             provider.setSource(sound);
+            player.updateVolumeAnchor(provider.getVolume());
         });
+
     // sound.load(); // Auto-loading overloads the Django test server
     }
 }
index fb28016447f279cdb8f6d495da47fe278502e965..d741e5549e61624d3edb91debc8d7370246eb3fd 100644 (file)
Binary files a/telemeta/htdocs/timeside/skins/lab/img/volume.png and b/telemeta/htdocs/timeside/skins/lab/img/volume.png differ
index abc9543372d94fbb1b8595f17c87443de45b4a25..03365001115b51e5d1e6de9ebcbfeffe78670a80 100755 (executable)
     line-height: 13px;
 }
 
-.ts-skin-lab .ts-player .ts-viewer .ts-pointer {
+.ts-skin-lab .ts-player .ts-viewer { /*.ts-pointer {*/
     color: #3c4251;
     background: #e7e7e7;
 }
+.ts-pointer{
+    border: 1px solid #B0C4DE !important;
+     -moz-border-radius: .5ex !important;
+    -webkit-border-radius: .5ex  !important;
+    border-radius: .5ex !important;
+    color: #006666 !important;
 
+}
 .ts-skin-lab .ts-player .ts-ruler .ts-section .ts-label {
     color: #c3c2cc;
     background: #2a3242;
@@ -75,7 +82,7 @@
     background-image: url('img/volume.png');
     background-repeat: no-repeat;
     background-position: 0px 0px !important;
-    width:160px !important;
+    width:60px !important;
 }
 
 .ts-skin-lab .ts-player .ts-control .ts-playback .ts-play {
index b120cac9e4c037834517c98ec35033de2827df65..b24c79cd65796e5b4fc67905cfdb33457c21a84a 100644 (file)
@@ -107,9 +107,12 @@ TimeSide(function($N, $J) {
             this.elements.pause.attr('href', '#').bind('click', this.attach(this._onPause));
             this.elements.play.attr('href', '#').bind('click', this.attach(this._onPlay));
             //
-            this.elements.volume.attr('href', '#').bind('mousedown', this.attach(
+            this.elements.volume.attr('href', '#').click(function(){return false;}).bind('mousedown', this.attach(
                 function(e){
-                    this.changeVolume(e);
+                    if(e.which===1){ //left button
+                        this.changeVolume(e);
+                    }
+                    return false;
                 }
                 ));
 
@@ -160,7 +163,7 @@ TimeSide(function($N, $J) {
                 resizeTimer = setTimeout(this.attach(this.resize), 100);
             }));
              //_updateVolumeChanged(this.soundProvider.getVolume());
-             this.soundProvider.observe('volume',this.onVolumeChanged);
+             this.soundProvider.observe('volume',this.attach(this.onVolumeChanged));
         //this.container.resize(this.attach(this.resize)); // Can loop ?
         },
 
@@ -264,7 +267,7 @@ TimeSide(function($N, $J) {
             var vol = event.layerX;
             for(var i=0; i<ticks.length; i++){
                 if(vol<=ticks[i]){
-                    var index = i;
+                    //var index = i;
                     var volume = i*20;
                     this.soundProvider.setVolume(volume);
                     return false;
@@ -281,13 +284,16 @@ TimeSide(function($N, $J) {
         },
 
         updateVolumeAnchor: function(volume){
-            var indices = [20,40,60,80,100];
+            var indices = [20,40,60,80,100,100000];
             for(var i=0; i <indices.length; i++){
                 if(volume<indices[i]){
-                    this.elements.volume.css('backgroundPositionY',-28*(indices.length-i));
+                    var pos = -28*i;
+                    pos = '0px '+ pos+ 'px !important';
+                    this.elements.volume.css('backgroundPosition',pos);
+                    return;
                 }
             }
-          this.elements.volume.css('backgroundPositionY',0)
+         // this.elements.volume.css('backgroundPosition','0px 0px !important')
 
         },
 
index 621d81a0cf1c495b3a57d40e931f5bbbac4a066f..b0e7592310224b96173ea8466ea64dbfeedceec3 100644 (file)
@@ -42,8 +42,13 @@ TimeSide(function($N) {
 
         play: function() {
             if (this.sound) {
+                //it seems that, if sound is played until its end
+                //playing sound again resets the volume to 100, even though
+                //sound.volume is at the right value. We use this trick which seems to work:
+                this.sound.setVolume(this.sound.volume);
                 if (!this.sound.playState) {
                     this.sound.play();
+                    //console.log(this.getVolume());
                 } else if (this.sound.paused) {
                     this.sound.resume();
                 }
@@ -71,7 +76,7 @@ TimeSide(function($N) {
         },
 
         getVolume: function() {
-                return this.sound.volume;
+             return this.sound.volume;
         },
 
         seek: function(offset) {