Re: [whatwg] Why does CanvasRenderingContext2D.drawImage not draw a video's poster?

2012-08-14 Thread Simon Pieters
On Sat, 21 Jul 2012 22:20:09 +0200, Silvia Pfeiffer  
 wrote:



Why? onmetadataloaded provides a sufficiently stable stuation: either
the poster img or video frame is then loaded (if @preload is not
"none") or it's black (if @poster is not set and @preload is "none").


That's not how it's currently specced. Since these events are already  
quite complicated to get right in impl, I'm opposed to making it even more  
complicated without seeing concrete use cases first.




I don't follow the objections.


We generally don't add stuff without use cases.

--
Simon Pieters
Opera Software


Re: [whatwg] Why does CanvasRenderingContext2D.drawImage not draw a video's poster?

2012-07-25 Thread Charles Pritchard
On Jul 21, 2012, at 1:20 PM, Silvia Pfeiffer  wrote:

> 
>> I'm not opposed to the idea, but I'm failing to see the benefit.
> 
> The advantage clearly is that if you have a canvas that is copying
> data out of the video, it includes the poster without having to write
> custom code for it. The poster is an integral part of the video (it's
> not distinguishable by the user whether it is a separate picture or a
> frame from the video), so I don't see why it should need custom
> handling.



Canvas is a lot of low level custom code. As a polyfill, it seems that Canvas 
coders ought to consider checking for a poster attribute in their code path 
regardless of how this goes.


> 
>> Still, if
>> there's going to be one, we're going to need an onposterloaded event.
> 
> Why? onmetadataloaded provides a sufficiently stable stuation: either
> the poster img or video frame is then loaded (if @preload is not
> "none") or it's black (if @poster is not set and @preload is "none").


Seems like a good place to spec this. +1.

I'm not up to speed on the video spec, but if this behavior for poster is not 
in there, consider proposing it to the editor(s).

-Charles

Re: [whatwg] Why does CanvasRenderingContext2D.drawImage not draw a video's poster?

2012-07-21 Thread Silvia Pfeiffer
On Thu, Jul 19, 2012 at 2:46 AM, Charles Pritchard  wrote:
> On 7/17/2012 11:06 PM, Silvia Pfeiffer wrote:
>>
>> On Wed, Jul 18, 2012 at 6:57 AM, Charles Pritchard 
>> wrote:
>>>
>>> On Jul 17, 2012, at 9:04 PM, Mark Callow 
>>> wrote:
>>>
 On 18/07/2012 00:17, Silvia Pfeiffer wrote:
>
> I think this is simply an idea that hasn't been raised before. I like
> it. Though even then sometimes there may be nothing when there is no
> explicit poster and preload is set to none.

 The language gives me the impression that drawing nothing was a
 deliberate choice, in particular because later on it says:
>>>
>>>
>>> We don't have events based on poster, so we don't know whether or not
>>> it's been loaded. Poster is meant for the video implementation. We use other
>>> events to know if video is playing.
>>>
>>> So as a coder, I can just do an attribute check to see if poster exists,
>>> then load it into an image tag. It's a normal part of working with Canvas.
>>> We always follow onload events.
>>
>> IIUC, that still excludes the case where there is no @poster attribute
>> set on video, @autoplay is set to none, and the browsers load the
>> first frame as the poster. It would make sense in this case to hand
>> that poster to the canvas. And it would make it easier if the
>> explicitly set @poster attribute would be used, too, so you don't have
>> to do that by hand.
>
>
> We need more data if we're going to try that, and I'm still rather timid on
> the idea though it would be nice if  would load the first frame of
> video (and ".gif" for that matter).
>
> We really don't know what the browser is going to show if it's not showing a
> poster. It could show an arbitrary frame, it could show some kind of frame
> with a blur or opacity change, it could add on various controls.

This is all theoretical. In practice, all browsers show a black frame,
since no other frame is actually available.


> I'm not opposed to the idea, but I'm failing to see the benefit.

