Re: [whatwg] Should <video controls> generate click events?

Okay, that is much more clear. Thank you.

Yes, I think adding information to the click event is a great approach.
Event objects often have additional information, like mouse coordinates or
key code, so it wouldn't feel like an unusual or special case. The previous
approach removes information, where this one adds it. Let's not forget that
the same information should apply to touch and hover events as well.

Although, how would you handle the case where a user clicks the mouse down
on the play button, drags it off the play button and then on to, say, the
fullscreen button before letting go?

What about an enum-esque integer constant instead of a string? Like
HTMLMediaElement.PLAY_BUTTON, etc.

It's worth thinking about whether this can/should be generalized to all
elements that have sub-controls. For example, a number input has those
little up and down buttons.



On Wed, Aug 21, 2013 at 10:00 AM, Simon Pieters <simonp@opera.com> wrote:

> On Wed, 21 Aug 2013 15:19:51 +0200, Rick Waldron <waldron.rick@gmail.com>
> wrote:
>
>  Are you suggesting that Silvia's earlier description of the
>> implications was wrong?
>>
>
> No, I was correcting misconceptions in the stuff I quoted.
>
>
>
>  Ok, I appreciate this correction, but this is still a poor solution. How
>> do
>> get notified of clicks on the controls?
>>
>
> You don't, except when clicks on the controls have an effect (e.g. 'play'
> for play).
>
> It may be the case that the change is suboptimal especially now that some
> browsers make the whole video a big play/pause button. I'm open to
> alternative solutions that would make Philip's example trivial to implement
> correctly for authors and still allow authors to be notified of clicks on
> the controls.
>
> For instance, I can imagine exposing a property on the click event that
> tells whether the user clicked on the controls, and maybe even what was
> being clicked (as a string).
>
> <video onclick="if (controlsTarget == null) { if (paused) play(); else
> pause(); }" ...></video>
>
>
> --
> Simon Pieters
> Opera Software
>

Received on Wednesday, 21 August 2013 14:21:52 UTC