Closed
Bug 569301
Opened 15 years ago
Closed 14 years ago
Media events registered via DOM 0 in script are never called (video.onprogress = alert; does not alert)
Categories
(Core :: Audio/Video, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: silviapfeiffer1, Assigned: kinetik)
Details
Attachments
(1 file, 1 obsolete file)
12.40 KB,
patch
|
kinetik
:
review+
roc
:
approval2.0+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
According to https://developer.mozilla.org/en/DOM/element.addEventListener there are three ways to register events:
* addEventListener
* add a onEvent attribute to the element
* set the onEvent IDL attribute to the function
In this concrete case, I tried all three with the progress event on the video element (this may apply to other video events, too, incidentally).
What works is:
* addEventListener("progress", ....)
* <video onprogress="..." >
What doesn't work is:
* video.onprogress in JavaScript
This is an example page where the error is exposed. If you remove the second script section and add "onprogress='progress(event)'" to the video element, it will work. But this unfortunately doesn't.
<html>
<head>
<title>Progress Events Test</title>
</head>
<body>
<script type="text/javascript">
function progress(e) {
var events = document.getElementById("events");
var text = document.createTextNode("progress : " +
e.lengthComputable + ", " +
e.loaded + ", " +
e.total);
var div = document.createElement("div");
div.appendChild(text);
if (events.childNodes.length > 0) {
events.insertBefore(div, events.childNodes[0]);
} else {
events.appendChild(div);
}
}
</script>
<video src='test.ogv'
width = "400px"
id='v1'
controls>
</video>
<div id="events">
</div>
<script type="text/javascript">
video = document.getElementById("v1");
video.onprogress = progress;
</script>
</body>
</html>
Reproducible: Always
Steps to Reproduce:
1. Use above example HTML page with a valid ogv file
2. You will not see any progress information printed
Actual Results:
no progress information is printed
Expected Results:
progress information is printed during loading an during playback of the video
Updated•15 years ago
|
Component: General → Event Handling
Product: Firefox → Core
QA Contact: general → events
Version: unspecified → Trunk
Updated•15 years ago
|
Component: Event Handling → Video/Audio
QA Contact: events → video.audio
Updated•15 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 1•15 years ago
|
||
Please fix this, I had to work around this for Firefox in the demos at http://people.opera.com/philipj/2010/07/21/html5-video-webinar/
Assignee | ||
Comment 2•14 years ago
|
||
This is true for all of the media events. Presumably it's necessary to support this for any event handler that can be registered this way via content attributes? I tried to find something to confirm this in various specs, but couldn't find anything definitive.
Assignee: nobody → kinetik
Status: NEW → ASSIGNED
Summary: video.onprogress is not being honored → Media events registered via DOM 0 in script are never called (video.onprogress = alert; does not alert)
Assignee | ||
Comment 3•14 years ago
|
||
Needs a test, but other than that I think this is all that's necessary.
Attachment #461387 -
Flags: review?
Assignee | ||
Updated•14 years ago
|
Attachment #461387 -
Flags: review? → review?(Olli.Pettay)
Updated•14 years ago
|
Attachment #461387 -
Flags: review?(Olli.Pettay) → review+
Assignee | ||
Comment 4•14 years ago
|
||
Rebased against trunk (after fatval landing), adds media mochitest. Carrying review forward since the rebasing changes are trivial.
Attachment #461387 -
Attachment is obsolete: true
Attachment #461999 -
Flags: review+
Assignee | ||
Comment 5•14 years ago
|
||
Comment on attachment 461999 [details] [diff] [review]
patch v1
Requesting approval2.0, this fixes a minor long standing hole in event handler support for the <video>/<audio> media events. Patch is trivial and includes a mochitest.
Attachment #461999 -
Flags: approval2.0?
Attachment #461999 -
Flags: approval2.0? → approval2.0+
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Whiteboard: [needs landing]
Assignee | ||
Comment 6•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [needs landing]
You need to log in
before you can comment on or make changes to this bug.
Description
•