W3C home > Mailing lists > Public > public-html@w3.org > March 2012

RE: video.getContext

From: Sean Hayes <Sean.Hayes@microsoft.com>
Date: Fri, 9 Mar 2012 16:33:26 +0000
To: "robert@ocallahan.org" <robert@ocallahan.org>
CC: Kornel Lesiński <kornel@geekhood.net>, "public-html@w3.org" <public-html@w3.org>
Message-ID: <E9A92BD0A4FC934EB7935470A46D15240905DD0D@DB3EX14MBXC325.europe.corp.microsoft.com>
Sure. I actually don’t care what the API pattern is. All I want to see is the ability to add processing to the pipeline improve accessibility for media. Happy to work with you on use cases around that.

From: rocallahan@gmail.com [mailto:rocallahan@gmail.com] On Behalf Of Robert O'Callahan
Sent: 09 March 2012 15:23
To: Sean Hayes
Cc: Kornel Lesiński; public-html@w3.org
Subject: Re: video.getContext

On Fri, Mar 9, 2012 at 2:31 PM, Sean Hayes <Sean.Hayes@microsoft.com<mailto: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 16:36:17 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:30 UTC