The advantage clearly is that if you have a canvas that is copying
data out of the video, it includes the poster without having to write
custom code for it. The poster is an integral part of the video (it's
not distinguishable by the user whether it is a separate picture or a
frame from the video), so I don't see why it should need custom
handling.

> Still, if
> there's going to be one, we're going to need an onposterloaded event.

Why? onmetadataloaded provides a sufficiently stable stuation: either
the poster img or video frame is then loaded (if @preload is not
"none") or it's black (if @poster is not set and @preload is "none").

I don't follow the objections.

Cheers,
Silvia.


Re: [whatwg] Why does CanvasRenderingContext2D.drawImage not draw a video's poster?

2012-07-18 Thread Charles Pritchard
What do we do when the document has already loaded and we've added a new video 
element? Also, the concern was about elements that do not have a poster 
attribute defined: the section you mentioned would not be relevant.

I'm all for inclusiveness: I need to meet obligations of programmatic 
availability.

-Charles



On Jul 18, 2012, at 9:14 PM, Mark Callow  wrote:

> On 18/07/2012 13:57, Charles Pritchard wrote:
> 
>> We don't have events based on poster, so we don't know whether or not it's 
>> been loaded.
> 
> On 19/07/2012 09:46, Charles Pritchard wrote:
>> I'm not opposed to the idea, but I'm failing to see the benefit.
>> Still, if there's going to be one, we're going to need an
>> onposterloaded event.
> 
> I don't understand these concerns. Step 4 of the algorithm to be run
> when the video element is created or the @poster attribute is set,
> changed or removed says:
> 
>Fetch
>
> 
>the resulting absolute URL
>
> ,
>from the element's |Document
>
> |'s
>origin
>
> .
>This must delay the load event
>
> 
>of the element's document.
> 
> So once the documented is loaded, the poster, if there is one, will be
> available.
> 
> Regards
> 
>-Mark
> 
> -- 
> 注意:この電子メールには、株式会社エイチアイの機密情報が含まれている場合
> が有ります。正式なメール受信者では無い場合はメール複製、 再配信または情
> 報の使用を固く禁じております。エラー、手違いでこのメールを受け取られまし
> たら削除を行い配信者にご連絡をお願いいたし ます。
> 
> NOTE: This electronic mail message may contain confidential and
> privileged information from HI Corporation. If you are not the intended
> recipient, any disclosure, photocopying, distribution or use of the
> contents of the received information is prohibited. If you have received
> this e-mail in error, please notify the sender immediately and
> permanently delete this message and all related copies.
> 
> 
> 


Re: [whatwg] Why does CanvasRenderingContext2D.drawImage not draw a video's poster?

2012-07-18 Thread Mark Callow
On 18/07/2012 13:57, Charles Pritchard wrote:

> We don't have events based on poster, so we don't know whether or not it's 
> been loaded.

On 19/07/2012 09:46, Charles Pritchard wrote:
> I'm not opposed to the idea, but I'm failing to see the benefit.
> Still, if there's going to be one, we're going to need an
> onposterloaded event.

I don't understand these concerns. Step 4 of the algorithm to be run
when the video element is created or the @poster attribute is set,
changed or removed says:

Fetch


the resulting absolute URL

,
from the element's |Document

|'s
origin

.
This must delay the load event


of the element's document.

So once the documented is loaded, the poster, if there is one, will be
available.

Regards

-Mark

-- 
注意:この電子メールには、株式会社エイチアイの機密情報が含まれている場合
が有ります。正式なメール受信者では無い場合はメール複製、 再配信または情
報の使用を固く禁じております。エラー、手違いでこのメールを受け取られまし
たら削除を行い配信者にご連絡をお願いいたし ます。

NOTE: This electronic mail message may contain confidential and
privileged information from HI Corporation. If you are not the intended
recipient, any disclosure, photocopying, distribution or use of the
contents of the received information is prohibited. If you have received
this e-mail in error, please notify the sender immediately and
permanently delete this message and all related copies.





Re: [whatwg] Why does CanvasRenderingContext2D.drawImage not draw a video's poster?

2012-07-18 Thread Charles Pritchard

