W3C home > Mailing lists > Public > public-media-capture@w3.org > March 2016

[mediacapture-fromelement] video.captureStream() with no source should throw

From: Philip Jägenstedt via GitHub <sysbot+gh@w3.org>
Date: Mon, 14 Mar 2016 12:27:55 +0000
To: public-media-capture@w3.org
Message-ID: <issues.opened-140660494-1457958473-sysbot+gh@w3.org>
foolip has just created a new issue for 
https://github.com/w3c/mediacapture-fromelement:

== video.captureStream() with no source should throw ==
Or at least, that is what Blink does:
https://chromium.googlesource.com/chromium/src/+blame/5e1a7b0dd27f9eaed596106ee2726cab03df07c9/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLMediaElementCapture.cpp#24

However, I would argue that this should not be spec'd by looking at 
`currentSrc`, but rather using `networkState`. We have a similar check
 in [Media 
Session](https://mediasession.spec.whatwg.org/#dom-htmlmediaelement-session):
> If the media element’s `networkState` is `NETWORK_LOADING` or 
`NETWORK_IDLE`, throw an `InvalidStateError` exception and abort these
 steps.

Blink actually throws `NotSupportedError`. The exception type is of 
minor importance, but consistency is nice. Media Session could change 
if there's a reason to prefer `NotSupportedError`.

The problem with `currentSrc` is that it isn't actually reset by the 
media element load algorithm, so it can be non-empty even when there 
is no resource any longer.

@miguelao

Please view or discuss this issue at 
https://github.com/w3c/mediacapture-fromelement/issues/37 using your 
GitHub account
Received on Monday, 14 March 2016 12:27:57 UTC

This archive was generated by hypermail 2.3.1 : Monday, 14 March 2016 12:27:57 UTC