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

RESOLVED FIXED in mozilla36

Status

()

Core
Audio/Video
RESOLVED FIXED
3 years ago
2 years ago

People

(Reporter: jya, Assigned: jya)

Tracking

Trunk
mozilla36
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 3 obsolete attachments)

(Assignee)

Description

3 years ago
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.
(Assignee)

Updated

3 years ago
See Also: → bug 879717
(Assignee)

Comment 1

3 years ago
Created attachment 8521033 [details] [diff] [review]
Ensure video dimensions are known when loadedmetadata is fired

Test for video dimensions
Attachment #8521033 - Flags: review?(cajbir.bugzilla)
(Assignee)

Updated

3 years ago
Assignee: nobody → jyavenard
Status: NEW → ASSIGNED

Comment 2

3 years ago
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+
(Assignee)

Comment 3

3 years ago
(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 :)
(Assignee)

Comment 4

3 years ago
Created attachment 8521173 [details] [diff] [review]
Ensure video dimensions are known when loadedmetadata is fired

Adding actual dimensions check
(Assignee)

Updated

3 years ago
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.
(Assignee)

Comment 6

3 years ago
Created attachment 8521238 [details] [diff] [review]
Ensure video dimensions are known when loadedmetadata is fired
(Assignee)

Updated

3 years ago
Attachment #8521173 - Attachment is obsolete: true
(Assignee)

Comment 7

3 years ago
Created attachment 8521239 [details] [diff] [review]
Ensure video dimensions are known when loadedmetadata is fired

Updated as per kinetik's instructions
(Assignee)

Updated

3 years ago
Attachment #8521238 - Attachment is obsolete: true
(Assignee)

Updated

3 years ago
Keywords: checkin-needed
Please run this through Try first (or post a link and re-request checkin if you already have).
Keywords: checkin-needed
(Assignee)

Comment 9

3 years ago
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=e4b14ad0cfaf
(Assignee)

Updated

3 years ago
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/4819ef5bb245
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/4819ef5bb245
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36

Comment 12

2 years ago
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

Comment 13

2 years ago
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: → bug 1240478
You need to log in before you can comment on or make changes to this bug.