TTML/changeProposal014

From W3C Wiki
Jump to: navigation, search

Audio Rendering - OPEN

  • Owner: Nigel Megitt.
  • Started: 14/06/13

Issues Addressed

ISSUE-10

Summary

Strawman

use the onenter associated with cues, and getCueAsAudio(), thus:
    cue.addEventHandler("enter", 

          function(sender)
          {
              var theVideo = document.getElementByName("theVideo");
              var savedVolume = theVideo.volume;
              theVideo.mute();
              // set watchdog on video in case it overruns the description duration
              var h = theVideo.addEventHandler("timeUpdate", 
                    function(video) {
                        if(video.currentTime > cue.endTime) video.pause();
                    }
              var myAudio = sender.getCueAsAudio();  // if this is too slow do outside handler
              myAudio.addEventHandler("ended", 
                    function(description) {
                        theVideo.removeEventHandler(h);
                        theVideo.Volume = savedVolume;
                        if(theVideo.paused) theVideo.play();
                    }
              myAudio.play();
          }
    } 

Edits to be applied

Edits applied

Impact

References