On 7/17/2012 11:06 PM, Silvia Pfeiffer wrote:

On Wed, Jul 18, 2012 at 6:57 AM, Charles Pritchard  wrote:

On Jul 17, 2012, at 9:04 PM, Mark Callow  wrote:


On 18/07/2012 00:17, Silvia Pfeiffer wrote:

I think this is simply an idea that hasn't been raised before. I like
it. Though even then sometimes there may be nothing when there is no
explicit poster and preload is set to none.

The language gives me the impression that drawing nothing was a
deliberate choice, in particular because later on it says:


We don't have events based on poster, so we don't know whether or not it's been 
loaded. Poster is meant for the video implementation. We use other events to 
know if video is playing.

So as a coder, I can just do an attribute check to see if poster exists, then 
load it into an image tag. It's a normal part of working with Canvas. We always 
follow onload events.

IIUC, that still excludes the case where there is no @poster attribute
set on video, @autoplay is set to none, and the browsers load the
first frame as the poster. It would make sense in this case to hand
that poster to the canvas. And it would make it easier if the
explicitly set @poster attribute would be used, too, so you don't have
to do that by hand.


We need more data if we're going to try that, and I'm still rather timid 
on the idea though it would be nice if  would load the first frame 
of video (and ".gif" for that matter).


We really don't know what the browser is going to show if it's not 
showing a poster. It could show an arbitrary frame, it could show some 
kind of frame with a blur or opacity change, it could add on various 
controls.


I'm not opposed to the idea, but I'm failing to see the benefit. Still, 
if there's going to be one, we're going to need an onposterloaded event.




Re: [whatwg] Why does CanvasRenderingContext2D.drawImage not draw a video's poster?

2012-07-17 Thread Silvia Pfeiffer
On Wed, Jul 18, 2012 at 6:57 AM, Charles Pritchard  wrote:
> On Jul 17, 2012, at 9:04 PM, Mark Callow  wrote:
>
>> On 18/07/2012 00:17, Silvia Pfeiffer wrote:
>>> I think this is simply an idea that hasn't been raised before. I like
>>> it. Though even then sometimes there may be nothing when there is no
>>> explicit poster and preload is set to none.
>> The language gives me the impression that drawing nothing was a
>> deliberate choice, in particular because later on it says:
>
>
> We don't have events based on poster, so we don't know whether or not it's 
> been loaded. Poster is meant for the video implementation. We use other 
> events to know if video is playing.
>
> So as a coder, I can just do an attribute check to see if poster exists, then 
> load it into an image tag. It's a normal part of working with Canvas. We 
> always follow onload events.

IIUC, that still excludes the case where there is no @poster attribute
set on video, @autoplay is set to none, and the browsers load the
first frame as the poster. It would make sense in this case to hand
that poster to the canvas. And it would make it easier if the
explicitly set @poster attribute would be used, too, so you don't have
to do that by hand.

Silvia.


Re: [whatwg] Why does CanvasRenderingContext2D.drawImage not draw a video's poster?

2012-07-17 Thread Charles Pritchard
On Jul 17, 2012, at 9:04 PM, Mark Callow  wrote:

> On 18/07/2012 00:17, Silvia Pfeiffer wrote:
>> I think this is simply an idea that hasn't been raised before. I like
>> it. Though even then sometimes there may be nothing when there is no
>> explicit poster and preload is set to none.
> The language gives me the impression that drawing nothing was a
> deliberate choice, in particular because later on it says:


We don't have events based on poster, so we don't know whether or not it's been 
loaded. Poster is meant for the video implementation. We use other events to 
know if video is playing.

So as a coder, I can just do an attribute check to see if poster exists, then 
load it into an image tag. It's a normal part of working with Canvas. We always 
follow onload events.


-Charles

Re: [whatwg] Why does CanvasRenderingContext2D.drawImage not draw a video's poster?

2012-07-17 Thread Mark Callow
On 18/07/2012 00:17, Silvia Pfeiffer wrote:
> I think this is simply an idea that hasn't been raised before. I like
> it. Though even then sometimes there may be nothing when there is no
> explicit poster and preload is set to none.
The language gives me the impression that drawing nothing was a
deliberate choice, in particular because later on it says:

