Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

audio description controler

13 replies [Last post]
Reply

Hi !

I'm testing the audiodescription plugin. This plugin is pretty cool to add an audio track with another language.
My question is : How can I put the volume lower when I activate the audio description with the AD button ?
Does an event exist ?

Thx

Reply

 
audiodescription plugin flashvars documentation: http://www.longtailvideo.com/support/forum/Plugins/20507/audio-description-controler

See the audiodescription.volume flashvar.

Reply

Sorry... It's not what what I mean.

Id'like to put the video's volume lower. Not the audiodescription's volume.

I try to increase the audio's volume, but it sounds very noisy...

Reply

 
So...  you want to change the volume level for the main audio if the user clicks on the "AD" button to activate the auxiliary audiodescription track?

You will have to find an event to monitor for the change, then confirm that the audiodescription plugin's state has changed, then adjust the main audio volume.

It has been my experience that the item Listener gets hit when the plugins are toggled. Here's how I monitor the HD plugin to change the player's size if the user toggles the HD state.

    <script type="text/javascript">
      var player     =  null;
      var playlist   =  null;
      var stuff      =  null;
      var morestuff  =  null;

      function playerReady(obj)
      {
        player = gid(obj.id);
        addListeners();
      };

      function addListeners()
      {
        playlist = player.getPlaylist();

        if(playlist.length > 0)
        {
          player.addControllerListener('ITEM', 'itemMonitor');
        }
        else
        {
          setTimeout("addListeners();", 100);
        }
      };

      function itemMonitor(obj)
      {
        if(player.getPluginConfig('hd')['state'])
        {
          setFlashSize(600, 370);
        }
        else
        {
          setFlashSize(500, 313);
        }

/*...only for testing
        stuff = '<br />Item:';

        for(var j in obj)
        {
          stuff += '<li>' + j + ': ' + obj[j] + '</li>';
        }

        stuff += '<li>hd.state: ' + player.getPluginConfig('hd')['state'] + '</li>';

        gid('item').innerHTML = stuff;
        setTimeout("gid('item').innerHTML = '';", 5000);
*/

/*...only for testing
        var plugconfig = player.getPluginConfig('hd');
        morestuff = '<br />HD Plugin Config:';

        for(var j in plugconfig)
        {
          morestuff += '<li>' + j + ': ' + plugconfig[j]  + '</li>';
        }

        gid('plugconfig').innerHTML = morestuff;
        setTimeout("gid('plugconfig').innerHTML = '';", 5000);
*/
      };

      function setFlashSize(newW, newH)
      {
        gid('playercontainer').style.width   =  newW + 'px';
        gid('playercontainer').style.height  =  newH + 'px';
        player.width                         =  newW;
        player.height                        =  newH;

      //...DO NOT comment out this code
      //...for some unknown reason,
      //...the player won't re-size the first time,
      //...unless the player config object is read
      //...Internet Explorer only
        var config = '<br />Config:';

        for(var j in player)
        {
          config += '<li>' + j + ': ' + player[j] + '</li>';
        }

      //gid('config').innerHTML = config;
      };

      function gid(name)
      {
        return document.getElementById(name);
      };
    </script>

If the item Listener is indeed getting hit when the audiodescription state changes (you will have to do some testing to confirm this), then you would adjust the volume like this:

      function itemMonitor(obj)
      {
        if(player.getPluginConfig('audiodescription')['state'])
        {
          player.sendEvent('VOLUME', '40');
        }
        else
        {
          player.sendEvent('VOLUME', '80');
        }

Reply

It's exactly what I want to do.
I'll try your solution tomorrow.

It's a good idea to change player size when the HD button is pressed. I'll try this to ;)

Thank you.

Reply

I can change the player size with the HD button thankyou ;)

But the item event is not send when I press the AD button.
Is another event send ?

It's seems to be the same for captions.

Reply

I couldn't find any event that changed when the audiodescription.state changes,
so I just used a simple looping timer.

    <script type="text/javascript">
      var player     =  null;
      var playlist   =  null;

      function playerReady(obj)
      {
        player = gid(obj.id);
        addListeners();
      };

      function addListeners()
      {
        playlist = player.getPlaylist();

        if(playlist.length > 0)
        {
          adChecker();
        }
        else
        {
          setTimeout("addListeners();", 100);
        }
      };

      function adChecker(obj)
      {
        if(player.getPluginConfig('audiodescription')['state'])
        {
          player.sendEvent('VOLUME', '40');
        }
        else
        {
          player.sendEvent('VOLUME', '80');
        }

        setTimeout("adChecker();", 500);

      //...only for testing
        gid('adchecker').innerHTML = '<br />AudioDescription State: ' + player.getPluginConfig('audiodescription')['state'] + '   Player Volume: ' + player.getConfig()['volume'];
      };

      function gid(name)
      {
        return document.getElementById(name);
      };
    </script>

Throw this somewhere in your HTML for testing.

    <div id="adchecker"></div>

Reply

Thank you for your advices.
I thought the same solution but i found it very ugly :p
Maybe it could be a good idea to add a spcial event for plugins ;)

Reply

 
It would be useful to have every plugin fire an event when it was toggled/activated/whatever, which could be monitored. Then, knowing that the plugin had changed, you could check the plugin's config file to see what had changed.

As it is now, the only way to do this is to look for an event that is being fired (like the HD plugin seems to always fire the ITEM event), but if there is no existing event being fired, then the only alternative is to run a loop, checking the plugin's config to see if something has changed. OR — alter the plugin, if the source is available.

Zach — comments???

Reply

The ability to update the volume of the player when AD is enabled totally makes sense - we'll look into adding this in a future release. (Or, feel free to implement it and we'll add it into the source.)

As for plugin interaction (plugins sending events or calling methods on one another), we still haven't decided about the best way to handle this. Expect something more formalized for Player 5.

Reply

Has this been improved? I need main audio to be quieter when AD is enabled, and then go back to what it was when AD is disabled.

Reply

I would also love to have an option that causes the original audio to be lowered or muted when audio descriptions are enabled. Our descriptions were original designed for SAP broadcast, so the original audio is mixed with the narration. It's impossible to sync the audio exactly, so the user hears an echo effect unless the original volume is low.

Reply

I would like to allow the user to control the volume of the audio description, are there any suggestions or forseeable updates that will allow this functionality?

Reply

Right now this is not supported.

Post new comment

  • Allowed HTML tags: <code> <blockquote> <em> <strong> <strike> <ul> <li> <ol>
  • You may post code using <code>...</code> .
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options