[whatwg] Audio(): loop() with 0 or negative value as argument
Michael A. Puls II
shadow2531 at gmail.com
Fri Oct 19 02:24:51 PDT 2007
On 10/18/07, Ian Hickson <ian at hixie.ch> wrote:
> On Sat, 4 Aug 2007, Michael A. Puls II wrote:
> >
> > I see "The loopcount content attribute gives the number of times to play
> > the clip. The default value is 1."
> >
> > IMO:
> >
> > The name "loopcount" and the description for loopcount contradict each
> > other. It seems that the description is what is intended though.
>
> Yeah, I tried to fix that recently. Is it still broken?
Thanks.
It seems to be the same, but see below.
> > However, if loopcount has a default of 1, that to me means the first
> > time playing through is considered a loop. If so, do loopstart and
> > loopend override start and end during the first time of playback (the
> > steps seem confusing to me) or do loopstart and loopend only kick in
> > when the file truly loops and starts playing the second time etc.?
>
> Maybe we should rename 'loopcount' to 'playcount'...?
playcount fits better with "the number of times to play the clip" than
loopcount does.
> > Also, if the first time playing is considered a loop and the loopcount
> > starts at 1, should currentLoop start at 1 also? Or, if the index is
> > just meant to be zero-based, which one of these represents what
> > currentLoop returns?
> >
> > currentLoopArray[0] = first time playing
> > currentLoopArray[1] = second time playing
> >
> > if (currentLoop == 0) {
> > this is the first time playing;
> > }
>
> This one is correct.
O.K.
> > loopcount has a default of 1 because the first time playing is
> > considered a loop.
>
> Well, the first time isn't considered a loop really, but yes, the
> "loopcount" assumes each play is a loop.
O.K.
> > loopstart and loopend only kick in after the first time playing because
> > they don't consider the first time playing a loop.
>
> Right. loopstart is the start when you loop, which happens at the end of
> each loop... as it were.
O.K.
> > currentLoop considers the firt time playing a loop. So, if it's the
> > first time the file is playing, it will return 0 because the index is
> > zero-based.
>
> Right.
O.K.
> > So, if you could, add a definition of what a "loop" is in this case and
> > say that the first time playing is considered a loop. And, if loopstart
> > and loopend only kick in after the first time playing (the first true
> > loop), we need a name (like "looped play" with a defintition) to
> > differentiate it from "loop".
>
> Hmm. Is the spec really ambigious?
Here's an example:
mute: the number of times to play the clip. The default value is 1.
stop: the number of times to play the clip. The default value is 1.
foo: the number of times to play the clip. The default value is 1.
loopcount: the number of times to play the clip. The default value is 1.
playcount: the number of times to play the clip. The default value is 1.
Looking at each one of those, it's obvious what they do because the
description clearly says what they do.
Now, take away the descriptions and pretend you've never seen the spec
or those descriptions.
Which one specifies the number of times to play the clip?
a. mute
b. stop
c. foo
d. loopcount
e. playcount
or
Which one specifies the number of times to play the clip?
a. mute
b. stop
c. foo
d. loopcount
e. none of the above
or
If the loopcount is 1, how many times will the clip play?
a. 1
b. 2
or
If the loopcount is 0, how many times will the clip play?
a. 0
b. 1
Those should illustrate how the whole idea of the spec calling the
first time playing a 'loop', could confuse things. It might be O.K.,
but I imagine some getting confused where someone will have to say
"For HTML5 media elements, every playback iteratation of a clip is
considered a 'loop' (even the first). But, loopstart and loopend are
only effective on the 2nd playback iteration and above.", or something
like that.
Not suggesting these, but here's how I think about it.
PlaybackIterationCount: gives the number of times to play the clip.
The default is 1.
CurrentPlaybackIteration: gives the index of the current playback iteration
start: gives the offset at which playback is to begin for the first
iteration of playback
end: gives the offset at which playback is to end for the first
iteration of playback. The default value is infinity.
loopstart: gives the offset at which playback is to begin for every
playback iteration except the first. The default value is the same as
start.
loopend: gives the offset at which playback is to end for every
playback iteration except the first. The default value is the same as
end.
Now, I am suggesting:
loopCount -> playCount
currentLoop -> playIndex || currentPlayIndex || currentPlayCountIndex
start (don't change)
end (don't change)
loopstart (don't change)
loopend (don't change)
That will get rid of the ambiguities with 'loop' and will make things
clearer imo.
--
Michael
More information about the whatwg
mailing list