When the |drawImage()

|
method is passed an animated image as its image argument, the user
agent must use the poster frame of the animation, or, if there is no
poster frame, the first frame of the animation.

Speaking of which, how does one specify the "poster frame" for an
animated image? There is no poster attribute on an img element. Is this
something specified in the file format? A quick search didn't reveal any
such for animated GIF or APNG files.

Drawing a video's poster, when available, seems much more user-friendly
to me.

Regards

-Mark


> On Tue, Jul 17, 2012 at 9:58 AM, Mark Callow  wrote:
>> The spec. for CanvasRenderingContext2D.drawImage says draw nothing when
>> a video element's readyState is  HAVE_NOTHING or HAVE_METADATA. I was
>> wondering why this was chosen vs. drawing the poster. A search in the
>> list archive didn't turn up any discussion or explanation.
>>
>> Regards
>>
>> -Mark
>>

-- 
注意:この電子メールには、株式会社エイチアイの機密情報が含まれている場合
が有ります。正式なメール受信者では無い場合はメール複製、 再配信または情
報の使用を固く禁じております。エラー、手違いでこのメールを受け取られまし
たら削除を行い配信者にご連絡をお願いいたし ます。

NOTE: This electronic mail message may contain confidential and
privileged information from HI Corporation. If you are not the intended
recipient, any disclosure, photocopying, distribution or use of the
contents of the received information is prohibited. If you have received
this e-mail in error, please notify the sender immediately and
permanently delete this message and all related copies.





Re: [whatwg] Why does CanvasRenderingContext2D.drawImage not draw a video's poster?

2012-07-17 Thread Silvia Pfeiffer
I think this is simply an idea that hasn't been raised before. I like
it. Though even then sometimes there may be nothing when there is no
explicit poster and preload is set to none.

Regards,
Silvia.

On Tue, Jul 17, 2012 at 9:58 AM, Mark Callow  wrote:
> The spec. for CanvasRenderingContext2D.drawImage says draw nothing when
> a video element's readyState is  HAVE_NOTHING or HAVE_METADATA. I was
> wondering why this was chosen vs. drawing the poster. A search in the
> list archive didn't turn up any discussion or explanation.
>
> Regards
>
> -Mark
>
> --
> 注意:この電子メールには、株式会社エイチアイの機密情報が含まれている場合
> が有ります。正式なメール受信者では無い場合はメール複製、 再配信または情
> 報の使用を固く禁じております。エラー、手違いでこのメールを受け取られまし
> たら削除を行い配信者にご連絡をお願いいたし ます。
>
> NOTE: This electronic mail message may contain confidential and
> privileged information from HI Corporation. If you are not the intended
> recipient, any disclosure, photocopying, distribution or use of the
> contents of the received information is prohibited. If you have received
> this e-mail in error, please notify the sender immediately and
> permanently delete this message and all related copies.
>


[whatwg] Why does CanvasRenderingContext2D.drawImage not draw a video's poster?

2012-07-17 Thread Mark Callow
The spec. for CanvasRenderingContext2D.drawImage says draw nothing when
a video element's readyState is  HAVE_NOTHING or HAVE_METADATA. I was
wondering why this was chosen vs. drawing the poster. A search in the
list archive didn't turn up any discussion or explanation.

Regards

-Mark

-- 
注意:この電子メールには、株式会社エイチアイの機密情報が含まれている場合
が有ります。正式なメール受信者では無い場合はメール複製、 再配信または情
報の使用を固く禁じております。エラー、手違いでこのメールを受け取られまし
たら削除を行い配信者にご連絡をお願いいたし ます。

NOTE: This electronic mail message may contain confidential and
privileged information from HI Corporation. If you are not the intended
recipient, any disclosure, photocopying, distribution or use of the
contents of the received information is prohibited. If you have received
this e-mail in error, please notify the sender immediately and
permanently delete this message and all related copies.