Closed Bug 1097260 Opened 10 years ago Closed 10 years ago

loadedmetadata event must be emitted once we know the video element dimension

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: jya, Assigned: jya)

References

Details

Attachments

(1 file, 3 obsolete files)

In bug 1092979, we added a mochitest to make sure the loadedmetadata event was fired as early as possible.

We should also check that the video dimensions are known.
See Also: → 879717
Test for video dimensions
Attachment #8521033 - Flags: review?(cajbir.bugzilla)
Assignee: nobody → jyavenard
Status: NEW → ASSIGNED
Comment on attachment 8521033 [details] [diff] [review]
Ensure video dimensions are known when loadedmetadata is fired

Review of attachment 8521033 [details] [diff] [review]:
-----------------------------------------------------------------

Is it worth checking if these values are the expected value?
Attachment #8521033 - Flags: review?(cajbir.bugzilla) → review+
(In reply to cajbir (:cajbir) from comment #2)
> Comment on attachment 8521033 [details] [diff] [review]
> Ensure video dimensions are known when loadedmetadata is fired
> 
> Review of attachment 8521033 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Is it worth checking if these values are the expected value?

probably, but then it's a much bigger change :)
Adding actual dimensions check
Attachment #8521033 - Attachment is obsolete: true
Comment on attachment 8521173 [details] [diff] [review]
Ensure video dimensions are known when loadedmetadata is fired

is(actual, expected) is preferred over ok(actual == expected).  It logs actual and expected so there's no need to construct the complicated log string by hand.
Attachment #8521173 - Attachment is obsolete: true
Updated as per kinetik's instructions
Attachment #8521238 - Attachment is obsolete: true
Keywords: checkin-needed
Please run this through Try first (or post a link and re-request checkin if you already have).
Keywords: checkin-needed
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/4819ef5bb245
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Not sure this is properly fixed for WebRTC at least.

When attaching a mediaStream to video.srcObject the loadedmetadata event is fired however the video.videoWidth and video.videoHeight are 0 until the first frame is received which happens on play.

According to the spec[1] the loadedmetadata event should be fired when:
The user agent has just determined the duration and dimensions of the media resource and the text tracks are ready.

http://dev.w3.org/html5/spec-preview/media-elements.html#event-media-loadedmetadata
Doh, ignore my comment. The event is never fired due to the reason mentioned (dimensions are not know until play).
That should still work. Let me file a bug.
See Also: → 1240478
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: