W3C home > Mailing lists > Public > public-html@w3.org > June 2009

Re: <video> toggling video rendering

From: Michael A. Puls II <shadow2531@gmail.com>
Date: Tue, 23 Jun 2009 06:43:23 -0400
To: "Robin Berjon" <robin@berjon.com>
Cc: "public-html@w3.org WG" <public-html@w3.org>
Message-ID: <op.uvy32lpw1ejg13@sandra-svwliu01>
On Tue, 23 Jun 2009 06:27:22 -0400, Robin Berjon <robin@berjon.com> wrote:

> On Jun 23, 2009, at 11:40 , Michael A. Puls II wrote:
>>> or use <audio>, and then the browser can optimize away the video  
>>> decoding.
>> Yes, I see that this works. But, that seems more complicated to switch  
>> between <video> and <audio> to get the effect.
> It's not that complicated really, and semantically it does make more  
> sense. What's more with the toggled off <video> you'd have to specify  
> what to do if it's passed to drawImage() or createPattern(), and neither  
> option (decoding offscreen to be ready when asked even though nothing is  
> shown, or returning nothing) is all that elegant. The same applies to  
> controls, what width and height would be, etc.

O.K., I see. Have <audio> and <video> play the same src file with <video>  
set to autoplay for example and <audio> not.

Then, do like this:

function toggleVideoOutput() {
     if (video.paused === true) {
         video.currentTime = audio.currentTime;
     } else {
         audio.currentTime = video.currentTime;

or something.

Received on Tuesday, 23 June 2009 10:44:02 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:44:49 UTC