aFarkas / jMediaelement

jquery multimedia framework
GNU General Public License v2.0
150 stars 23 forks source link

Problem integrating controls with API #6

Closed scabot closed 13 years ago

scabot commented 13 years ago

Hello. I have posted this on the forum - however since I got no response I'm reposting it here since it looks to me like a bug.

I have a problem when trying to use both controls an API to control my audio element - It seems as if the connection between the controls and the element is lost.

I have the following code copied from one of your demos for the audio player slightly modified (no sources inside the audio element):

<div class="media-player">
      <audio id="auscplayer" controls="controls">
      </audio>
      <div class="media-controls">
           <a class="play-pause"><span class="ui-icon"> </span><span class="button-text">play / pause</span></a>
            <span class="current-time player-display">00:00</span>
             <div class="timeline-slider">
                  <span class="handle-label">play position</span>
                  <div class="progressbar"></div>
             </div>
             <span class="duration player-display">00:00</span>
              <a class="mute-unmute"><span class="ui-icon"> </span><span class="button-text">mute / unmute</span></a>
              <div class="volume-slider"><span class="handle-label">volume control</span></div>
      </div>
  </div>

The controls load and display OK with: Copy code

 $('div.media-player').jmeControl();

When the user clicks some element on the page the following code is executed:

  $('#auscplayer').pause();
  $('#auscplayer').attr('src','dbwav.ashx?sid='+sessionId+'&mid='+this.name);
  $('#auscplayer').loadSrc().play(); 

What happens is that the audio will play OK. Even the play/pause button will display the pause icon. However the controls will not work. The duration and position will not change. Trying to click the pause button or the mute button will not work. Trying to change the volume will not work.

Any suggestions? Is this a bug?

I'm using FF 3.6.13

Thanks Sebastian

aFarkas commented 13 years ago

Hi Sebastian,

I have created a gist file, that works for me @ https://gist.github.com/842647 . You can simply put this into your demos-folder to test.

Something, that you should always do is to provide the type attribute. A browser can then detect, wether the file can be played, without downloading it. jme will do similiar things. If there is no type attribute, jme will guess the format by using a extension -> format mapping (this will fail in your case).

I don't think, that this will help, but maybe this gist is a good starting point to get nearer to your problem.

cheers alex

cheers alex

scabot commented 13 years ago

Thanks for the quick reply. I did as you suggested and set the type. Now it works great BUT I still have a problem. The sound files I'm using are very short wavs (about 11 seconds). When I change the volume or the mute state it will only affect the next wav and not the current. Say I have two buttons the first loads a wav I then change the volume or the mute state -nothing happens. Now I click the second button to load another wav - The previous volume settings are now in affect. Is there any way to fix this or is it something to do with the audio control?

aFarkas commented 13 years ago

can you send one of your short sound files: info [at] corrupt-system.de