Re: video.getContext

On Fri, Mar 9, 2012 at 2:31 PM, Sean Hayes <Sean.Hayes@microsoft.com> wrote:

> Well precisely. As I understand it the audio API is already context based,
> so a natural integration into HTML could be the result of AudioContext c =
> video.getContext("AudioContext"); we could of course mint an explicit
> attribute on the video API, and probably the document or Window API but the
> point is getContext is future proofed. For example if there was ever an
> AudioContext2. We don’t have to anticipate everything today.


The Web Audio API does not use a canvas-style getContext() API.

I don't think the image filters WD handles time varying content (i.e.
> access to past frames), which might be required for some video processing.
> So having a filter script context along the same lines as the audio context
> would probably make some sense; CSS application notwithstanding.
>

I have a proposal (and prototype implementation) for an API for processing
MediaStreams:
https://dvcs.w3.org/hg/audio/raw-file/tip/streams/StreamProcessing.html
It's targeted at audio right now (as an alternative to Chris Rogers' Web
Audio API), but designed to extend to video as well. (It's probably not
worth adding video processing until we have clear use cases and WebGL
support in Workers.)

In general I don't think APIs like canvas's getContext() are a good pattern
to follow. It's simpler just to add a named method or attribute for each
kind of object that can be returned.

Rob
-- 
“You have heard that it was said, ‘Love your neighbor and hate your enemy.’
But I tell you, love your enemies and pray for those who persecute you,
that you may be children of your Father in heaven. ... If you love those
who love you, what reward will you get? Are not even the tax collectors
doing that? And if you greet only your own people, what are you doing more
than others?" [Matthew 5:43-47]

Received on Friday, 9 March 2012 15:23:31 UTC