On a <video> element (I haven't tried <audio>), if you change the src=
attribute to a new file, you have to call .load() before .play(),
otherwise it replays the old file. This lost me half an hour of
debugging, and recently another person posted in the Mozilla newsgroups
having exactly the same problem.
I am told by an informed source (Boris Zbarsky) that the spec for
<video> requires this behaviour. Having spent ten minutes reading the
highly comprehensive specification, I could not find the location where
it says this. However, I believe him :-)
Question: why? This is counter-intuitive. Under what circumstances would
you want to set the src= attribute of a <video> tag to a file which you
did not want the loading process to begin immediately? Can we eliminate
the requirement, e.g. by having play() implicitly call load() if it
hasn't been called?
Gerv
- Video DOM API Gervase Markham
-