W3C home > Mailing lists > Public > public-webrtc@w3.org > April 2022

[mediacapture-handle] CaptureHandleChangeEvent should just be Event (#50)

From: Jan-Ivar Bruaroey via GitHub <sysbot+gh@w3.org>
Date: Tue, 05 Apr 2022 18:51:48 +0000
To: public-webrtc@w3.org
Message-ID: <issues.opened-1193585370-1649184706-sysbot+gh@w3.org>
jan-ivar has just created a new issue for https://github.com/w3c/mediacapture-handle:

== CaptureHandleChangeEvent should just be Event ==
The [doc](https://w3c.github.io/mediacapture-handle/identity/index.html#capturing-side) says _"Capturing applications who are permitted to [observe](https://w3c.github.io/mediacapture-handle/identity/index.html#dfn-observable) a track's [CaptureHandle](https://w3c.github.io/mediacapture-handle/identity/index.html#dom-capturehandle) have two ways of reading it."_ 

This is one too many. The second way:
```js
let handle;
track.oncapturehandlechange = event => handle = event.captureHandle();
```
...seems entirely redundant, since this should suffice:
```js
let handle;
track.oncapturehandlechange = ({target}) => handle = target.getCaptureHandle();
```
I believe the common pattern in situations like this is to just fire a vanilla `Event`.

Please view or discuss this issue at https://github.com/w3c/mediacapture-handle/issues/50 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 5 April 2022 18:51:52 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 April 2022 18:51:53 UTC