W3C home > Mailing lists > Public > public-media-capture@w3.org > October 2012

Re: meaning of pausing MediaStream, and when to set media.readystate to HAVE_ENOUGH_DATA

From: Robert O'Callahan <robert@ocallahan.org>
Date: Thu, 25 Oct 2012 11:39:13 +1300
Message-ID: <CAOp6jLZi44UagL-G2F01=UrGsGg12R-7YWumjCgGgCREY9jvMA@mail.gmail.com>
To: Wei Jia <wjia@google.com>
Cc: public-media-capture@w3.org
On Tue, Oct 23, 2012 at 1:02 PM, Wei Jia <wjia@google.com> wrote:

> I have 2 questions regarding MediaStream as media elements (
> http://www.w3.org/TR/mediacapture-streams/#mediastreams-as-media-elements
> ):
>
> 1. What's the meaning of pausing media stream? This is related to "The
> timeline does not increment when the MediaStream is paused" . Does
> "paused" means MediaStream not "enabled", or it refers to <video> pause?
>

In Gecko, pausing a <video> element whose source is a MediaStream forces
the MediaStream to pause.

This question comes from use case when MediaStream is displayed with
> <video>. When the display is resumed from <video> pause, should the
> currentTime jump by a large amount (the paused duration), or continue from
> where it paused?
>

In Gecko, it continues from where it paused.

2. When to set media.readystate to HAVE_ENOUGH_DATA?
> According to the spec, at loading stage, the user agent needs to
> immediately set the media.readystate to HAVE_ENOUGH_DATA. This will trigger
> loadedmetadata event as well. But at that time, the user agent might not
> have received any information about the videoWidth/videoHeight. Would it be
> good to change the sentence to "setting the media.readystate to
> HAVE_ENOUGH_DATA when appropriate"? This would allow user agent to
> set media.readystate to HAVE_ENOUGH_DATA when it receives the first video
> frame from media stream.
>

I think we should wait for some data to arrive before entering
HAVE_METADATA or HAVE_ENOUGH_DATA states. In Gecko, we currently fire
loadedmetadata as soon as a MediaStream is connected to the media element,
but delay loadeddata and canplaythrough until we actually have some data in
the stream. I think the latter behavior is good but we should fix
loadedmetadata to fire later, along with the other events.

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 Wednesday, 24 October 2012 22:39:43 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:02 GMT